php contact form help needed plz

Reply

Join Date: Oct 2008
Posts: 35
Reputation: Modo is an unknown quantity at this point 
Solved Threads: 0
Modo Modo is offline Offline
Light Poster

php contact form help needed plz

 
0
  #1
Jan 1st, 2009
Hello guys .. how r u ..

i am new to php (since we didnt get much php at university)
i am using it mainly to include the navigation menu, header, footer etc ..

i am working a on a contact form ..
people can send e-mails using a form even if it is not connected to
a datbase using something like:

  1. <form action="http://www.is.nl/cgi-bin/mailto.exe" method="post">


instead of for example:

  1. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

i tried using the first one i mentioned .. but it doesnt validate ..

does anyone know i can let it validate the form and use such a way to send e-mails
without connecting to a database?

thanks in advance
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 19
Reputation: ashafaaiz is an unknown quantity at this point 
Solved Threads: 1
ashafaaiz ashafaaiz is offline Offline
Newbie Poster

Re: php contact form help needed plz

 
0
  #2
Jan 2nd, 2009
Originally Posted by Modo View Post
Hello guys .. how r u ..

i am new to php (since we didnt get much php at university)
i am using it mainly to include the navigation menu, header, footer etc ..

i am working a on a contact form ..
people can send e-mails using a form even if it is not connected to
a datbase using something like:

  1. <form action="http://www.is.nl/cgi-bin/mailto.exe" method="post">

instead of for example:

  1. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

i tried using the first one i mentioned .. but it doesnt validate ..

does anyone know i can let it validate the form and use such a way to send e-mails
without connecting to a database?

thanks in advance
Hi,
You have to validate your whole form by passing values to javascript while submitting your form and then you may pass the values to any other php program thru action. If you want to pass values to another php then use session variables and use header() function instead of using action="" in form.


  1. <?
  2. session_start();
  3. if(isset($_POST['Submit']))
  4. {
  5. $_SESSION['name']=$_POST['Name'];
  6. ....................
  7. ...................
  8. ................
  9. header('Location: youphp.php');
  10. }
  11. ?>
  12. <html>
  13. <head>
  14. function ValidateForm()
  15. {
  16. //validate your form
  17. return true;
  18. }
  19. </head>
  20. <body>
  21. <form name="form1" method="post" action="" onSubmit="return ValidateForm();">
  22. //get all your data like Name,Email etc
  23. <input type="submit" name="Submit" value="Submit">
  24. </form>
  25. </body>
  26. </html>
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC