SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
Thread: Redirect User
-
Apr 30, 2007, 00:04 #1
- Join Date
- Dec 2006
- Location
- /dev/swat
- Posts
- 619
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Redirect User
Hi guys .
I have the following code, how can i redirect the user to message.php
after submitting the form or page.
PHP Code:<?php
//ob_start();
include('../common/adm_inc_commons.php');
$sql="select * from m_user where nruser = $nruser";
$result = mysql_query($sql) or err_handler();
$row = mysql_fetch_object($result);
$nmname=$row->nmname;
$nmpass=$row->nmpassword;
$nmlogin=$row->nmlogin;
$nric=$row->nric;
$nmemail=$row->nmemail;
//******************************************************************************
$sql1="select * from m_parent_child where nruser=$nruser";
$result_list= mysql_query($sql1) or err_handler();
$row = mysql_fetch_array($result);
$childarray=$row->nruser_child;
//*********************************************************************************************
$sql="select * from m_user where nruser='$childarray' and cdcat='2'";
$result_child= mysql_query($sql) or mysql_error();
$row_child = mysql_fetch_array($result_child);
$name=$row_child->nmname;
$login=$row_child->nmlogin;
$pass=$row_child->nmpassword;
//********************************************************************************************
if (isset($_POST['btnsave_x'])) {
$email =htmlentities($_POST['nmemail']);
$msg =($_POST['message']);
$subject =htmlentities($_POST['subject']);
$headers = 'From: Straight-As Team <support@straight-a.com>' . "\r\n" .
'Cc: xxxxx@yahoo.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion() ."\r\n".
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$message = "
Dear valued subscriber,<br>
Welcome to Straight-As Program.<br>
Thank you for showing interest in Straight-As program.<br><br>
".$msg."
<br>
Kindly keep the above information for future references.<br>
For further information please contact:<br>
support@straight-a.com.<br>
Best regards,<br>
Straight-As Team.
";
$mail=mail($email,$subject,$message,$headers);
}
// If (!$mail'){header("Location:message.php");}//else {header("Location:message.php");}
// header("Location:message.php");
?>
<html>
<head>
<title>Straight-As:Customer</title>
</head>
<?php include('../common/adm_inc_top.php'); ?>
<body>
<?PHP include('adm_cus_send_pass_form.php')?>
</body>
</html>
-
Apr 30, 2007, 00:06 #2
- Join Date
- Oct 2005
- Location
- London, UK
- Posts
- 148
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Seems like you were on the right track:
PHP Code:
if(!$mail) {
header("Location: http://yoursite.com/message.php");
}
Good luck.
-
Apr 30, 2007, 00:10 #3
-
Apr 30, 2007, 00:18 #4
- Join Date
- Dec 2006
- Location
- /dev/swat
- Posts
- 619
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks guys
i try as u see in my code i comment that header
bcoz when i try to use like that it throw the message before
giving me the page to write email to user.
It mean that when i click the link to that user it directly give me message.
Not giving me the page to edit or write some message to user(In case of
header using there).
I hope u people will get it.
What i want.
-
Apr 30, 2007, 01:21 #5You can easily use relative paths:
-
Apr 30, 2007, 01:38 #6
- Join Date
- Dec 2006
- Location
- /dev/swat
- Posts
- 619
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks guys i got idea i use it inside the mail function and working.
PHP Code:header ('location:message.php');
The problem was where to put this header in the code to work properly.
Thanks guys...
-
Apr 30, 2007, 08:34 #7PHP Code:
if(mail(...,...,...)==true){
header("Location:success.php");
}else{
header("Location:error.php")
}
-
Apr 30, 2007, 14:46 #8
Bookmarks