Domain Redirect - Loses Session Variables
I just purchased a new domain name and I've set it up as a redirect to a
folder on my main site. What is happening is the index.php page checks a
session variable to see if the user is logged on and if not it displays a
login screen. However, after loggin in it just keeps coming back to the
login screen because the session variables are getting lost.
I inserted "session_write_close()" prior to the header("Location:
Index.PHP) and it now is working on my developement computer but on 2 other
computers it is still just coming back to the login screen.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Session Variables And Domain Redirection Problem
I have an strange problem with session variables. I have a site hosted in a local server. I have physic access to this server and its configuration.(apache, php,files...). I have external access to the web site by typing the public ip address of the local server. I have a domain too, and this domain is redirected to the static public ip of the local server so when I type (out of the local server net) the domain in a web explorer I surf to the content of the local server (like typing the public ip). I have observed with the redirection configuration, that when I click on elements of the page that propagate parameters, this it is not reflected in the address. Example: I have a link that points to http://www.mysite.com/link.php. When I click on this link I go to the link but the explorer address is always http://www.mysite.com. However in the link properties I can see that this link points to http://my local ip/link.php. This doesn.t happen if I go to my site using the public Ip. This is the problem: I have the typical login form.When the data submitted is ok, the login name is saved in a session variable.To check if the active visitor is logged in, I check the existence of this session variable every page refresh. This works ok in the local server. Using the public ip address works ok too. But when I use the domain direction this does not work in Internet explorer (I have tried in different computers). but in Mozilla it does work. I think Internet explorer configuration is not letting session variables to be propagated with the redirection.
Loses Session ID When Using Web Forwarding
I am using PHP V 4.3.0, running on a Windows NT Host. I have an application which resides in a sub-folder of my main Internet account. I recently asked my provider to create a new Domain Name, with Masked Web Forwarding to this sub-folder, and it has given me the following problem. The application uses a "window.open" to launch a secondary sign on window, the problem is that when I access the application using the domain name with web forwarding this also created a NEW SESSION_ID. If I repeat the test by going directly to the sub-folder by name (instead of using the Web Forwarding) the problem does not exist, the Session stays intact throughout the sequence I passed the Session ID across as a parameter, and this solved the problem (or so I thought), but when the sub-window closed, so did the Session - so problem still not solved My provider is not much of an expert on PHP, but I suspect it is a configuration problem. What should he/I be looking at to resolve this?
Session Variable Loses Its Data
I'm working on a login page, using sessions. In login.php, the session variable $valid_user is set if the username/password is correct, and the username is stored into $valid_user. When I proceed to the next page (overview.php), the content which is to be shown to logged-in users only is shown correctly. If the user is not logged in, the appropriate error message appears (and no user-only content is shown). The problem I have in overview.php is that $valid_user (the session variable) has nothing stored in it. I have started the session in overview.php and I do not get any session warnings. $valid_user is set, it's empty though (if it wouldn't be set, the logic of this page would not work, but it does). I also didn't unset or clear $valid_user.
Domain Redirect
First, I'm new to PHP . . . Second, I've searched for this,but can't seem to find what I'm trying to do. I have a new domain that I would like to temporarily host in a directory of another site I already have running. Is there a PHP script that will direct a user depending on what url they enter, i.e. www.domain1.com takes them to www.domain1.com/main.php and www.domain2.com takes them to a subdirectory of domain1 or www.domain1.com/dir/index.html? I've tried the script below as default.php that directs depending on domain entered, but I'm not sure if it will even work and I get a parse error on line 4: <?php $host = $_SERVER["HTTP_HOST"]; switch ($host) { case 'www.domain1.com': header("Location: http://www.domain1.com/main.php"); exit(); case 'domain1.com': header("Location: http://www.domain1.com/main.php"); exit(); case 'www.domain2.com': header("Location: http://www.domain1.com/dir/index.html"); exit(); case 'domain2.com': header("Location: http://www.domain1.com/dir/index.html"); exit(); default: header("Location: http://www.domain1.com/main.php"); exit(); } ?>
How To Redirect Pages From Current Site To New Domain
I am shifting my current website to a new domain. Now the problem is that if I change to new domain then the pages from search engines will be of no use and I will lost the traffic until my new domain comes to search engines. Is there a way through which i can send the traffic to my new domain from the current site pages which are listed on seach engine. i.e. if someone clicks on the pages in search engine then he will be redirected to that page of my new domain.
Session Problem: Session Exists, But Session Variables Don't Lasts
I have some troubles with session variables. I can easily create a session, but the variable I append to global session array ( $_SESSION) lasts only until the end of current function. I prepared an example that can demonstrate the problem (see code bellow): The program flow is this: (1) It starts with "session_start()" and displays "login_form()". (2) When user enters his username and password, it goes to "login()" function which sets $_SESSION variables. (3) This function also "Echoes" session_id and user name to the screen. (4) Then it goes to "MyProgram()" function. It only "Echoes" the same variables to the screen. Strange is, that the session_id is the same in (3) and (4), but the user name ($_SESSION["username"]) is only in (3), but not in (4). By other words - $_SESSION["username"] variable filled up by "login()" function is immediately cleared. I don't know why. There must be something missing, but after 3 days of watching it, I can not find a problem here. =========================================== <? Function login($uzivatel, $heslo) { $_SESSION["username"] = $uzivatel; $_SESSION["pass"] = $heslo; $U_Name=$_SESSION['username']; echo "Login username: $U_Name<BR>"; echo "Login session ID: "; echo session_id(); echo "<BR>"; } Function login_form() { echo ("<DIV ALIGN='center'> <H1>Test</H1> <P>Please enter your username and password:</P> <form action='test.php' method='get'> <INPUT TYPE='HIDDEN' NAME='login' VALUE=TRUE> <TABLE BORDER=Ɔ'> <TR> <TD ALIGN='right'><U>U</U>ser name:</TD> <TD><INPUT NAME='uzivatel' SIZE=25 ACCESSKEY='U' TYPE='TEXT'></TD> </TR> <TR> <TD align='right'><U>P</U>assword:</TD> <TD><INPUT NAME='heslo' SIZE=25 ACCESSKEY='P' TYPE='PASSWORD'></TD> </TR> <TR> <TD COLSPAN=2 ALIGN='RIGHT'><INPUT NAME='OK' ACCESSKEY='O' TYPE='SUBMIT' VALUE='OK' TABINDEX=3></TD> </TR> </TABLE> </FORM></DIV></HTML>"); } Function MyProgram() { $U_Name=$_SESSION['username']; echo "Program username: $U_Name<BR>"; echo "Program session ID: "; echo session_id(); echo "<BR>"; } { session_start(); if ($_SESSION['username']): MyProgram(); else: { if (!$login): login_form(0); else: login($uzivatel, $heslo); MyProgram(); endif; } endif; } ?> ===========================================
Multi-domain Session State
Does anybody have a solution on how to keep a PHP session alive across multiple domains ? A solution that does not involved writing the session ID in the URL because I can't do that.
Session Cookie Setting Only For Host Instead Of Domain
I'm trying to set a cookie to apply over all hosts in my domain. I have a settings file setting $domain ="quietcare.info"; $cookieDomain = ".".$domain; Then I use that $cookieDomain as an argument in my set-cookie command. But it doesn't seem to be working. My browser still shows the cookie-set request as being just for the host, not for the domain. And when I go to another server in my domain and look at the full request, I don't see that cookie value as set. What am I missing? Does the domain arg only apply to stored cookies? (I read that in an ASP document, it seemed horribly stupid, but still...) (My servers run Linux.)
Header Redirect With GET Variables
I have PHP 5.2.2 installed on my WinXP machine. I am using the web server built into Proxy Plus, with PHP enabled using php-cgi.exe. It seem to be working fine, but I have a problem trying to redirect to a new page using the header() function. When I do: header('Location: mypage.php?var=fred'); The browser (Firefox 2.0.0.3) get redirected and shows the following in the location bar: http://localhost/mypage.php?var:%20fred Notice that the "=" gets changed to ":%20" Of course this is not working. I have tried everything I can think of, including using %3d instead of =. Nothing seems to work. Any ideas? Could this be a problem with PHP, or a problem with the web server in Proxy Plus, or something else? I have NOT tried this on any other web server.
Post Variables From Header Redirect
I'm using header to redirect the browser to another page and in the url I've added ?var1=value1&var2=value2 to pass some argument as get to that script, can I pass in some way, arguments as post in this case ? may I do it in both methos at the same time ?
Passing Along Variables During A Htaccess 301 Redirect
I have a form people fill out on my website, and on submit they are then sent to an appropriate document depending on their input. Some people link directly to those documents instead of to my form page which the preferred method. Therefore I added to my .htacess a 301 redirect to the form page for visitors requesting documents with a referer other than blank or from my domain. The 301 redirect is important to me so people's address bars change to the matching page, and for search engines to accredit the form page for the incoming links. My only concern is, once there, the visitor will see an empty form. For usability, I would strongly like to send which document the user requested to the form page, so once loaded, the form will be pre filled out for their appropriate document. I would know how to do this using my .htaccess page if I wanted to have that document name in the address bar, but I would strongly like to have the address bar be the normal form page address. Is it possible that in the redirect I can send that variable in a POST type method, where the information is not visible in the address bar? I guess if I can't do the first I could redirect the visitor to an intermediary page that just reads the variable in the link and stores that value in a cookie before sending the visitor off the the form page.
Passing Variables In Redirect Script?
Does anyone know how to pass a variable(text input from form) so that the variable will be sent along to the redirect page (as in): header("Location:...page2.php");
Redirect On Session Time Out
You have most likely seen membership sites that redirect you to the login screen when you are inactive for a certain time period. The session times out and automatically loads the login page. I've searched all the session variables and even Google & Yahoo for it. The closest I came to it was the session_cache_expire setting, but I don't know how to see if the value is zero. Does anyone know how to do that other than creating another timer?
Why Is Session Lost On Redirect?
I'm trying to create a very basic login page that will redirect a logged in user to a secure page. I set the session_start variable at the top of the login page, then redirect to securePage.php if the user enters the right credentials. The redirect works, but apparently $HTTP_SESSION_VARS['loggedin'] is not getting set because I cannot view securePage.php. Am I setting $HTTP_SESSION_VARS correctly? My guess is I'm missing something elementary. How can I get the session to carry over to the redirected page? CODE:
How To Redirect After Setting Session?
I have a login page that is supposed to redirect the user to his private page after login. But header("Location: $url") does not work after I set the $_SESSION variable - I get "Warning: Cannot modify header information - headers already sent by ... The abbreviated code on the login page looks like this: <?php session_start(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> [etc, etc] [login form] <? if (credentials are valid) { session_start(); $_SESSION['username'] = $uid; header("Location: $url"); } ?> One option I've heard about is using ob_start() at the top of the page - but that seems to screw up my session. I could also use Javascript like this: <script language="javascript"> window.location.href=("<?php echo $url; ?>"); </script> but then folks without Javascript won't get redirected.
Session And Header Redirect
Here is the code for the top of the "customise.php" page. <?php require_once('../Connections/DM_database.php'); ?> <?php include_once("../includes/functions.php"); ?> <?php if (isset($_GET["Product_ID"])) { $ProductID = $_GET["Product_ID"]; } elseif (isset($_POST["Product_ID"])) { $ProductID = $_POST["Product_ID"]; $_GET["Product_ID"] = $ProductID; } else { $_GET["Product_ID"] = "1"; $ProductID = $_GET["Product_ID"]; } ?> ............
How To Process Some Variables, Then Place Them Into POST And Redirect?
I'd like to do the following in PHP. Is there a way? Someone submits a form with data. I want to process the data, then once I'm done with it, take two of the variables, make them post variables and basically redirect the browser as if the user pressed the submit button with data filled in. The variables can't appear in the url.
Retain Variables After Form Submit Redirect
I have a section on my website where only users that are "logged in" can view and I'm using the following syntax at the top of verify that they are logged in and that they can only view their profile: if((!$session->logged_in) || (($session->num != $_GET[num]) && ($session->num != $_POST[num]))) { header("Location:websiteaddresshere"); exit; } This works great. The get to your account you have to be logged in and use the user: account.php?num=# or else you are redirected. My problem is as follows. I have a section to edit your account details that uses the same code as above. However, once you submit the form on accountedit.php, it redirects to the main website address instead of displaying some text saying the edit worked successfully. How do I submit a form and add "?num=$usernum" to the end of the website url so they aren't redirected?
Sending Session Cookie Before Redirect
I have a function in a lot of pages, which redirects to a new page, if a form has been submitted: if (!(defined("DEBUG_INSERT") && DEBUG_INSERT) && !(defined("DEBUG_UPDATE") && DEBUG_UPDATE) && !(defined("DEBUG_SELECT") && DEBUG_SELECT)){ if ($_POST){ $_SESSION["postvalue"] = $_POST; header("HTTP/1.1 302 Moved Temporarily"); header ("Location: ".BASE_URL.$sess->assemble(),true, 302); header("Connection: close"); exit(); }else{ if (isset($_SESSION["postvalue"])){ $_POST = $_SESSION["postvalue"]; } } } In conjunction with a login form and a browser that accepts cookies for the session handling, this leads to everyone having to enter his login and pasword twice. i believe this is, because the cookie do not get sent before the header ("Location:
Image(jpeg) Upload & Resize Loses Colour?
I am uploading an image to a server and resizing the image then saving it to a directory,I had it working fine on my local machine (windows) but when i uploaded the code to the server (linux) - same directory structure etc, it didnt work the colour appeared to be removed from the image, as though the number of colours in the image was reduced to 2 or 4 or something? has anybody come accross similar problems with GD or image functions in php?
Session Expired -> Redirect User To Another Page.
I am using the new session management function from PHP4. session_start() how do u redirect a user to another page if his session is expired? here is what i want to do: 1. user Tom enter his correct username and password. 2. my system use session_register() function register a variable in his cookie. 3. user Tom clicked Logout 4. my system use session_destory() function and redirect Tom to the login page. 5. Now, Tom click the 'BACK' button of his browser, a page showed 'page expired, hit reload button ... ...'. here is my question, how do I redirect Tom to the login page if he clicked the BACK button?
If Session Expired Redirect Them To Login Page
when ever a user login, his information(name,login-time..etc) will be stored in sessions and also stored in users table. the table has following fields: 1.userid 2.userlogin_time(session_created_time) 3.session_expiry_time.4.session_timeout. it's values are 1----10:10:10-----10:34:10----11:46:10 here session_expiry_time is 24 minutes more than the session_created_time.the session_timeout is 72 minutes more that session_created time.ok what i want to do is if a user login and does not do any thing for next 24 minutes i want to redirect the user to login page.
Setting A Session Variable Via A Hyperlink, Then Redirect
I usually have my nose in photoshop or flash, so PHP is still very new to me. The project I've been given is to have a spanish version of our cardholder site. The way I've achieved it so far is.. Create a php file that has all of the english/spanish translations in arrays. An example would be Code:
Passing Variables And Session Variables
I'm currently working on a shopping cart script that works just fine with register_globals turned on but when turned off i get all kind of errors. The following page displays a detail of the book with the "Add to cart" link at the bottom. PHP Code:
Variables That Change Session Variables
I'm currently writing a mulit-page form app that uses a session to retain data from each form element in order for the user to jump between pages, then the final data is passed to a calculation script. However, I've noticed that if I assign a session variable to another variable, which then performs a mathematical calculation, the session variable changes. i.e. $_SESSION["inflation"] = 4; $temp_inf = $_SESSION["inflation"]; if ($_SESSION["inflation"] =="RPI") { $inflation = $rpi;} else {$inflation = ($temp_inf/100.0);} now it equals = 0.04 How can I take a value from a session and perform operations on it without altering the original session value.
Form Variables To Session Variables
I am writing a small script that consists of two pages: page one displays a bunch of values from a DB (ie. First Name, Last Name, Phone Number). On this page you will find a form that follows this format: <input type="text" name="edit_firstname" size="20" maxlength="35" value='Bob'> <input type="text" name="edit_lastname" size="20" maxlength="35" value='Smith'> <input type="text" name="edit_phone" size="20" maxlength="35" value='5552222'> So when you see the page there will already be a 'default' value in each line (which is information extracted from a DB). This works perfectly and has been tested thoroughly. On the second page I have the following code: $editfirstname = $_POST['edit_firstname']; $editlastname = $_POST['edit_lastname']; $editphone = $_POST['edit_phone']; What I am trying to do is this: the default value for edit_firstname from the form is 'Bob' by default, but the user can change this in the input field on the first page. This value, whether changed or unchanged, should then be stored as edit_firstname and by calling up the function $_POST[''] on the second page I want to transfer the value to the variable $editfirstname. However, it seems that $_POST['edit_firstname'] and the other fields do not return a value at all, hence $editfirstname = '' or $editfirstname = 'NULL'. I have never tried to do things this way before.
Accessing Cookies After Domain Has Been Mapped To Another Domain/folder
I had my host map "domainA.com" to folder "domainB.com/folder". I'm finding when accessing "domainA.com" that PHP scripts which utilize $_COOKIE[] aren't able to see the cookies belonging to "domainA.com". However, JavaScript scripts can see the cookies via "document.cookie". So far, the only way I've found to deal with this is to redirect all access to "domainA.com/index.html" to "domainB.com/remappedindex.html". Any ideas on a better, more straight forward way to do deal with this?
Access Domain Via IP In Multi-domain Server
I'm trying to write a script that can connect to a domain using it's IP address. But I'm dealing with a multi-domain server, so the IP address needs an additional string describing which domain I want to access. I've seen it done before but forgot the syntax. It's an apache server with cPanel.
Access From One Domain To Another Domain On Same Server ?
I own three dedicated servers, do You know any way how to get from another domain to other domain on same server through php scripts ? maybe i just could use fopen function with full path to domain, but what's that path... i've seen in cgi something like this: /var/www/virtual/domain/top2/html-amat2.html i think something could works either in php any ideas ?
Set Cookie Function For Both Www.domain.com And Domain.com
I searched but couldn't find a clear answer so I'm sorry if this is a repeat. If you point me in the right direction, I'll go When I set a cookie, it only sets it on my domain without the www. (so if someone uses www.domain.com, the cookie doesn't work). Here's what I have: setcookie("matewan_login",$joined,time()+62899200); Suggestions?
Email From Apache@domain.domain.com
I have tried sending mail with: mail and imap. I know how to set "From" headers and this works fine when I send an email to an email. Heres the catch: when I send an email to a cell phone (i.e. 1234567890@vtext.com) it ignores the "From" header and says it is from apache@mydomain.mydomain.com.
Set Up A Domain Name That Points To A Sub Domain Of A Domain?
I am creating a content management system where users only need to setup an account and all their information is stored on my server, including pictures, member data, etc... I want the users to have the ability to use my servers and still have their own domain name, like "mysite.com" -- not "contentsystem.com/mysite/". How can I make it so when the user goes to "mysite.com" he is actually going to "contentsystem.com/mysite/"? I would still have to register and buy the domain name "mysite.com", but how could I do redirect it to the real address?
Session Variables
Can anyone please help, I am testing this code from a book that I am learning php from and it doesn't work. The message comes up showing "you've been here 1 times" , but the counter does not increment as I refresh the page. this is the code:
Session Variables How Many?
I'm wanting to store about 6 fields one of which could have about 1600 characters in a session variables for submitting data to the database. I'm trying to elimate partial records being inserted into the database when a user quits in the middle of an entry. Is there a limit to the size of what you can put in sessions and number of session you want to limit on a server. Didn't know if you had a high volume site that if you stored new records in sessions, how that would affect performance. I thought about using cookies but not everyone has them enabled, I guess I could check first.
Session Variables
I'm calling the below function to log a user in and register to session variables, however the variables are never registered: function login_user($username, $password) { GLOBAL $DB; GLOBAL $HOST; GLOBAL $WEBUSER; GLOBAL $WEBPASSWORD; Code:
Set And Get Session Variables
Iam a bit new to php but Iam familiar with other scripting languages like ASP.My Problem is Maintaing teh session variables. When the user logged in I want to maintain the username in a session until that user is logged out. I walked through the forums and tried $_SESSION, $HTTP_COOKIE_VARS but i did not succed. Whereas in ASP I used session("username") to maintain the username throughout the session. Please suggest me how to handle the session variables in php.
My 1st Use Of Session Variables
I've written some code to overlay a transparent png over a jpeg, 4 4 links then allow the png to be moved, the x and y coordinates being stored in $_SESSION. It seems to work fine on my own local server but only intermitently when live. The full source with images is stored in index.php: <?php session_name("pwh_test_session"); session_start(); ?> <html><head><title>Test page</title> <meta name="author" content="Paul Herber"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15"> <style type="text/css"> .mtitle {font-size:24pt; font-family:arial,helvetica,sans-serif} .mtext {font-size:10pt; font-family:arial,helvetica,sans-serif} </style> </head> <body bgcolor="#FFFFEC"> <div class=mtext align="center"> <?php $_SESSION['x'] = 0; $_SESSION['y'] = 0; ?> <table border="0" align="center"> <tr><td>Starting session named <?php echo session_name(); ?></td></tr> <tr><td colspan="4" align="center"><a href="show.php">Start</a></td> </tr> </table> </div> </body> </html> show.php: <?php session_start(); ?> <html><head><title>Test page</title> <meta name="author" content="Paul Herber"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15"> <style type="text/css"> .mtitle {font-size:24pt; font-family:arial,helvetica,sans-serif} .mtext {font-size:10pt; font-family:arial,helvetica,sans-serif} </style> </head> <body bgcolor="#FFFFEC"> <div class=mtext align="center"> <?php $d = $HTTP_GET_VARS['d']; ?> <table border="0" align="center"> <tr> <td colspan="4" align="center"><img class=mborder2 width="500" height="375" border="0" title="" alt="" <?php echo "src="showimage.php?d=$d">";?></td></tr> </tr> <tr> <td width="25%" align="center"><a href="show.php?d=u">Up</a></td> <td width="25%" align="center"><a href="show.php?d=d">Down</a></td> <td width="25%" align="center"><a href="show.php?d=l">Left</a></td> <td width="25%" align="center"><a href="show.php?d=r">Right</a></td> </tr> <tr><td colspan="4" align="center"> <?php echo 'x = ' . $_SESSION["x"] . ' y = ' . $_SESSION["y"]; ?> </td></tr> <tr><td colspan="4" align="center"> <?php if (($_SESSION["x"]==346) and ($_SESSION["y"]==180) ): echo 'You have been hit for 6!' endif; if (($_SESSION["x"]==306) and ($_SESSION["y"]==240) ): echo 'Batsman is out LBW' endif; if (($_SESSION["x"]==186) and ($_SESSION["y"]==220) ): echo 'Bowled - middle stump!' endif; ?> </td></tr> </table> </div> </body> </html> shopimage.php: <?php session_start(); $d = $HTTP_GET_VARS['d']; $im1 = imagecreatefromJPEG('P6200007.jpg'); $im2 = imagecreatefromPNG('redball.png'); if ($d == 'u'): { $_SESSION["y"] = $_SESSION["y"] - 20; } elseif ($d == 'd'): { $_SESSION["y"] = $_SESSION["y"] + 20; } elseif ($d == 'l'): { $_SESSION["x"] = $_SESSION["x"] - 20; } elseif ($d == 'r'): { $_SESSION["x"] = $_SESSION["x"] + 20; } else: { $_SESSION["x"] = imagesx($im1) - imagesx($im2)/2; $_SESSION["y"] = imagesy($im1)/2 - imagesy($im2)/2; } endif; // check limits if ($_SESSION['y'] < 0): $_SESSION['y'] = 0; endif; if ($_SESSION['y'] > imagesy($im1)-imagesy($im2)): $_SESSION['y'] = imagesy($im1)-imagesy($im2); endif; if ($_SESSION['x'] < 0): $_SESSION['x'] = 0; endif; if ($_SESSION['x'] > imagesx($im1)-imagesx($im2)): $_SESSION['x'] = imagesx($im1)-imagesx($im2); endif; imagecopy($im1, $im2, $_SESSION["x"], $_SESSION["y"], 0, 0, imagesx($im2), imagesy($im2)); $mime="image/jpeg"; header("Content-Type: $mime"); header("Content-Disposition: filename=overlayedimage.jpg"); imageJPEG($im1); imageDestroy($im1); imageDestroy($im2); ?>
Session-Variables
If i store a session-varibale with the command : >> session_register("var"); >> $var = "test"; how can i get the value of this variable?? I tried >> session_encode("var"); >> echo $var; but i doesn't work!!
Session Variables In IE
Why on earth would the security settings affect session variables? We're not setting a cookie here. I'm just trying to carry one session variable over from one page to the next. If the security settings in IE are set to "high", it doesn't work. What gives?
Session Variables
im having problem with session. its not with the variables i set using session_register but the variables that are not supposed to be cookied or cached. i have variables that i set using: index.php?variable=myvalue and on the next page i change that variable's value again .. but even if change it to : nexpage.php?variable=mynewvalue the variable is still using the first value i assigned to it : myvalue instead of mynewvalue. i only need to use session to cache my logged in user and not all the variables i use. how do i make this happen ? or am i doin' it wrong.
Session Variables
This time it's not so much broken as I just have a question on variable registration in sessions. I'm using a admin script to manage users on a website. All users first of all have the ability to edit their own info, and administrators have the ability to edit other user's info. Now, in my session I have several variables registered, including the user's password, username, full name, etc. Now, when I have them bring up the screen to edit their info, I have several fields in a form, that I fill with values from the session variables. When they edit the info and send it, it updates the MySQL DB and comes back to the same page with the fields filled in with the new info. I had some problems doing this however, it didn't want toupdate the database with the new info, it seems that the POST operation didn't update the variables, and the info from the session variables got reentered into the db. So I changed the fields on the edit page to read something like 'newusername' 'newpassword' etc, then had the script session_destroy() and reassigned the session variables to the new ones entered, THEN entered the info in the database. This seems to work. However, when I'm attempting to edit other user's info, the same approach doesn't seem to work. I'm using yet again, another set of varibles called 'editusername' 'editpassword' etc, to avoid any conflict with my session variables. The reason why I do this is because: When I originally tried the script, and had the edit user fields marked as 'username' 'password' etc (the same as the session registered variables) and then tried to reassign it $username = $username; (I know, it looks silly) It didn't work, it seems like POST operations don't assign variables quite the same way as an explicat declaration. Anyway, should I be paranoid about using the same variable names in my forms as in the session variables? Will they screw up? Will they reassign?
Php Session Variables
I've been trying to integrate php with MySQL database into my site and have come up with a problem. My webhost has php set up so that I cannot use session variable the way I understand them. Here's what he wrote: You tried to use the session handling routines included in PHP, which are unavailable. It would be possible, however, to write your own functions that set a cookie to define a session ID, this session ID would then refer to data loaded in a data file on the server. You would likely want to write routines that mirror the native routines in PHP that are not available. Now I've been trying to work with functions on this one, but am still coming up with the same error message. Anyone out there know a basic way to write this or help me out?
Session Variables
I cannot seem to change a session variable. I want my site to have the ability to be viewed from a different perspective depending on the client or in this case $user. With track_vars and register_globals on i have the following code:
Session Variables?
can session variable hold objects that can later be reference by other pages? if so, i get an "incomplete object" error when i try to call methods from the object I have stored in the session.
PHP Session Variables
I'm not a overly experienced PHP programmer but I like to dabble and I'm working on a 'semi-secure' member's area. Previous I have used normal variables to determine the validity of a user. i.e. Once the user has logged in, a random id is created an placed in the database in their row and each secured page will have a URL like this : .../secure.php?user=joebloggs&randid=324395 Each page looks up the username and checks it against the random id (instead of their password for obvious reasons). However, I want to remove this altogether so a page will just be like 'secure.php' so I've looked into session variables - another interesting endeavour which was quite effective until the user logs in. The URL then changes to ...secure.php?PHPSESSID=94fhq439fqqh9f-qh9-q2h or something similar. Obviously, this doesn't happen when clicking a link but the use of a login form causes this added variable to the URL.
Session Variables
Ive got a problem with our server. I checked it and i cant login to our webmail(horde) and all other sites that requires logging in. So far i think it has something to do with session variables not being written or not being able to pass the session variables to a second page. Error messages: Undefined index: uid Undefined index: sid Here's our server specs: Linux Dedicated server Fedora Core 3 Plesk 7.5.4 PHP 4.3.11 Im not that well versed with handling servers to i dont know were to start.
|