| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Apr 2004
Posts: 7
|
Hi, I am having a huge Session problem. There is a search routine in my project where the user can select a link whether the user wants to search a customer by company or by first name or by last name. After the selection the user now can typ in the term to search for. The result of that search will be created as a link where the user only can see the first name and the last name of the customer. For more details the user then can select the link he wants to where the detail.php is called and the details of the customer is shown. This is where the problem starts. To recognize wich customer is selected I attache the .$row['ID']. to the detail.php . And on the detail.php I form the sql query by .$_REQUEST['rid']. (see code below) select.php : <?php while ($row =mysql_fetch_assoc($result)): echo("<a href=\"detail.php?rid=".$row['ID']."\">".$row['fname']." ".$row['lname']."</a>"); endwhile; } ?> detail.php: <?php $sql = "select customers.fname, customers.lname, customers.number, customers.email, company.name, city.name from customers,company,city where customers.companyID=company.ID AND customers.cityID=city.ID AND customers.ID='" .$_REQUEST['rid']. "'"; $result = mysql_query($sql); ?> I get the details shown but somehow the PHPSESSID has changed . What am I doing wrong, can someone please help me ? |
|
|
|
|
|
#2 (permalink) | |
|
Registered User
Join Date: Apr 2004
Posts: 1
|
Quote:
this is just a stab in the dark, but do you mean the value of $_REQUEST['rid'] is changing? If so, try chaging $_REQUEST for $_GET . $_REQUEST reads url, post and cookie variables, so if you have any post or cookie variables called 'rid' it could be returning those. $_GET contains only url variables. |
|
|
![]() |