I am having a little trouble with a session. Not sure if it is my browser or what. I know I do not have any trouble logging into forums such at these, so not sure why this is not working.
first the code. Just basic code from php documentation plus some added checks.
Code: <?php
// page1.php
if (session_start()) {
echo "OK";
} else {
echo "FAIL";
}
// echo phpinfo();
// echo getcwd();
echo 'Welcome to page #1';
$_SESSION['favcolor'] = 'green';
$_SESSION['animal'] = 'cat';
$_SESSION['time'] = time();
print_r($_SESSION);
// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';
// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
?>
And
Code: <?php
// page2.php
session_start();
echo 'Welcome to page #2<br />';
echo $_SESSION['favcolor']; // green
echo $_SESSION['animal']; // cat
echo date('Y m d H:i:s', $_SESSION['time']);
print_r($_SESSION);
// You may want to use SID here, like we did in page1.php
echo '<br /><a href="page1.php">page 1</a>';
?>
There is no reason why this should not work. Can someone go to:
http://www.e-sullivan.com/DIITop25/page1.php
and tell me if it works for you? It shows me that the sessions are being started but the variables are not passing between page1.php and page2.php for me.
Inserting a variable in a link
I have this code that I want to insert for my own variable but I have no idea how. This is what I want to insert:Code: <?php echo $my_twitter_username; ?>Into this code:Code:
HeaderSelectedCssClass not working
I have an accordian where I have a drop down list in the first pane and a grid in the second pane. When the ddl selection is changed, I programatically change the selected index of the accordian to
this code is strange !
Hi i got this code from the web.. It checks for live and dead socksIt is working perfectly on my localhost. but does not work in any webserver ! any ideas ?<?php$filename =
Different actions for different parts of a string
<?phpfunction dosomething($string, $else = '') { if (empty($else)) $string = "<b>$string</b>"; else $string =
Placing and array within an array then sorting it!
I have a page that runs two large mysql queries and saves the results into arrays, in php I then perform a simple multiplication between the two arrays and the results is displayed in a dynamic html
Help me with some material on Open Text Overview.
Hi Experts,
Multiple Do / While Statements?
I'm still very new to PHP, and running in to a problem when trying to execute a do/while loop inside another one.What I'm trying to achieve is that I want to display all of the records in one table
Generate multilayered array from string.
ok so i have a string that looks like this:Code: [Select]blog:edit_all,delete_all|users:edit_all,delete_all|settingsand i want to make a code that can take that string and put it in a multi-layered
Select Rows as Columns..
is there a way to select COLUMN_NAME from user_tab_columns where table_name='TABLENAME';
array ...
hiCode: function formatCategories($categories, $parentId){ // $navCat stores all children categories // of $parentId $navCat = array(); // expand only the categories with the same parent id