sorry guys, still i am in trouble.
What i am actually trying to do is to give a URL parameter to (ex; ID=1250) to my site registered persons. so they can use that ID at the end of My home page URL and place it in their promotional campaigns. (ex- http://www.aaaaa.com/1.php?ID=1250) so if a sale is done from a person linking from that URL, i can identify it as a sale done by ID=1250.
All goes ok. i passed URL parameters to pages using ?ID=<?php echo $_POST['id1250']; ?> coding at the end of a link
(ex; <a href="../Login.php?id1250=<?php echo $_POST['id1250']; ?>">
Further I can take the URL to a data base too using <?php echo $SERVER[REQUEST_URI]; ?> and <?php echo $SERVER[HTTP_REFERER]; ?>
But i cant pass the URL parameter through a Login page .i use dreamweaver MX2004. In that the login form action re directs using
$MM_redirectLoginSuccess = "forms/Login all successfull.php";
$MM_redirectLoginFailed = "forms/Login all again.php";
to get the URL parameter to the end of the redirects i used
$MM_redirectLoginSuccess = "forms/Login all successfull.php?id1250=<?php echo $POST['id1250']; ?>";
$MM_redirectLoginFailed = "forms/Login all again.php?id1250=<?php echo $POST['id1250']; ?>";
those 2 dynamic redirect will not work. an eror message appers in the login page as,
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/b/a/t/battipanchi/html/another/Login.php on line 15
What can i do about this. still i am trying. sorry if i am bothering you too much
thanks guy
sisira
Bellow is the full coding of my Login page
<?php require_once('Connections/utf8_general_ci.php'); ?><?php
// *** Validate request to login to this site.
session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {
$GLOBALS['PrevUrl'] = $accesscheck;
session_register('PrevUrl');
}
if (isset($_POST['Username'])) {
$loginUsername=$_POST['Username'];
$password=$_POST['Password'];
$MM_fldUserAuthorization = "accesslevel";
$MM_redirectLoginSuccess = "forms/Login all successfull.php?id1250=<?php echo $_POST['id1250']; ?>";
$MM_redirectLoginFailed = "forms/Login all again.php?id1250=<?php echo $_POST['id1250']; ?>";
$MM_redirecttoReferrer = false;
mysql_select_db($database_utf8_general_ci, $utf8_general_ci);
$LoginRS__query=sprintf("SELECT Username, Password, accesslevel FROM Register WHERE Username='%s' AND Password='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $utf8_general_ci) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'accesslevel');
//declare two session variables and assign them
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;
//register the session variables
session_register("MM_Username");
session_register("MM_UserGroup");
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body>
<div id="Layer2" style="position:absolute; width:924px; height:121px; z-index:45; left: 4px; top: 2px;">
<div id="Layer8" style="position:absolute; width:928px; height:87px; z-index:45; left: 2px; top: 2px; background-color: #000066; layer-background-color: #000066; border: 1px none #000000;">
<div id="Layer13" style="position:absolute; width:176px; height:74px; z-index:44; left: 62px; top: 11px; background-color: #000066; layer-background-color: #000066; border: 1px none #000000;">
<table width="100%" height="74" border="1" bordercolor="#000066">
<tr>
<td height="68" align="center" bordercolor="#000066" bgcolor="#000066"><strong><font color="#FFFFFF" size="5">DIRECTORY
LANKA.<font color="#FF00FF">COM</font></font></strong></td>
</tr>
</table>
</div>
</div>
<div id="Layer25" style="position:absolute; width:928px; height:41px; z-index:46; left: 2px; top: 86px; background-color: #000066; layer-background-color: #000066; border: 1px none #000000;">
<div id="Layer4" style="position:absolute; width:922px; height:39px; z-index:1; left: 0px; top: 1px; background-color: #000066; layer-background-color: #000066; border: 1px none #000000;">
<table width="920" border="1" bordercolor="#000066">
<tr align="center">
<td width="101" height="30" bordercolor="#0066FF"><a href="Classifieds/Classifieds.php"><font color="#FFFFFF"><strong>Classifieds</strong></font></a></td>
<td width="95" bordercolor="#0066FF"><a href="Directory/DIRECTORY.htm"><font color="#FFFFFF"><strong>Directory
</strong></font></a></td>
<td width="201" bordercolor="#0066FF"><a href="Articles/Articles.php"><font color="#FFFFFF" size="3"><strong>Articles
/ Submit An Articles</strong></font></a></td>
<td width="174" bordercolor="#0066FF"><a href="sms%20mms/SMS%20MMS.php"><font color="#FFFFFF"><strong>Send
Free SMS / MMS</strong></font></a></td>
<td width="98" bordercolor="#0066FF"><a href="tv/watch%20tv.php"><font color="#FFFFFF"><strong>Watch
TV </strong></font></a></td>
<td width="115" bordercolor="#0066FF"><a href="radio/Listen%20To%20Radio.php"><font color="#FFFFFF"><strong>Listen
To Radio</strong></font></a></td>
<td width="90" bordercolor="#0066FF"><a href="Messenger/messenger.php"><font color="#FFFFFF"><strong>Messenger</strong></font></a></td>
</tr>
</table>
</div>
</div>
<div id="Layer47" style="position:absolute; width:638px; height:28px; z-index:48; left: 286px; top: 60px; background-color: #000066; layer-background-color: #000066; border: 1px none #000000;">
<table width="638" border="0">
<tr align="center">
<td width="101" height="22" bgcolor="#CCCCCC"><strong><a href="index.php">Home</a></strong></td>
<td width="103" bgcolor="#CCCCCC"><strong><a href="Company.php">Company</a></strong></td>
<td width="104" bgcolor="#CCCCCC"><strong><a href="Contact.php">Contact</a></strong></td>
<td width="97" bgcolor="#CCCCCC"><strong><a href="FAQ.php">FAQ</a></strong></td>
<td width="104" bgcolor="#CCCCCC"><strong><a href="Login.php">Login</a></strong></td>
<td width="103" bgcolor="#CCCCCC"><strong><a href="Site%20Map.php">Site
Map</a></strong></td>
</tr>
</table>
</div>
</div>
<div id="Layer1" style="position:absolute; width:300px; height:150px; z-index:46; left: 634px; top: 140px;"><a href="Advertisng%20packages/Banner%20ads.php"><img src="pictures/banners/Login1%20300%20150.GIF" width="300" height="150" border="0"></a></div>
<div id="Layer1" style="position:absolute; width:300px; height:150px; z-index:46; left: 634px; top: 296px;"><a href="Advertisng%20packages/Banner%20ads.php"><img src="pictures/banners/Login2%20300%20150.GIF" width="300" height="150" border="0"></a></div>
<div id="Layer5" style="position:absolute; width:512px; height:313px; z-index:48; left: 7px; top: 141px;">
<table width="618" height="306" border="1" bordercolor="#000066">
<tr>
<td width="608" height="300" valign="top" bordercolor="#FFFFFF"><p>If you
have already loged in <a href="forms/Login%20all%20successfull.php"><strong>CLICK</strong></a> here to access the restricted area </p>
<p>If You are already registered,
please fill the following details</p>
<p><strong><font color="#000033" size="6">Login</font></strong></p>
<form action="<?php echo $loginFormAction; ?>" method="POST" name="Login_All" id="Login_All">
<table width="605" border="0" bordercolor="#000066" bgcolor="#CCFFFF">
<tr valign="middle">
<td width="109" bordercolor="#FFFFFF"> </td>
<td width="149" height="65" align="center" bordercolor="#FFFFFF">Username</td>
<td width="325" bordercolor="#FFFFFF"><input name="Username" type="text" id="Username" value="" maxlength="15"></td>
<td width="325" bordercolor="#FFFFFF"> </td>
</tr>
<tr valign="top">
<td bordercolor="#FFFFFF"> </td>
<td height="50" align="center" bordercolor="#FFFFFF">Password</td>
<td bordercolor="#FFFFFF"><input name="Password" type="password" id="Password" value="" maxlength="15"></td>
<td bordercolor="#FFFFFF"><input type="submit" name="Submit" value="Click Login"></td>
</tr>
</table>
</form>
<p>If You are not registered, please Register by clicking <a href="forms/Register%20db%20Form.php"><font color="#FF0000">RESTER
NOW</font></a></p></td>
</tr>
</table>