![]() |
|
|||||
|
|
#1 (permalink) |
|
Registered User
Join Date: Feb 2009
Location: Ohope Beach - New Zealand
Posts: 32
|
PHP Issues
I'm a deafie whos trying 2 make a website for a business I'm developing to run from home.
AM having trouble with an PHP form for submitting orders to my email address. I've got it set up where they select options and write in text boxes and upload an file, and then they click Submit, and it redirects them to a page that says thank you. But I dont get the order in my email - I dont know where it goes!! in my PHP file, it has my email address so thought it was correct. I did a testmail.php and that worked so I know the server is capable of doing this system. here is the code I am using....can anyone help please? ![]() <?php //--------------------------Set these paramaters-------------------------- $subject = 'Form Submission'; // Subject of email sent to you. $emailadd = 'chris_elizabeth@xtra.co.nz'; // Your email address. This is where the form information will be sent. $url = 'www.oceansidegraphics.co.nz/thankyou.htm'; // Where to redirect after form is processed. $req = '0'; // Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty. // --------------------------Do not edit below this line-------------------------- $text = "Results from form:\n\n"; $space = ' '; $line = ' '; foreach ($_POST as $key => $value) { if ($req == '1') { if ($value == '') {echo "$key is empty";die;} } $j = strlen($key); if ($j >= 20) {echo "Name of form element $key cannot be longer than 20 characters";die;} $j = 20 - $j; for ($i = 1; $i <= $j; $i++) {$space .= ' ';} $value = str_replace('\n', "$line", $value); $conc = "{$key}:$space{$value}$line"; $text .= $conc; $space = ' '; } mail($emailadd, $subject, $text, 'From: '.$emailadd.''); echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">'; ?> |
|
|
|
|
|
|
|
__________________
This advertising will not be shown in this way to registered members. Register your free account today and become a member on AllDeaf.com |
|
|
|
#2 (permalink) |
|
bloody phreak from hell
![]() |
I don't see where it gets emailed to you.
Shouldn't there be a location where the emails should be sent to?
__________________
![]() Check out my city... CLICK HERE! (If you already visited yesterday, visit again today!) |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: Feb 2009
Location: Ohope Beach - New Zealand
Posts: 32
|
yea
in the bit where it says change these parameters it has my email address which is chris_elizabeth at xtra.co.nz am using that one just to get the form working as I'm getting some aliases made for the form specifically... or am i doing the whole thing wrong lol |
|
|
|
|
|
#4 (permalink) |
|
Good times, good times.
![]() |
Looks like the php coding isn't closed. The email setting in the parameters seems correct. But the system won't compile. Try and get notepad++ from internet and paste htese php in notepad++ and ensure the notepad++ is formatted in php coding, where it will be possiblity help you find the error.
PHP Code:
__________________
![]() |
|
|
|
|
|
#6 (permalink) |
|
Good times, good times.
![]() |
Get a new page in the notepad++
(im new to PHP but I will see if I can help.) select 'language' from the menu in notepad and select 'PHP" then copy and paste there and you should find the errrors (depending on the colours)
__________________
![]() |
|
|
|
|
|
#7 (permalink) |
|
Good times, good times.
![]() |
The code in the parameters were wrong - (still unsure but may be possible) try and use the commas (") between these quotas, see edited code below (you can copy and pate if youw ant)
PHP Code:
__________________
![]() |
|
|
|
|
|
#8 (permalink) |
|
Registered User
Join Date: Feb 2009
Location: Ohope Beach - New Zealand
Posts: 32
|
everythings in
blue or grey and theres actually 2 shades of blue... the only things in red is the <?php and ?> as well as the numbers 20 and 1 and this is in the area not to edit.. Oddly though - I downloaded this script as I dont know how to make it so would be suprised if theres a error there... In the Parameters for me to edit - everything on the left side is blue, the bits where "form submission" my email address and website addy etc is grey, and the words on the right is all green.... hope that explains anything...I could do an screenshot and email to you or something... I've searched up and down google and havent got very far, am wanting to use this one coz its easy and not much to change....but as if its easy lol |
|
|
|
|
|
#12 (permalink) |
|
Registered User
Join Date: Feb 2009
Location: Ohope Beach - New Zealand
Posts: 32
|
FrontPage 2002 - Create a user submit form for your site.
I just found this Form Mail simplescript.php [Archive] - PowWeb Community Forums but cant figure out what the solution meant....as it sounds like he had the same problem as me - email not sending. |
|
|
|
|
|
#13 (permalink) |
|
YOU DOMESTIC DISSENT!
![]() Join Date: Apr 2007
Location: The Sopranos State
Posts: 22,913
|
Kiwi - you know that for this kind of Form, you usually need 3 pages.
1. the Form page where the user types in info 2. the PROCESS page where it processes your form 3. the Thank You page I'm assuming that you have done all 3 and it's still not working. It's most likely because it went to your spam folder and/or your server's rejecting it.
__________________
- Don't forget to buy Jiro's Special Edition Sunglasses for $19.95
|
|
|
|
|
|
#16 (permalink) |
|
Registered User
Join Date: Feb 2009
Location: Ohope Beach - New Zealand
Posts: 32
|
ohhh no wonder mines not working - and proves how much of a newbie i am
lol...so do u think i should look 4 a different form or do u know how 2 fix it? the page I'm trying to have submitted was made in Frontpage - has a few check boxes, 2 uploading images functions, a few text boxes and a radio button, and the php file has to be able to send the entire form including images to my email addy... |
|
|
|
|
|
#18 (permalink) | |
|
YOU DOMESTIC DISSENT!
![]() Join Date: Apr 2007
Location: The Sopranos State
Posts: 22,913
|
Quote:
__________________
- Don't forget to buy Jiro's Special Edition Sunglasses for $19.95
|
|
|
|
|
|
|
#19 (permalink) |
|
Registered User
Join Date: Feb 2009
Location: Ohope Beach - New Zealand
Posts: 32
|
i'm only using frontpage for the form page as its "built" in frontpage but using a different software for the actual website...
i'll upload the corrected form and see if that works... |
|
|
|
|
|
#20 (permalink) |
|
YOU DOMESTIC DISSENT!
![]() Join Date: Apr 2007
Location: The Sopranos State
Posts: 22,913
|
lol it's fine. I just don't use either Dreamweaver or Frontpage's WYSIWYG editor. As long as you're in CODER view, whatever the program you're using is fine. The reason why I use those is because of its nifty code coloring and auto-format.
beside that.... notepad++ is just fine as well.
__________________
- Don't forget to buy Jiro's Special Edition Sunglasses for $19.95
|
|
|
|
|
|
#22 (permalink) |
|
Registered User
Join Date: Feb 2009
Location: Ohope Beach - New Zealand
Posts: 32
|
if it failed for u - what is the recommended course of action i should do?
as the main thing I want is a form that works....and is simple to make! lol... i see u use dreamweaver - I've got the CS3 Package - would that do the job?....got it for Photoshop etc so yea. |
|
|
|
|
|
#23 (permalink) | |
|
YOU DOMESTIC DISSENT!
![]() Join Date: Apr 2007
Location: The Sopranos State
Posts: 22,913
|
Quote:
__________________
- Don't forget to buy Jiro's Special Edition Sunglasses for $19.95
|
|
|
|
|
|
|
#24 (permalink) |
|
Registered User
Join Date: Feb 2009
Location: Ohope Beach - New Zealand
Posts: 32
|
Ohhh OK i see...
the form page is at New Page 1 and just realised I'm talking 2 two ppl on here about it haha - i'm going crazy, am holding my 3 month old daughter at the same time so missus can cook T....so if i dont make sense then sorry! |
|
|
|
|
|
#26 (permalink) | |
|
YOU DOMESTIC DISSENT!
![]() Join Date: Apr 2007
Location: The Sopranos State
Posts: 22,913
|
Quote:
__________________
- Don't forget to buy Jiro's Special Edition Sunglasses for $19.95
|
|
|
|
|
|
|
#28 (permalink) | |
|
YOU DOMESTIC DISSENT!
![]() Join Date: Apr 2007
Location: The Sopranos State
Posts: 22,913
|
Quote:
__________________
- Don't forget to buy Jiro's Special Edition Sunglasses for $19.95
|
|
|
|
|
|
|
#29 (permalink) |
|
YOU DOMESTIC DISSENT!
![]() Join Date: Apr 2007
Location: The Sopranos State
Posts: 22,913
|
i copied the code and had it sent to me. it works. I did receive email but there's no information in it. that means we have to tweak the form just a bit.
__________________
- Don't forget to buy Jiro's Special Edition Sunglasses for $19.95
|
|
|
|
|
|
#30 (permalink) |
|
YOU DOMESTIC DISSENT!
![]() Join Date: Apr 2007
Location: The Sopranos State
Posts: 22,913
|
clarification - both codes (form and process) are correct but problem is... both are not designed to work with each other LOL! I'll have to create process code to work with your form
__________________
- Don't forget to buy Jiro's Special Edition Sunglasses for $19.95
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|