PHP - Stream_context_create() And Disappearing Cookies
I've been trying to pass a cookie along to one of my sub domains, and the I'm getting an error:
An error #2 occurred in script 'C:\xampp\htdocs\optifit-hcg\application\controllers\test.php' on line 66: file_get_contents(http://localhost.optifit-hcg/horz_text_menu) [function.file-get-contents]: failed to open stream: HTTP request failed! The idea is that the script on the sub domain would return some data based on the cookie contents, but when I print_r() both $_SESSION and $_COOKIE the arrays are blank. Please let me know if you see anything wrong: Code: [Select] $opts['http']['method'] = 'GET'; $opts['http']['user_agent'] = $_SERVER['HTTP_USER_AGENT']; $cookie_string = 'Cookie: '; // If there are cookies, send them with the request if( count( $_COOKIE ) > 0 ) { $i = 1; foreach( $_COOKIE as $k => $v ) { if( $i !== 1 ) { $cookie_string .= '; '; } $cookie_string .= $k . '=' . urlencode( $v ); $i++; } // Development environment not compiled with curl wrappers if( ENVIRONMENT != 'development' ) { $opts['http']['header'][] = $cookie_string; } else { $opts['http']['header'] = $cookie_string; } } $context = stream_context_create( $opts ); $contents = file_get_contents( 'http://localhost.optifit-hcg/horz_text_menu', FALSE, $context ); echo $contents; Similar TutorialsI need to send two cookie name/value pairs to the page I am trying to open using file_get_contents, in order for the person viewing the page to have associated dynamic content, but it isn't working, and I'm wondering if I'm setting it up right: if(isset($_COOKIE['bwd_data']) && isset($_COOKIE['bwd'])){ $cookie_val = $_COOKIE['bwd_data']; $cookie_val2 = $_COOKIE['bwd']; $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "Cookie: bwd_data=" . $cookie_val . "\r\n" . "Cookie: bwd=" . $cookie_val2 ) ); $context = stream_context_create($opts); echo(file_get_contents(url::site('httperrors','http'), FALSE , $context)); }else{ echo(file_get_contents(url::site('httperrors','http'))); } i have this login in system the login page is in a folder called login with a couple other files related to a login system. when a user logs in the php creates several cookies and is suppose to redirect to another page which is in a separate folder. on the page you are suppose to get redirected to, it calls a file that checks to see if the user is loged on by checking some cookies against the database but the cookies aren't their anymore even though they were set. here is the login script Code: [Select] <?php require('database.php'); //Include DB connection information if (isset($_POST['login'])) { //Execute the following if form is submitted $ip = mysql_real_escape_string($_SERVER["REMOTE_ADDR"]); //Geet user's IP Address $email = mysql_real_escape_string($_POST['email']); //Post email from form $password = mysql_real_escape_string(sha1(md5($_POST['pass']))); //Post password from form and encrypt if (empty($email) || empty($password)) { //Check for empty fields die("<b>Error:</b> All fields are required to be filled in."); } $check = mysql_query("SELECT * FROM users WHERE email = '$email'") or die(mysql_error()); $check2 = mysql_num_rows($check); if ($check2 == 0) { //Check if account exists die("<b>Error:</b> Email and password do not match the database."); } $row = mysql_fetch_array($check); $key = $row['key']; $ppas = $password . $key; $db_password = $row['password']; if ($ppas != $db_password) { //Check if password is correct die("<b>Error:</b> Email and password do not match the database."); } $allowed = $row['pp']; if ($allowed != 1) { //Check if they have permission die("<b>Error:</b> You do not have permission to view this section."); } function randomstring($length = 10) { $validCharacters = "abcdefghijklmnopqrstuxyvwz1234567890"; $validCharNumber = strlen($validCharacters); $result = ""; for ($i = 0; $i < $length; $i++) { $index = mt_rand(0, $validCharNumber - 1); $result .= $validCharacters[$index]; } return $result; } $session = randomstring(); $pas = $password . $key; mysql_query("UPDATE users SET session_id='$session' WHERE email='$email' AND password='$pas' ") or die(mysql_error()); //Add session ID to DB mysql_query("UPDATE users SET login_ip='$ip' WHERE email='$email' AND password='$pas'") or die(mysql_error()); //Add login IP to DB $level = $row['accounttype']; $pp = $row['pp']; $fs = $row['fs']; $fam = $row['fam']; $fname = $row['firstname']; $gbsa = $row['gbsa']; $future = time() + 1209600; setcookie("uemail", $email, $future); //Set cookie containing username setcookie("sessionid", $session, $future); //Set cookie containging session ID setcookie("acounttype", $level, $future); setcookie("pp", $pp, $future); setcookie("fs", $fs, $future); setcookie("fam", $fam, $future); setcookie("gbsa", $gbsa, $future); setcookie("name", $fname, $future); ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// $page = mysql_real_escape_string($_GET['page']); if ($page == 1){ header("Location: ../pinkpanthers/index.php"); //Redirect to members page }else{ header("Location: ../main.php"); } }else { //If form is not submitted display the form echo<<<login <center> <h1>Log In </h1> <h2>Or GO <a href="../main.php">Home</a></h2> <form method="post" action=""> Email: <input type="text" name="email"><br> Password: <input type="password" name="pass"><br> <input type="submit" name="login" value="Login"><br><br> </form></center> login; } ?> and here is the check login page Code: [Select] <?php require('../login/database.php'); //Include DB connection information $ip = mysql_real_escape_string($_SERVER["REMOTE_ADDR"]); //Get user's IP Address $email = mysql_real_escape_string($_COOKIE['uemail']); //Get username stored in cookie $pp = mysql_real_escape_string($_COOKIE['pp']); if ($pp == 1){ $sessionid = mysql_real_escape_string($_COOKIE['sessionid']); //Get user's session ID $query = "SELECT * FROM `users` WHERE `email` = '$email' AND `session_id` = '$sessionid' AND `login_ip` = '$ip' AND `pp` = '1' "; $check = mysql_query($query) or die(mysql_error()); //Check if all information provided from the user is valid by checking in the DB $answer = mysql_num_rows($check); //Return number of results found. Equal to 0 if not logged in or 1 if logged in. if ($answer == 0 || $sessionid == '') { //Check if login is valid. If not redirect user to login page header('Location: ../login/login.php?page=1'); exit(); } $row = mysql_fetch_array($check); $email = stripslashes($row['email']); }else{ header('Location: ../login/login.php?page=1'); } ?> Hi I don't understand this stuff and am trying to debug it to see. This function seems to return Resource id #1. I have added an echo at line 33. Not a big file but would like to understand what is happening behind. http://www.des-otoole.co.uk/streetangels/eapi.php Code: [Select] <?php //==================================== Simple PHP code sample ==========================================// /* * We recommend that you use port 5567 instead of port 80, but your * firewall will probably block access to this port (see FAQ for more * details): * $url = 'http://www.bulksms.co.uk:5567/eapi/submission/send_sms/2/2.0'; * * Please note that this is only for illustrative purposes, we strongly recommend that you use our comprehensive example */ $url = 'http://www.bulksms.co.uk/eapi/submission/send_sms/2/2.0'; $data = 'username=your_username&password=your_password&message='.urlencode('Testing SMS').'&msisdn=44123123123'; $response = do_post_request($url, $data); print $response; function do_post_request($url, $data, $optional_headers = null) { $params = array('http' => array ( 'method' => 'POST', 'content' => $data, )); if ($optional_headers !== null) { $params['http']['header'] = $optional_headers; } $ctx = stream_context_create($params); echo "$ctx, $url, $data"; exit; $fp = fopen($url, 'rb', false, $ctx); if (!$fp) { print "Problem with $url, Cannot connect\n"; } $response = @stream_get_contents($fp); if ($response === false) { print "Problem reading data from $url, No status returned\n"; } return $response; } ?> <html> <body> <? echo $ctx ?> </body> </html> Ta Desmond. Hey guys, Been working on a project but only recently started using php. What happens is.... I have a general quiz split accross a multipage form and then a results section. The problem is, is that when it comes to if statements on the last page and deciding the difficulty level for the users quiz, it wont let me add the 3rd and final link. Here is the code to explain. I have put bits in bold and a comment. (at the bottom section) I've tried everything, Thanks for any help in advance guys. Code: [Select] <?php session_start(); $_SESSION['q11'] = $_POST['q11']; $_SESSION['q12'] = $_POST['q12']; $_SESSION['q13'] = $_POST['q13']; $_SESSION['q14'] = $_POST['q14']; $_SESSION['q15'] = $_POST['q15']; $protectscore = 0; //initialize score to zero $detectscore = 0; $resolvescore = 0; $overallScore = 0; ?> <html> <head> <title>Results</title> <h1>Protection Section</h1> <p><b>Question 1</b> <?php if ($_SESSION['q1'] == "1"){ echo("<b>Correct</b>"); $protectscore = $protectscore +1; }else{ echo("<b>Incorrect</b>"); } ?><BR> <b>Question 2</b> <?php if ($_SESSION['q2'] == "2") { echo("<b>Correct</b>"); $protectscore = $protectscore +1; }else{ echo("<b>Incorrect</b>"); } ?><BR> <b>Question 3</b> <?php if ($_SESSION['q3'] == "3") { echo("<b>Correct</b>"); $protectscore = $protectscore +1; }else{ echo("<b>Incorrect</b>"); } ?><BR> <b>Question 4</b> <?php if ($_SESSION['q4'] == "1") { echo("<b>Correct</b>"); $protectscore = $protectscore +1; }else{ echo("<b>Incorrect</b>"); } ?><BR> <b>Question 5</b> <?php if ($_SESSION['q5'] == "2") { echo("<b>Correct</b>"); $protectscore = $protectscore +1; }else{ echo("<b>Incorrect</b>"); } ?> <h1>Detection Section</h1> <b>Question 1</b> <?php if ($_SESSION['q6'] == "3") { echo("<b>Correct</b>"); $detectscore = $detectscore +1; }else{ echo("<b>Incorrect</b>"); } ?><BR> <b>Question 2</b> <?php if ($_SESSION['q7'] == "3") { echo("<b>Correct</b>"); $detectscore = $detectscore +1; }else{ echo("<b>Incorrect</b>"); } ?><BR> <b>Question 3</b> <?php if ($_SESSION['q8'] == "1") { echo("<b>Correct</b>"); $detectscore = $detectscore +1; }else{ echo("<b>Incorrect</b>"); } ?><BR><b>Question 4</b> <?php if ($_SESSION['q9'] == "2") { echo("<b>Correct</b>"); $detectscore = $detectscore +1; }else{ echo("<b>Incorrect</b>"); } ?><BR><b>Question 5</b> <?php if ($_SESSION['q10'] == "1") { echo("<b>Correct</b>"); $detectscore = $detectscore +1; }else{ echo("<b>Incorrect</b>"); } ?> <h1>Resolve Section</h1> <b>Question 1</b> <?php if ($_SESSION['q11'] == "2") { echo("<b>Correct</b>"); $resolvescore = $resolvescore +1; }else{ echo("<b>Incorrect</b>"); } ?><BR> <b>Question 2</b> <?php if ($_SESSION['q12'] == "1") { echo("<b>Correct</b>"); $resolvescore = $resolvescore +1; }else{ echo("<b>Incorrect</b>"); } ?><b><BR>Question 3</b> <?php if ($_SESSION['q13'] == "3") { echo("<b>Correct</b>"); $resolvescore = $resolvescore +1; }else{ echo("<b>Incorrect</b>"); } ?><BR><b>Question 4</b> <?php if ($_SESSION['q14'] == "3") { echo("<b>Correct</b>"); $resolvescore = $resolvescore +1; }else{ echo("<b>Incorrect</b>"); } ?><BR> <b>Question 5</b> <?php if ($_SESSION['q15'] == "1") { echo("<b>Correct</b>"); $resolvescore = $resolvescore +1; }else{ echo("<b>Incorrect</b>"); } ?> </p> <hr> <b>Total Sco </b>You answered <?php echo ($protectscore + $detectscore + $resolvescore); ?> question<?php if ($overallScore != 1) { echo("s"); } ?> Correctly <?php $qs = '15'; $overallScore = $protectscore + $detectscore + $resolvescore; $overallPercent = number_format(($overallScore * 100) / $qs); $ProtectionPercent = number_format(($protectscore * 100) / 5); $DetectionPercent = number_format(($detectscore * 100) / 5); $ResolvingPercent = number_format(($resolvescore * 100) / 5); ?><BR> <strong>Total Percentage is:</strong> <?php echo $overallPercent?> % <BR> Your Percentage From Protection Section is: <?php echo $ProtectionPercent?> % <BR> Your Percentage From Detection Section is: <?php echo $DetectionPercent?> %<BR> Your Percentage From Resolving Section is: <?php echo $ResolvingPercent?> %<BR> <HR> This section adds the link perfectly fine <?php if ($ProtectionPercent <= 30){ // beg echo '<li><a href="http://www.google.com> View Personalised Protection Content</a>'; } elseif ($ProtectionPercent > 30 && $ProtectionPercent <= 60){ //int echo '<li><a href="http://www.youtube.com"> View Personalised Protection Content</a>'; } else //exp { echo '<li><a href="http://www.facebook.com">View Personalised Protection Content</a>'; } ?><BR> <HR> This link add fine, however when i add the resolving if statement. This link disappear here and the Resolving section just doesnt appear <?php if ($DetectionPercent <= 30){ // beg echo '<li><a href="http://www.google.com> View Personalised Detection Content</a>'; } elseif ($DetectionPercent > 30 && $DetectionPercent <= 60){ //int echo '<li><a href="http://www.youtube.com"> View Personalised Detection Content</a>'; } else //exp { echo '<li><a href="http://www.facebook.com">View Personalised Detection Content</a>'; } When this part is added, this is when the error occurs <?php if ($ResolvingPercent <= 30){ // beg echo '<li><a href="http://www.google.com> View Personalised Resolving Content</a>'; } elseif ($ResolvingPercent > 30 && $ResolvingPercent <= 60){ //int echo '<li><a href="http://www.youtube.com"> View Personalised Resolving Content</a>'; } else //exp { echo '<li><a href="http://www.facebook.com">View Personalised Resolving Content</a>'; } ?> ?> MOD EDIT: [code] . . . [/code] tags added. I've been using clean URLs and it's been giving my PHP sessions for my user system some trouble. I display the logged in users username on every page via a header.php file that I require on every page. Sometimes when I click a link to navigate to a page with a clean URL, the session information "disappears" and asks the user to login but if I navigate to another page from the clean url that the session "disappeared" on, the logged in users username is displayed at the top of the page like normal. Any idea certain pages cause the session to "disappear"
Header.php where the user info is displayed. $_SESSION['username'] is set on the login page <? session_start(); if (isset($_SESSION['username'])) { echo "Welcome back, " . $_SESSION['username']; } ?> Edited June 13, 2020 by Nematode128 Hi All, I'm quite new to this PHP stuff and have been creating a site just for the hell of it really but i have a rather bizarre problem that has been driving me nuts for about a week... I have two drops downs, the first gives a list of teams from a mysql table and then this populates the next drop down with a list of players from the selected team.. so far so good. When I hit the select/submit button to select the player, what should happen is both the "team" and "player" are put into another query which gives the stats on the selected player for all the games that he has played in. however, what actually happens in the Session variable sets the "team" variable to blank. I can see this happening when I use Print_r ($_SESSION); So essentially when I click on either submit button from my drop down forms the other value is being removed from the Session array. Oh, the session is still valid (not being destroyed and replaced with another session). First drop down $query_teams="select Team from $teams"; $team_result=mysql_query($query_teams); $num_team=mysql_numrows($team_result); echo $num_team; print_r ($row_team); $team_count = 0; echo '<form method="post" action="map_selector.php">'; echo "<SELECT name='country'>"; while ($row_team1 = mysql_fetch_assoc($team_result)) { $team_info = $row_team1["Team"]; echo "<OPTION value='$team_info'>$team_info </option>"; } echo '</select>'; echo '<center><input type="submit" value="Search"></center>'; $country = $_POST["country"]; $_SESSION["country"] = $country; echo '</form>'; So SCOTLAND is selected Some sql queries to get the results for the possible players and then Drop down 2 $row_full = array_unique($row_home); echo '<form method="post" action="map_selector.php">'; echo "<SELECT name='Player'>"; foreach ($row_full as $key => $value) { echo "<OPTION value='$value'> $value"; } echo '</select>'; echo "@"; echo $country; echo "@"; echo '<center><input type="submit" value="Search"></center>'; $country=$_POST["country"]; $player=$_POST["Player"]; echo "#"; echo $country; echo "#"; echo '</form>'; $_SESSION["Player"] = $player; $selected_player = $_SESSION["Player"]; echo $player; echo $selected_player; echo $country; Print_r ($_SESSION); so Print_r ($_Session) returns: Array ( [Player] => [country] => Scotland [] => ) then a player "Paul Hartley" is selected from the player list and submit is click and then Print_r($_Session) shows: Array ( [Player] => Paul Hartley [country] => [] => ) Can anyone please help... I just can;t understand why this is happening when I'm using a Sessions which, I thought, would retain all variable values until a time-out or a destroy Thanks nhsal69 i'm trying to set a cookie value to a result from a query, but its not working. all of the other cookies are being set, except for one. any ideas why? <?php //Checks if there is a login cookie if(isset($_COOKIE['ID_forum'])) //if there is, it logs you in and directs you to the members page { $username = $_COOKIE['ID_forum']; $pass = $_COOKIE['Key_forum']; $user_level = $_COOKIE['Forum_level']; $check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { if ($pass != $info['password']) { } else { header("Location: index.php"); } } } if (isset($_POST['submit'])) { // if form has been submitted // makes sure they filled it in if(!$_POST['username'] | !$_POST['pass']) { die(' <h2> You did not fill in all of the fields</h2> <p<a href="login.php">Return to login page</a> '); } // checks it against the database $check = mysql_query("SELECT * FROM users WHERE username = '".$_POST['username']."'")or die(mysql_error()); //Gives error if user dosen't exist $check2 = mysql_num_rows($check); if ($check2 == 0) { die(' <h2> That user does not exist in our database.<br/> </h2> <p<a href="login.php">Return to login page</a> '); } while($info = mysql_fetch_array( $check )) { $_POST['pass'] = mysql_real_escape_string($_POST['pass']); $info['password'] = mysql_real_escape_string($info['password']); $_POST['pass'] = md5($_POST['pass']); //gives error if the password is wrong if ($_POST['pass'] != $info['password']) { die(' <h2> Incorrect password, please try again</h2> <p<a href="login.php">Return to login page</a> '); } else { $_POST['username'] = mysql_real_escape_string($_POST['username']); $_POST['user_level'] = mysql_real_escape_string($_POST['user_level']); $hour = time() + 3600; setcookie(ID_forum, $_POST['username'], $hour); setcookie(Key_forum, $_POST['pass'], $hour); setcookie(Forum_level, $_POST['user_level'], $hour); //this cookie is not being set setcookie(test, 'test cookie', $hour); // testing that cookie is being set - this works header("Location: index.php"); $query2 = mysql_query("SELECT * FROM users WHERE username = ".$_POST['username'])or die(mysql_error()); setcookie(Level_forum, $query2['user_level'], $hour); } } } else { // if they are not logged in ?> //form code is here. i have not included it to save space <?php } ?> Thanks Im trying to use the following code; if($login_Remember) { /* Check if Remember Me was set */ setcookie('login_ID', $row['ID'], time()+3600 * 24 * 30); setcookie('login_Name', $row['Name'], time()+3600 * 24 * 30); setcookie('login_Access', $row['Value'], time()+3600 * 24 * 30); } header("Location: index.php"); When i try to use it, the only cookie thats registered is the bottom on "login_Access". None of the others are. I have tried everything but nothings working. I dont get any error messages. Using PHP v5.3.3 on IIS Please help. Thanks When a user logs in it sets a cookie with their user id and sets the time they choose(either a session cookie or a cookie lasting one year for users who wish to stay logged in). when they select to stay logged in forever and close the browser the next time they open it, it tells them they arent logged in. however when they go to a new page they appear to be logged in. What i dont understand is why they have to go to a new page for it to say they are logged in. Here is the code which runs everytime the site is load if (isset($_COOKIE['uid'])) { $user->setup($_COOKIE['uid']); } user setup basically selects their info from the database and sets their username and other info to variables. Anyone know a better way to do this? This is prob a stupid question.. but i've always wondered..
When deleting a cookie why do we use
why do we use:
setcookie($name, '', time() - 3600, "/", "", 0);
when this works just fine:
setcookie($name, '', 0, "/", "", 0);
isn't the time() just a waste of space?
I ask this because everywhere i look i see:
setcookie($name, '', time() -3600 , "/", "", 0);
hi everybody ; its working Forgot Password i am posting a form.php to anohter page.php and if turn true i am sending mail and creating a cookie after header(Location: form.php) so cookie code in page.php Code: [Select] ob_start() sessioon_start $_COOKIE['mailsent'] = $mailii; setcookie("mailsent",$mailii,time()+(60*30)); i want show it Quote if(isset($_Cookie['mail'])) { echo "sent mail to $_Cookie['mailsent']" } but i am taking this Notice Quote Notice: Undefined index: kayip in J:\EasyPHP-5.3.2i\twww\site\form.php on line 133 when i lookup to site Cookies i am allready seem "mailsent" and value = $dynamic_mail so where am i doing wrong ?? Hey Everyone, I just have a quick question. I have a page that has set a cookie called email_success with the value "yes". I now need some code so that when the user goes to a download page, it checks for the cookie and if there is no cookie it redirects to another page. But if there is the cookie it displays the download page. I tried i few things but didn't work. Can anyone help me please!! Thanks George Hello all, I hope someone can shed some light/point me in the right direction. I have a site that allows you to search for a customer then view and change their detail. page 1 has a search box for name entry. page 2 displays all the matches retrieved from a db table that match. The user selects which customer is the correct 1 and sets a cookie containing the selected customers unique id. page 3 allows changing of the customers details. now the problem I have: If a user navigates to page 3 and has a customers details on page for viewing all is well. If they open a new tab (leaving page 3 open on first tab) and go to page 1, search for another customer, page 2 select another customer (which overwrites cookie) then to page 3. They now have two tabs open on page 3 both displaying different customer details. If they return to the first tab and change some detail, when they save it actually updates the users details that corrispond to the second tab. I know this is because the cookie has been changed that holds the unique id that is required for the update query. How can I prevent this? I've looked at sessions but it would seem the same issue would excist. Am I wrong? Many Thanks I hope I made sense. Hey all, http://www.adamrowden.co.uk/photo-searchr.asp If you visit this link, you'll see on the left side you have a few photos. If you click a photo from that page and then go back to the link i've provided you'll see that it shows you your 'recently viewed photos'. I'm wanting to do exactly that and need some pointers on how i would!? I'd be very grateful for any help Thanks, Jimmy m I'm trying to write a script that allows the user to select their personal settings for the site. They can pick the color of their background, link color, link hover color and the header color. the first file is supposed to use the defaults, blue for the links, orange for the link hover color red for the background and blue for the header. the second file is supposed to configure the cookie variables to store the values entered by the user and the third file i'm supposed to modify the internal stylesheet to utilize the values stored in the session variables. I tried to set each of the values in file two but i think i messed it up. I dont know how to modify the stylesheet to accept and change to the values of the cookies...Please help here are the files file1.php Code: [Select] <?php //Handle the form if it has been submitted: if (isset($_POST['background_color'], $_POST['link_color'], $_POST['link_hover_color'], $_POST['header_color'])){ //send the cookies: setcookie('background_color', $_POST['background_color'], time()+10000000); setcookie('link_color', $_POST['link_color'], time()+10000000); setcookie('link_hover_color', $_POST['link_hover_color'], time()+10000000); setcookie('header_color', $_POST['header_color'], time()=10000000); //Message to be printed later: $msg = '<p>Your settings have been entered! Click <a href="file2.php">here</a> to see them in action.</p>'; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>File1</title> <style type="text/css"> <!-- These are the styles the session (if it exists) should configure --> a:link {color:blue;} a:hover {color:orange;} body {background-color:red} h1 {color:blue; text-align:center;} </style> </head> <body> <?php //if the cookies were sent print a message if (isset($msg)){ print $msg; } ?> <div><p>Please complete this form to configure the appearance of this website:</p> <form action="File2.php" method="post"> <select name="background_color"> <option value="">Background Color</option> <option value="FF6600">Orange</option> <option value="CC00CC">Purple</option> <option value="FFFF00">Yellow</option> <option value="00FF00">Green</option> <option value="FF0066">Pink</option> <option value="000099">Blue</option> </select> <select name="link_color"> <option value="">Link Color</option> <option value="FF6600">Orange</option> <option value="CC00CC">Purple</option> <option value="FFFF00">Yellow</option> <option value="00FF00">Green</option> <option value="FF0066">Pink</option> <option value="000099">Blue</option> </select> <select name="link_hover_color"> <option value="">Link Hover Color</option> <option value="FF6600">Orange</option> <option value="CC00CC">Purple</option> <option value="FFFF00">Yellow</option> <option value="00FF00">Green</option> <option value="FF0066">Pink</option> <option value="000099">Blue</option> </select> <select name="header_color"> <option value="">Header Color</option> <option value="FF6600">Orange</option> <option value="CC00CC">Purple</option> <option value="FFFF00">Yellow</option> <option value="00FF00">Green</option> <option value="FF0066">Pink</option> <option value="000099">Blue</option> </select> <input type="submit" name="submit" value="Configure!" /> </form> </div> </body> </html> file2.php Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>File2</title> </head> <body> <div> <?php include('file1.php'); //check for a background color if (isset($_COOKIE['background_color'])){ print "\body: #" . htmlentities($_COOKIE['background_color']) . ";\n"; }else{ print "\body: #c00"; } //check for a link_color if (isset($_COOKIE['link_color'])){ print "\a:link: #" . htmlentities($_COOKIE['link_color']) . ";\n"; }else{ print "\a:link: #00f"; } //check for a link_hover color: if (isset($_COOKIE['link_hover_color'])){ print "a\:hover: #" . htmlentities($_COOKIE['link_hover_color']) . ";\n"; } //Check for a header color if (isset($_COOKIE['header_color'])){ print "\h1: #" . htmlentities($_COOKIE['header_color']). ";\n"; } ?> Your settings have been updated. <a href="File3.php">Click here</a> to continue. <br /><br /> </div> </body> </html> file3.php Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>File3</title> <style type="text/css"> <!-- These are the styles the session should configure --> a:link {color:blue;} a:hover {color:orange;} body {background-color:red} h1 {color:blue; text-align:center;} </style> </head> <body> <div> <h1>Welcome to YOUR pretty website</h1> <a href = "File1.php">Click here</a> to go back and start over!</a> </div> </body> </html> I'm pretty sure i did in file2 what i was supposed to do in file3 im totally confused i was trying to make a new login script and wanted to make point system which i can add points manually to member so i made a new column and named it userpoint i tried many many codes First i used
$_SESSION['userName'] = $username; echo "Welcome ".$_SESSION['userName']."!"; $_SESSION['userpoint'] = $userpoint; echo "you got".$_SESSION['userpoint']."!";the page showed username but didn`t show the points ! i tried then i figured out cookies if(isset($_COOKIE['ID_my_site'])) { setcookie( "userpoint"); $username = $_COOKIE['ID_my_site']; $userpoint = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error()); while($info = mysql_fetch_array( $check)) {this time the page shows both of usernames without mentioning the points ! i changed $userpoint = $_COOKIE['ID_my_site'];to $userpoint = $_COOKIE['Key_my_site']; and it showed the hashed password i want to set a new $_COOKIE so i can get members point to member area is that possible ? the script is still missing secure and salt and the security stuff i`ll add them later i just want to know if is that possible Edited by Ahmedamer, 03 September 2014 - 09:39 PM. This has been driving me crazy for hours! I am trying to set a cookie: setcookie("username", $_POST['user']); And for a while it wasn't working, then it started randomly working. Now, when I try to use if(isset($_COOKIE['username'])) PHP is saying the cookie does not exist. PLEASE help! Thanks. Hi guys, I am having a sticky problem with Cookies. Basically, I've had to change the settings of my CMS which has resulted in me now having the same cookie names for the cookie domains .domain.com and www.domain.com. I know I can just clear my cookies and the problem will be sorted, but it's not feasible for me to expect users of my site to clear their cookies. So my question is this. How can I delete the cookies created using www.domain.com with PHP? Everytime I set the expiry date of the cookies, it only applies it to those on .domain.com. Any help would be gratefully appreciated!! Dear all, i need help so badly...urgent i have customize a simple e-comm site (from www.phpwebcommerce.com tutorial), when user go checkout page(cart.php) it will show product item, quantity, sub-total , shipping, state and total price. Original from the tutorial using php do calculation but shipping cost is flat rate, i need to calculate shipping cost by state & quantity so that i use JavaScript do the calculation. my shopping cart process : 1. user checkout - go to cart.php (user can update qunatity and select state from this page then update cart) this page is working fine... 2. user enter info - user enter payment and shipping address 3. user continue checkout - go to checkoutconfirmation.php (my problem appear here, the information like quantity, sub-total, shipping cost & total from cart.php won't update here) I'm trying not do confuse myself & do it the eaiser way by using PHP cookies to send the javascript value tocheckoutconfirmation.php but i'm not sure how it work....i'm new to php and javascript, any help will appeciated ! Thank you in advanced !! cart.php Code: [Select] <?php require_once 'library/config.php'; require_once 'library/cart-functions.php'; $action = (isset($_GET['action']) && $_GET['action'] != '') ? $_GET['action'] : 'view'; switch ($action) { case 'add' : addToCart(); break; case 'update' : updateCart(); break; case 'delete' : deleteFromCart(); break; case 'view' : } $cartContent = getCartContent(); $numItem = count($cartContent); $pageTitle = 'Shopping Cart'; require_once 'include/header.php'; // show the error message ( if we have any ) displayError(); if ($numItem > 0 ) { ?> <head> <script type="text/javascript"> <!-- Begin function doMath() { var one = eval(document.getElementById('txtQty[]').value) //one = quantity //alert(one); var price = 0; var state = document.frmCart.state.value; ///////var pd_price = 72; ////////////// var unitPrice = document.getElementById('pd_price').innerText.substring(3); //alert(unitPrice); //alert(one); if(state == "east"){ if (one == 1){ price = 6; } else if (one == 2){ price = 8; } else if (one == 3){ price = 10; } else if (one == 4){ price = 12; } else if (one == 5){ price = 12.50; } else if (one == 6){ price = 13; } else if (one == 7){ price = 14; } else if (one == 8){ price = 0; } } else if(state == "west"){ if (one == 1){ price = 9.30; } if (one == 2){ price = 12; } if (one == 3){ price = 17.25; } if (one == 4){ price = 20; } if (one == 5){ price = 21; } if (one == 6){ price = 22; } if (one == 7){ price = 23.45; } if (one == 8){ price = 0; } } document.getElementById('subtotal').innerText = "MYR" + unitPrice * one; //document.frmCart.amount.innerText=price; document.getElementById('amount').innerText = price; ///amount = shipping //alert("asdf"); var test = document.getElementById('subtotal').innerText; // = one*pd_price; // //alert(test); //alert(one); test = parseInt(test.substring(3)) * one; //alert(test); //document.getElementById('subtotal').innerText = test; //alert(test); //alert("A" + price); //alert(parseInt(test)); //alert(one); document.getElementById('total').innerText = price + unitPrice * one; //total = shipping + subtotal test = "MYR" + test; document.getElementById('ct_qty').innerText = document.getElementById('subtotal').innerText; } //function custRound(x,places) { //return (Math.round(x*Math.pow(10,places)))/Math.pow(10,places) //} // End -->s </script> </head> <body onLoad="MM_preloadImages('../images/'), doMath()" > <tr><td align="center"><table width="900" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td align="center" bgcolor="#b6df51"><table width="800" border="0" cellspacing="0" cellpadding="0"><tr><td align="center"><table width="900" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center"><table width="900" border="0" align="center" cellpadding="0" cellspacing="0"> <tr><form action="<?php echo $_SERVER['PHP_SELF'] . "?action=update"; ?>" method="post" name="frmCart" id="frmCart"> <td align="center" bgcolor="#b6df51"><table width="800" border="0" cellspacing="0" cellpadding="0" > <tr> <td align="left"><img src="images/title_purchase_online.gif" width="280" height="25" /></td> </tr> <tr> <td> </td> </tr> <tr> <td align="center"><table width="800" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="800" border="0" cellpadding="0" cellspacing="0" bgcolor="#3b7b37"> <tr> <td width="15"><img src="images/title_box_left.gif" width="15" height="30" /></td> <td width="770"><table width="770" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="170" align="center" class="yellow_txt"><strong>Item</strong></td> <td width="213" align="center"> </td> <td width="141" align="center"><strong class="yellow_txt">Unit Price</strong></td> <td width="106" align="center"><strong class="yellow_txt">Quantity</strong></td> <td width="110" align="center"><strong class="yellow_txt">Total</strong></td> <td width="30" align="center"> </td> </tr> </table></td> <td width="15"><img src="images/title_box_right.gif" width="15" height="30" /></td> </tr> </table></td> </tr> <?php $subTotal = 0; for ($i = 0; $i < $numItem; $i++) { extract($cartContent[$i]); $productUrl = "other_products.php?c=$cat_id&p=$pd_id"; $subTotal += $pd_price * $ct_qty; ?> <tr> <td> </td> </tr> <tr> <td align="center"><table width="770" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="170" align="center" class="yellow_txt"><table width="150" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> </tr> <tr> <td width="116" align="center" valign="top" bgcolor="#b6df51"><a href="<?php echo $productUrl; ?>"><img src="<?php echo $pd_thumbnail; ?>" width="116" height="116" border="0" /></a><a href="<?php echo $productUrl; ?>"></a></td> </tr> <tr> </tr> </table></td> <td width="220" align="left" class="green_txt"><strong><a href="<?php echo $productUrl; ?>" style="text-decoration: none"><font color="000000"><?php echo $pd_name; ?></font></a></strong></td> <td width="128" align="center"><strong class="black_txt" id="pd_price"><?php echo displayAmount($pd_price); ?></strong></td> <td width="112" align="center"><input name="txtQty[]" type="text" id="txtQty[]" size="5" value="<?php echo $ct_qty; ?>" class="box" onKeyUp="checkNumber(this);"> <input name="hidCartId[]" type="hidden" value="<?php echo $ct_id; ?>"> <input name="hidProductId[]" type="hidden" value="<?php echo $pd_id; ?>"></td> <td width="110" align="center"><strong class="black_txt" id="ct_qty"><?php echo displayAmount($pd_price * $ct_qty); ?></strong></td> <td width="30" align="center" valign="middle"><a href="#"> <img src="images/btn_delete.png" width="16" height="16" border="0" onClick="window.location.href='<?php echo $_SERVER['PHP_SELF'] . "?action=delete&cid=$ct_id"; ?>';" /></a> </tr> </table></td> </tr> <?php } ?> <tr> <td> </td> </tr> <tr> <td><table width="800" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="13" height="13"><img src="images/text_box_big_left1.gif" width="13" height="13" /></td> <td width="774" height="13" bgcolor="#ffde00"><span class="style10"><img src="images/spacer.gif" width="13" height="13" /></span></td> <td width="13" height="13"><img src="images/text_box_big_right1.gif" width="13" height="13" /></td> </tr> <tr> <td bgcolor="#ffde00"> </td> <td height="50" align="center" bgcolor="#ffde00"><table width="770" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="132" align="center" class="yellow_txt"> </td> <td width="147" align="left" class="green_txt"> </td> <td width="113" align="center"> </td> <td width="102" align="center" class="black_txt"><strong>Sub-total</strong></td> <td colspan="2" align="center"><strong class="black_txt" id="subtotal"><?php echo displayAmount($subTotal); ?></strong></td> <td width="19" align="center" valign="middle"> </td> </tr> <tr> <td colspan="7" align="center" class="yellow_txt"><img src="images/spacer.gif" width="10" height="10" /></td> </tr> <!-------------------------------------------- shipping cost---------------------------------------------------> <tr> <td align="center" > </td> <td align="left" class="green_txt"> </td> <td> </td> <td align="center" class="black_txt"><strong>State</strong></td> <td colspan="2" align="center"> <select name="state"> <option value="east" selected>East </option> <option value="west">Peninsular</option> </select> </td> <td align="center" valign="middle"> </td> </tr> <tr> <td colspan="7" align="center" class="yellow_txt"><img src="images/spacer.gif" width="10" height="10" /></td> </tr> <tr> <td align="center" class="yellow_txt"> </td> <td align="left" class="green_txt"> </td> <td align="center"> </td> <td align="center" class="black_txt"><strong>Shipping</strong></td> <td width="131" align="right"> <strong class="black_txt"> MYR</strong><!--<input type="text" name="amount" disabled="disabled" size="17" style="background-color:transparent;" border="none" >--></td> <td width="122" align="left"><strong class="black_txt"> <div name="amount" id="amount"> 0</div></strong></td> <td align="center" valign="middle"> </td> </tr> <tr> <td align="center" class="yellow_txt"> </td> <td align="left" class="green_txt"> </td> <td align="center"> </td> <td align="center" class="black_txt33"> </td> <td colspan="2" align="center" class="black_txt33"> <font color="#FF0000">*Purchases of 8 boxes onwards free delivery charges.</font> </td> <td align="center" valign="middle"> </td> </tr> <!------------------------------------------------------------------------------------------------------> <tr> <td colspan="7" align="center" class="yellow_txt"><img src="images/spacer.gif" width="10" height="10" /></td> </tr> <tr> <td align="center" class="yellow_txt"> </td> <td align="left" class="green_txt"> </td> <td align="center"> </td> <td align="center" class="black_txt"><strong>Total</strong></td> <td width="131" align="right"> <!--<input type="text" name="amount" disabled="disabled" size="17" style="background-color:transparent;" border="none" >--><strong class="black_txt"> MYR</strong></td> <td colspan="2" align="left"><strong class="black_txt" id="total"><?php echo displayAmount($subTotal);// + $shopConfig['shippingCost']); ?></strong> </td> <td width="4" align="center" valign="middle"> </td> </tr> <tr> <td colspan="7" align="center" class="yellow_txt"><img src="images/spacer.gif" width="10" height="10" /></td> </tr> <tr> <td align="center" class="yellow_txt"> </td> <td align="left" class="green_txt"> </td> <td align="center"> </td> <td align="center"> </td> <td colspan="2" align="center"><input type="button" class="update_btn" src="images/btn_update_cart.gif" width="102" height="22" border="0" name="btnUpdate" id="btnUpdate" onClick="doMath()"><!--value="submit"--></td> <td align="center" valign="middle"> </td> </tr> </table></td> <td bgcolor="#ffde00"> </td> </tr> <tr> <td width="13" height="13"><img src="images/text_box_big_left2.gif" width="13" height="13" /></td> <td bgcolor="#ffde00"><span class="style10"><img src="images/spacer.gif" width="13" height="13" /></span></td> <td width="13" height="13"><img src="images/text_box_big_right2.gif" width="13" height="13" /></td> </tr> <tr> <td> </td> </tr> </table></td> </tr> <tr> <?php $shoppingReturnUrl = isset($_SESSION['shop_return_url']) ? $_SESSION['shop_return_url'] : 'other_products.php'; ?> <tr> <td align="center"><table width="340" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> <td><a href="#"> <img src="images/btn_continue_shopping.gif" width="162" height="22" border="0" onClick="window.location.href='<?php echo $shoppingReturnUrl; ?>';" /></a></td> <?php if ($numItem > 0) { ?> <td width="20"> </td> <td><a href="#"> <img src="images/btn_continue_checkout.gif" width="162" height="22" border="0" onClick="window.location.href='checkout.php?step=1';"/></a></td> <?php } ?> </tr> </table></td> </tr> </table></td> </tr> <tr> <td align="center"> </td> </tr> </table></td></form> </tr> </table></td> </tr> </table> </tr> </table></td> </tr> </table></td> </tr> <?php } else { ?> <?php include("EmptyMSG.php"); ?> <!----<td><table width="550" bgcolor="#b6df51" border="0" align="center" cellpadding="10" cellspacing="0"><p align="center">You shopping cart is empty</p> <p>If you find you are unable to add anything to your cart, please ensure that your internet browser has cookies enabled and that any other security software is not blocking your shopping session.</p> </table></td>---> <?php } ?> </body> </html> checkoutConfirmation.php Code: [Select] <?php /* Line 1 : Make sure this file is included instead of requested directly Line 2 : Check if step is defined and the value is two Line 3 : The POST request must come from this page but the value of step is one */ if (!defined('WEB_ROOT') || !isset($_GET['step']) || (int)$_GET['step'] != 2 || $_SERVER['HTTP_REFERER'] != 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?step=1') { exit; } $errorMessage = ' '; /* Make sure all the required field exist is $_POST and the value is not empty Note: txtShippingAddress2 and txtPaymentAddress2 are optional */ $requiredField = array('txtShippingFirstName', 'txtShippingLastName', 'txtShippingAddress1', 'txtShippingPhone', 'txtShippingState', 'txtShippingCity', 'txtShippingPostalCode', 'txtPaymentFirstName', 'txtPaymentLastName', 'txtPaymentAddress1', 'txtPaymentPhone', 'txtPaymentState', 'txtPaymentCity', 'txtPaymentPostalCode'); if (!checkRequiredPost($requiredField)) { $errorMessage = 'Input not complete'; } $cartContent = getCartContent(); ?> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"> </td> </tr> </table> </td> </tr> </table></td> </tr> <form action="<?php echo $_SERVER['PHP_SELF']; ?>?step=3" method="post" name="frmCheckout" id="frmCheckout"> <table width="900" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td align="center" bgcolor="#b6df51"><table width="800" border="0" cellspacing="0" cellpadding="0"><tr><td align="center"><table width="900" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> </tr> <tr> <td align="center"><table width="900" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#b6df51"> <!------------------------------COD-------------------------------------> <?php if ($_POST['optPayment'] == 'cod') { ?> <table width="800" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="330" align="left"><img src="images/title_purchase_online.gif" width="280" height="25" /></td> <td width="464" align="left" valign="bottom"><img src="images/title_step02.gif" width="245" height="20" /></td> </tr> <tr> <td colspan="2"> </td> <p id="errorMessage"><?php echo $errorMessage; ?></p> </tr> <tr> <td colspan="2" align="center" class="green_txt"><table width="500" border="0" cellpadding="0" cellspacing="0" bgcolor="#3b7b37"> <tr> <td width="15"><img src="images/title_box_left.gif" width="15" height="30" /></td> <td width="470" align="center" class="yellow_txt"><strong>:: IMPORTANT NOTE ::</strong></td> <td width="15"><img src="images/title_box_right.gif" width="15" height="30" /></td> </tr> </table></td> </tr> <tr> <td colspan="2" align="center"><img src="images/spacer.gif" width="12" height="12" /></td> </tr> <tr> <td colspan="2" align="center"> </td> <p id="errorMessage"><?php echo $errorMessage; ?></p> </tr> <?php } ?> <!-----------------paypal---------------------------------> <?php if ($_POST['optPayment'] == 'paypal') { ?> <tr> <td colspan="2" align="center"><table width="800" border="0" align="center" cellpadding="10" cellspacing="1" class="infoTable"><tr><td><table width="800" border="0" align="center" cellpadding="10" cellspacing="1" class="infoTable"> <tr> <tr> <td width="330" align="left"><img src="images/title_purchase_online.gif" width="280" height="25" /></td> <td width="464" align="left" valign="bottom"><img src="images/title_step02.gif" width="245" height="20" /></td> </tr> <td colspan="2" align="center" class="green_txt"><table width="500" border="0" cellpadding="0" cellspacing="0" bgcolor="#3b7b37"> <tr> <td width="15"><img src="images/title_box_left.gif" width="15" height="30" /></td> <td width="470" align="center" class="yellow_txt"><strong>:: IMPORTANT NOTE ::</strong></td> <td width="15"><img src="images/title_box_right.gif" width="15" height="30" /></td> </tr> </table></td> </tr> <td colspan="2" align="center" ><table width="500" border="0" cellpadding="0" cellspacing="0" > <tr> <td align="center" class="black_txt33"><p>There will be (3.4% + RM2.00 MYR) PayPal transaction fee for credit card payment</p></td> </tr> </table></td> </tr> </table></td> </tr> </table> </td> </tr> <?php } ?> <!-----------------End of paypal----------------------------> <tr> <td colspan="2" align="center"><table width="500" border="0" cellpadding="0" cellspacing="0" bgcolor="#3b7b37"> <tr> <td width="15"><img src="images/title_box_left.gif" width="15" height="30" /></td> <td width="470" align="center" class="yellow_txt"><strong>Ordered Item</strong></td> <td width="15"><img src="images/title_box_right.gif" width="15" height="30" /></td> </tr> </table></td> </tr> <tr> <td colspan="2" align="center"> </td> </tr> <tr> <td colspan="2" align="center"><table width="360" border="0" cellspacing="0" cellpadding="3"> <tr> <td align="left" class="green_txt"><strong>Item</strong></td> <td align="right" class="green_txt"><strong>Unit Price</strong></td> <td align="right" class="green_txt"><strong>Total</strong></td> </tr> <?php $numItem = count($cartContent); $subTotal = 0; for ($i = 0; $i < $numItem; $i++) { extract($cartContent[$i]); $subTotal += $pd_price * $ct_qty; ?> <tr> <td align="left" class="black_txt"><?php echo "$ct_qty x $pd_name"; ?></td> <td align="right" class="black_txt"><?php echo displayAmount($pd_price); ?></td> <td align="right" class="black_txt"><?php echo displayAmount($ct_qty * $pd_price); ?></td> </tr> <?php } ?> <tr> <td colspan="3" align="left"><img src="images/spacer.gif" width="12" height="12" /></td> </tr> <tr> <td align="left"> </td> <td align="right" class="green_txt"><strong>Sub-totall</strong></td> <td align="right"><span class="black_txt"><?php echo displayAmount($subTotal); ?></span></td> </tr> <tr> <td align="left"> </td> <td align="right" class="green_txt"><strong>Shipping<br /> </strong></td> <td align="right"><span class="black_txt"><?php echo displayAmount($shopConfig['shippingCost']); ?></span></td> </tr> <tr> <td align="left"> </td> <td align="right" class="green_txt"><strong>Total</strong></td> <td align="right"><span class="black_txt"><?php echo displayAmount($shopConfig['shippingCost'] + $subTotal); ?></span></td> </tr> </table></td> </tr> <tr> <td colspan="2" align="center"> </td> </tr> <tr> <td colspan="2" align="center"> </td> </tr> <tr> <td colspan="2" align="center" class="black_txt"><strong><?php echo $_POST['optPayment'] == 'paypal' ? 'Paypal' : 'Bank-in / Bank Transfer'; ?> <input name="hidPaymentMethod" type="hidden" id="hidPaymentMethod" value="<?php echo $_POST['optPayment']; ?>" /></strong></td> </tr> <tr> <td colspan="2" align="center"> </td> </tr> <tr> <td colspan="2" align="center"><table width="380" border="0" cellspacing="0" cellpadding="0"> <tr> <td ><input name="btnBack" type="button" id="btnBack" onClick="window.location.href='checkout.php?step=1';" class="btn" ></td> <td width="20"> </td> <td><input type="image" src="images/btn_confirm_order.gif" width="132" height="22" border="0" value="Submit" name="btnConfirm" id="btnConfirm"></td> </tr> </table></td> </tr> <tr> <td colspan="2" align="center"> </td> </tr> <tr> <td colspan="2" align="center"> </td> </tr> </table></td> </tr> </table></td> </tr> </table> <table width="800" border="0" cellspacing="0" cellpadding="0"><tr></tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> </form> </body> </html> thank you for the time and attention hello; it seems strange that php can set cookies, since php is on the serer-side, but the cookies are on the client-side ... is there something that I am missing? |