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

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>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.