0

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:

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

instead of for example:

<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

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by ashafaaiz
0

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:

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

instead of for example:

<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.

<?
session_start();
if(isset($_POST['Submit']))
{
$_SESSION['name']=$_POST['Name'];
....................
...................
................
header('Location: youphp.php');
}
?>
<html>
<head>
function ValidateForm()
{
//validate your form
return true;
}
</head>
<body>
<form  name="form1" method="post" action="" onSubmit="return ValidateForm();">
//get all your data like Name,Email etc
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.