Hi all,
please look at the very simplified codes at
http://members.home.net/yihung/storescript.txt
http://members.home.net/yihung/shoppingcart2.php3.txt
1) from the store script , it shows that the first time a user click on the link, the session number should be shown.. it doesnt.
2) from the shoppingcart script, it shows that if id and session numbers match, the script shouldn't add the record again.. but it DOES!!! I have no idea why.
3) in the store script, i use request_uri .. but you see the problem is that the url gets larger and larger (with &add=#).. I tried ereg_replace function to replace add and session.. but the problem is that if the use already set a session, then &session=$session shouldnt appear, then the replace function wont work..
what I tried was
ereg_replace("&add=([0123456789]+)&session=([0123456789]+)", "&add=$row[id]&session=$session", "$REQUEST_URI")
Do you have any advice on how to code it so the url doesnt increase?
Thanks a lot!