Jump to content

maudise

New Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by maudise

  1. well, I genuinely have no idea why this is working now. I've gone back and changed the ['test'] to be ["test"] on all the variables and it seems to now be working. Thank you very much for your help, if you have any great words of wisdom as to how to avoid this in the future [' '] wasn't picked up and it was copied from a tutorial, so I'm presuming you can use a single quotation on some systems? Regards Maudise
  2. Hi, I put the following code at the start, on line 2 for both pages. ini_set('display_errors',1); error_reporting(E_ALL); I now get Notice: Undefined index: test in /home/maudise/public_html/testing/sessioncheck.php on line 5 as an error. For what it's worth, if you need to look at the phpinfo file it can be found at www.crosstrendanalysis.co.uk/testing/phpinfo.php. Thanks for the continued help, I did look around for the undefined index problem but couldnt' find a solution which wasn't a 'Session_start()' problem or similar. Could it be a server side issue which Hostgator needs to deal with? Regards Maudise
  3. sure, www.crosstrendanalysis.co.uk/testing/sessionstart.php and www.crosstrendanalysis.co.uk/testing/sessioncheck.php Regards Maudise
  4. Hi, The sessionstart.php page is below, and the session check in the code box below that. <?php session_start(); $_SESSION['test'] = 'this is a Session variable'; ?> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> I'm confused <?php $Teststring = "this is a test string"; print $Teststring; echo $_SESSION['test']; ?> </br> </p> Why is this not working! <?php print $_SESSION['test']; ?> </body> </html> And now for the Sessioncheck page <?php session_start(); echo $_SESSION['test']; echo 'I tried'; ?> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php echo $_SESSION['test']; ?> Proof updated again </body> </html> Thanks Maudise
  5. Hi, I'm currently out of the office so cannot upload the full file but I'll do it in a few hours when I'm back. What I'm doing is writing the code and uploading to my webpage to test whether it works. There are probably more efficient ways of doing it out there. So it's not actually DreamWeaver which is doing the parsing, but it's the webhost (hostgator.com) Maudise
  6. Hi, I had noticed the use of the $ and I have now changed to $_SESSION interestingly it has changed how it is displayed in the design view of dream weaver from a box which says PHP to {session.test}. However this hasn't solved my problem it still wont pass variables between the two pages. Thanks for the help so far
  7. Hi all, I'm at a bit of a loss I'm afraid, I'm pretty new to PHP and have been looking to code a simple log in page connecting to a mysql database. I'm running firefox 16.0.2 and have my websites hosted with hostgator.com. I've created the log in forms without too much trouble but what I can't seem to get is the $_Session variables to do keep the variables between pages. In an attempt to isolate the problem I have stripped the issue right back to just passing the variables between two pages; sessionstart.php and sessioncheck.php the code in sessionstart.php is simple enough; At the very top of my page I have the following code <?php session_start(); $_Session['test'] = 'this is a Session variable'; ?> and then as a test I put in two sections of code in the body of the HTML tags <?php $Teststring = "this is a test string"; print $Teststring; ?> <?php print $_Session['test']; ?> I know the separate php tags aren't required but I was trying to play around with things. Both of those prints work fine and not a problem. On sessioncheck.php I have the following code at the very top of my page <?php session_start(); echo $_Session['$test']; echo 'I tried'; ?> sessioncheck.php doesn't load the session variables at all, also the switching between print and echo was simply done to ensure that that wasn't the problem at all. I've done a fair amount of searching around and to pre-empt a few questions which might be queried I have the following answers; Session_ID(); returns the same Session ID the phpinfo file tells me the php.ini files are loaded successfully I can't remember the third but the other option didn't work either. I've got to the end of my very limited knowledge so if anyone could give me any advice I would greatly appreciate it! Regards Maudise
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.