This is a discussion on "[SOLVED] first attempt at writting php form from scratch" within the PHP Forum section. This forum, and the thread "[SOLVED] first attempt at writting php form from scratch are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] first attempt at writting php form from scratch
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] first attempt at writting php form from scratch
I have tried my hand at writing my first form to php mailer. It worked fine until messed with the strings that define the $variables. Apparently I have a few syntax problems. Any help would be greatly appreciated. Thanks so much in advance!
here is the form...
|
|
|
|
||||
|
Re: first attempt at writting php form from scratch
what errors do you receive?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: first attempt at writting php form from scratch
No errors; really. I hit submit on the form and nothing happens. In version 1, I only tried to send the form elements by email, and that worked fine; the confirmation came up in the targeted iframe. Now, however, I have tried to stylize the output a bit. I wanted the email to look more like an email and not just a list on information. That's when it all went awry.
|
|
||||
|
Re: first attempt at writting php form from scratch
Uhh so what's not happening and what do you want to happen?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: first attempt at writting php form from scratch
After the fields are field out and someone presses "submit," I have an iframe to the side of the form that is supposed to say, "Success! Your email has been sent and Dynamic Dads will be in contact with you shortly." I think the browser is getting caught up in the php program I wrote and not progressing through because nothing is happening. The program is supposed to email the info to "info@dynamicdads.com" and back to the person who filled out the form as a receipt (labeled as $contacte) Nothing appears in iframe and no emails are sent or received.
|
|
||||
|
Re: first attempt at writting php form from scratch
Eesh why are you using iframes anyway? This would be something great to do in ajax!
Have you got this hosted anywhere? I'm not too sure what's happening with this iframe and it would be easier to see it.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: first attempt at writting php form from scratch
Ajax? I've heard of and seen ajax on sites, but I have never used it and am completely unfamiliar with its structure and syntax. If you could point to a place that could give me a walk through example of an ajax form that would be great. Does it matter what kind of server the site will be on, (Apache by the way)?
The form I am working with right now is hosted at http://www.narthexwebdesign.com/clie...ontact_us.html the post page is http://www.narthexwebdesign.com/clie...ds/request.php but it wont even load to see the source. So I'll put it here for you.
|
|
||||
|
Re: first attempt at writting php form from scratch
Here's your problem line
$address = $contactn\r . $add1\r . $add2\r . $city.", ".$state." ".$zip\r$country\r; WHen you are inserting special characters, put them in double quotes.. the same way you have done the space and comma. ie: $address = "{$contactn}\r{$add1}\r{$add2}\r{$city}, $state {$zip}\r{$country}\r;"; You won't get anywhere with these PHP errors Cheers,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Last edited by Rakuli; Nov 6th, 2007 at 09:50. |
|
|||
|
Re: first attempt at writting php form from scratch
Thanks Rakuli,
Couple of questions, if you don't mind. 1. If I understand you right, I need to put the entire string in double quotes - not just the space and the comma. Correct? 2. What do the curly brackets ({}) do? Is there a reason you did not place them around the $state variable? peace, Andrew |
|
||||
|
Re: first attempt at writting php form from scratch
In the case of your string that has lots of embedded special characters, it is easier to place the entire string in double quotes.
The reason I surrounded some with curly braces is because it tells php that it is a variable.. The variables are close to each other and if they all run together, sometimes php gets confused and doesn't interpret them correctly.. The reason why I didn't out them around $state is because it has space either side and doesn't need it. Cheers,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| scratch game | ahwell | Flash & Multimedia Forum | 13 | Feb 28th, 2008 23:09 |
| [SOLVED] First Attempt at Basic Image Gallery Not Working... | Jack Franklin | JavaScript Forum | 1 | Sep 30th, 2007 08:14 |
| Template or from scratch | Pádraig | Starting Out | 4 | Apr 20th, 2007 01:11 |
| setting up a poll from scratch | camcool21 | Webforumz Cafe | 2 | Dec 17th, 2006 14:40 |