|
|
#1 |
|
New Member
![]() Join Date: Jun 2011
Posts: 1
|
Hi, I am new to PHP and Javascript. The navlinks on my site do not point to individual pages, but rather when you click on "contact", for example, javascript makes the "contact" div expand.
Is this going to make it impossible for me to create a contact form in PHP since I don't have a separate "contact" page? I need someone to point me in the right direction. Thanks! |
|
|
|
|
|
#2 |
|
Gold Member
![]() Join Date: Feb 2011
Location: Australia
Posts: 369
|
It shouldn't stop you at all. It'll be trick.. and bit more troublesome if you try and have more than one form on the same page.
setup PHP to examine the page if $_POST is set. If not display page as normal, if so skip to the form processing. HERE is a very simple example of what i'm getting at :-) Of course this example has the form processing in a seperate page but you can easily keep it in the same file. I hope that helps.
__________________
Jason H. DHDdirect.com Domains - Hosting - Design |
|
|
|
|
|
#3 |
|
Bronze Member
![]() Join Date: Mar 2011
Posts: 29
|
also, I know it's just a tutorial, but always make sure you sanitize any user input.
|
|
|
|
![]() |
| Tags |
| contact form, javascript, php |
| Thread Tools | |
| Display Modes | |
|
|