here is the script that i’m using
<?php
$saving = $_REQUEST['saving'];
if ($saving == 1){
$Aname = $_POST['Aname'];
$name = $_POST['name'];
$last = $_POST['last'];
$mob = $_POST['mob'];
$ext = $_POST['ext'];
$email = $_POST['email'];
$add = $_POST['add'];
$com = $_POST['com'];
$day = $_POST['day'];
$text = $_POST['text'];
$date = date("M j, Y ");
$data = "Date Sent: {$date}\n\nName: {$name} {$last}\nPhone : {$mob} ext: {$ext}\nCompany: {$com}\nAddress : {$add}\nE-mail :
{$email}\nDay : {$day}\n\nNote :\n{$text}\n---------------------------------------\n";
$file = $Aname.'.txt';
file_put_contents ( $file, $data, FILE_APPEND );
}
?>
how can i prevent it from taking the user to another page after creation of the file, and also informing them that the file has been created?
The user is not going to another page after the creation of the file, the user is probably already going to another page when he / she hits the submit or save button.
To avoid that, you would have to use ajax: