How Do Sessions Work Cos Mine Isnt Working?
How do sessions work cos mine isnt working i got this:
on a different page i have :
$_SESSION['referer'] = '1';
then:
if ($_SESSION['referer'] == '1'){
include ("include.php");
}
but when i echo session it is blank =/ what did i do wrong.. i got many other sessions on the go so it should work..
View Complete Forum Thread with Replies
Related Forum Messages:
INSERT Code Isnt Working.
This probably has a really simple answer, but my INSERT code isnt working. mysql_query('INSERT INTO `members` (`id`, `uname`, `uemail`, `upass`, `GUID`, `data`, `permissions`) VALUES ('NULL', $psuser, $psemail, $psPassword, 'NULL', 'NULL', Ƈ')'); And I get an error saying unexpected T_STRING .
View Replies !
Simple Image Upload Isnt Working?
im working on a simple image upload script (my first try) well i noticed that for some reason its not even recognizing a file being uploaded...ive tried using the phpfreaks simple image upload tutorial but that wont seem to work for me. Code:
View Replies !
How Do Different Sessions Work? Multiple Sessions
I use a messageboard which uses sessions. I have a login script which uses sessions. I have a charting app which uses sessions. How does PHP handle this? Does it create three different sessions or is everything handled by the one session file? In other words, is it working like magic and I don't need to worry about it. What I'm confused with is that at the start of the login script there is a start_session() and other session related stuff. On logout, the session is destroyed. Now does this affect the start_session() of the other scripts?
View Replies !
Can't Get Sessions To Work
I can't seem to get my sessions to work and after having spent a couple of hours searching the forums and recoding but still haven't sorted it out. I am trying to set a session with the user login information submitted by a form and checked against a database. My login form sends the info to a validation file where I had hoped to set the session variable. If the login is not correct the user is redirected back to an error page. I also have a sessionFile.php where I have stored the code to check if the session is not set, which I want to include on each page to prevent a user accessing the page without logging in. Code:
View Replies !
Can't Seem To Get Sessions To Work.
If I use the default directory in the php.ini (C:PHPsessiondata) my session works fine. If I set the path to a different dir (cgi-bin mp) it writes the session file there properly but puts nothing in it. I need to be able to define the dir when I take the program to my Internet Provider. They give you a special dir. I have tried it and get the same results as above. Code:
View Replies !
Sessions Don't Work
With PHP 5 the default setting for register globals is off. This means that sessions variables don't work (see quote below). So, I have a website that makes plenty of use of sessions, which has stopped working properly. The question is, what changes do i have to make to ensure I can still make use of them or something similar to them? "If you want your script to work regardless of register_globals,    you need to instead use the $_SESSION array as $_SESSION entries    are automatically registered. If your script uses session_register(),    it will not work in environments where the PHP directive    register_globals is disabled."
View Replies !
Imap - Mine And Other Mail Addresses
I'm am working on an wep interface for imap and pop3 servers, where an user can log on to any pop3/imap server and read and send mail. For the send mail function, I am using imap_mail, where it is possible to apply a from address. But I dont know which from address I should apply. Is it possible somehow to find out which email address belongs to the mailbox I have opened with imap_open, and then use that email address as the from address, when I call imap_mail??? Code:
View Replies !
Sessions Only Work On Localhost
I've created a website using Win2000 & apache. The site works fine there. I than wanted to move the website on a redhat8 server (using it in a production envoronment), but there I am getting trouble with the sessions I use in the site. The problem is on the redhat localhost, sessions works fine, but throughout the office network (using win2000 machines) pages don't work because it appears that sessions contain no data or 'wrong' data. E.g., A user enters a certain area of the website (the areas I organized using directories). Everytime a user enters a particular direcory I set up a sessions for the user in default.php of the specific directory. I do this because I want the user to enter a directory through the directory's default.php. I create a sesion called $_SESSION['areasection']=", and give it the value of the directory (a,b,c,d,e,...) example: Code:
View Replies !
Do Sessions Work With POSTDATA?
I use sessions on my site through SSL for my user area. Now does POSTDATA work with sessions in the sense that session data is passed when POSTDATA is sent? If not, how can I combat hacks?
View Replies !
Possible For Sessions To Work Under PHP5 And Not Under PHP4.
I'm writing an web application with PHP/MySQL. I used PHP5 but believed to use code that would work also under PHP4. However when I tried my application under PHP4 I got the warning that the headers are already sent and my session did not work. I do understand that I have to send the headers before anything else. But does anyone know what kind of difference between PHP4 and PHP5 makes it possible for sessions to work under PHP5 and not under PHP4.
View Replies !
Make Sessions Work Across Subdomains?
Is there anyway to make sessions work across subdomains? When users visit my site they are directed to auth.site.com to login or register but when they login they use site.com but the sessions dont seem to follow with the change
View Replies !
Problems Gettin My Sessions To Work
I am having problems gettin my sessions to work, and have tried the basic scropt below to tray and resolve it. Is the code below incorrect? <?php session_start(); if(isset($_SESSION['views'])) $_SESSION['views'] = $_SESSION['views']+ 1; else $_SESSION['views'] = 1; echo "views = ". $_SESSION['views']; ?> <a href="view.php">test</a>
View Replies !
Sessions Not Working In AOL
This is odd. I am writing a simple user tracking thang which will enable a user to have access to forms if a session is registered for them. Here is the weird part. In aol, a session is registered, but the value doesnt exist. Like it recognizes that session_is_registered("variable") but it wont hold on to the value of $variable. I am using this variable to access a database, in which I am pulling info from their profile and prepopulating boxes for a form, but since the value doesnt work, the form is empty, and thus screws up the process of collecting the proper form data. It works perfectly in IE, and Netscape, this is why I am totally confused. Would AOL not set cookies, lets say, for the session ID? Has anyone had the same experience?
View Replies !
Sessions Not Working Php.ini?
ive always had sessions working. AND the session stuff was working on this site im doing. I havent restarted apache in a while..so i did (because i was adding some vhosts) and now my session variables arent registering for some reason. Any ideas that i mighta accidently messed with in php.ini??...i checked over it a million times..even register_globals is on (yes it security issue)..but they still arent showing up.. Code is completey the same as it was working except for restarting apache.
View Replies !
Working With Sessions
I want to have a time limit for the sessions means if the user is online then his session should expire if he's logged in and INACTIVE for 5 mins say. Is it possible if the user is active or inactive after he logs. I want to count the total time the user is actively online till date. (counts the number of seconds he's online ever since he registered) How to do the above tasks. Is there any standard code or class which can be used for authenticating and registering users because it's very common for any site.
View Replies !
Sessions Not Working
I'm heading to a tradeshow, where I'm going to show a software product. It's a Web based product built in PHP and MySQL. The Internet connection is way too expensive (something like $800/day), so I'm demonstrating the product on my laptop. No big deal, I've done it a thousand times. But suddenly my laptop doesn't pass session data from one page to the next. The exact same code works fine on my desktop computer and on line, but on my laptop it no longer passes session data. I'm running XP Pro, PHP 4.3, and MySQL 4.0. This all worked fine yesterday. Today it does not. I cannot think of anything that's changed on my computer.
View Replies !
Sessions Working, Then Not Working?
I wrote a login script (one that I have used on quite a few sites previously) and have found that it was working, then not working, then working again now not working - all without me changing any code. Here is the process: 1) l/p gets sent to login.php to query the db 2) if login successful, set $sid = session_id, and other session variables, register them in the session, and redirect to main.php 3) first thing on main.php is check_login function, all this does is see if $sid is set and equal to the current session_id(). If succeed continue to display data on main.php based on registered user data. If fail, redirect to error.php with the appropriate error code. this all takes place on a shared ssl server if that matters. The trouble I'm having is the check_login function is failing because no session variables are present, including $sid. I'm 99.9 percent certain it's not a code issue because 1) I have done this same script many times before with no trouble, and 2) this particular one was working before So I am really looking for php configuration issues to check on, or things like that.
View Replies !
Cookies Working In Win9x, ME, Can't Work In WinXP
test my website in local pc (WINXP XP2 + apache 2.0.52 + php 5.0.2 + mysql 4.1.12 + phpmyadmin 2.6.0 pl3), the cookie are working properly (all windows version). i can found the cookie text file in the cookie folder. when i move my website to win 2000 ( WIN2000 SP 4 + php 5.0.2 + mysql 4.1.12 + phpmyadmin 2.6.0 pl3), The cookie can working in Win9x, ME only but can't work in WinXP, mean that it can't store the cookie text file in WinXP pc.
View Replies !
Opera 7 And Sessions Not Working
Opera 7 doesn't seem to mind about session based user checking. On Netscape 4.7 and Ie 5.5 these work perfectly, but Opera 7 just redirects through the login page, i'm using a database to check the username and password. Has enyone else seen this problem my friend just told me about it when i asked his opinion on my login system.?
View Replies !
Sessions Not Working On WAMP
I have a WAMP setup (windows/apache/mysql/php). I'm running the latest version of all of them with a default installation of all of them. PHP works great with apache (as a module, not cgi), except that sessions aren't working. The script at the bottom of this post never increments my hit count. Do I need to turn sessions on somehow in php.ini? ---- <?php // Initialize a session. This call either creates // a new session or re-establishes an existing one. session_start( ); // If this is a new session, then the variable // $count will not be registered if (!session_is_registered("count")) { session_register("count"); session_register("start"); $count = 0; $start = time( ); } else { $count++; } $sessionId = session_id( ); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" > <html> <head><title>Sessions</title></head> <body> <p>This page points at a session (<?=$sessionId?>) <br>count = <?=$count?>. <br>start = <?=$start?>. <p>This session has lasted <?php $duration = time( ) - $start; echo "$duration"; ?> seconds. </body> </html> ----
View Replies !
Get Sessions Working On My PHP Install
I cannot get sessions working on my PHP install. It's Apache with PHP. If I create the two files as shown here: http://www.php.net/manual/en/function.session-start.php Nothing shows up on page2 as I think it should. I am making a small site, also, where I want to use sessions and they do not appear to be working. What may be wrong?
View Replies !
Sessions Not Working On My Web Host
I wrote a website on my local PC that used sessions. The sessions worked perfectly. Then I uploaded the website onto a VPS linux server. The sessions stopped working: They work on an individual page, but if I try and retreive a value of a session that was set on another page, the value is returned as empty. So, I checked out the location where the sessions are being stored on my server. There were session files in there with test values I had created on my site so the sessions are definitely being stored, it seems there is just some problem picking them up on other pages.. Code:
View Replies !
Newbie Working With Sessions &
I go about in making a EDIT page with MySQL using Sessions? I have a session open that's called user_ID and I'm able to get the session "first_name" to display on all pages, but I'm having a hard time getting the rest of the information like address, phone, email to open back up. I think I have to use a query using a loop to populate some variables from the database, but I really have no idea how to start with it. I have three books infront of me for reference and none of them are really clean in helping me how to open a database once someone is already logged in with session.
View Replies !
Unable To Get Sessions To Work Properly With The Combination Apache 2.0.49 / PHP 4.3.6 / Windows XP.
I'm unable to get sessions to work properly with the combination Apache 2.0.49 / PHP 4.3.6 / Windows XP. The data is written to the correct place (according to php.ini), but they are not read in again on the next page. The following script illustrates the problem: <? session_start(); if (!isset($_SESSION['count'])) { $_SESSION['count'] = 0; } else { $_SESSION['count']++; } echo $_SESSION['count']; ?> Each time the page is reloaded, the output should increment by one, i.e. it should be: 0,1,2,..., and it indeed works this way on my laptop with Apache 1.3.29 / PHP 4.3.6 / Windows XP, but, alas, not with the newest Apache2.
View Replies !
Sessions Not Working - Login Script
I am trying to get a login script working. I have it working on one site, and I copied the entire script over to another and it doesnt store the session. These 2 sites reside on the same physical server. The one that does not work brings up the login box and when you input the username/password it takes you to the next page, but as soon as you click a link from there it takes you back to log in again, over and over. I have cleared cookies, rebooted, tried it on a PC using IE (I am on a Mac running Safari as my browser). It works fine everywhere on the other site, but not the new one. Here is the code:
View Replies !
Sessions Working Without Session_start() Function
I'm having terrible problems with my session and post form heavy pages and I'm now experimenting with different ways of doing it. I removed the session_start() I had at the top of every page, so that session_register() will have to live without it. Nothing happens. It is exactly the same as before. What's the purpose of session_start()?
View Replies !
Php4+apache1.3+xp With Sessions Not Working...
I seem to have a major problem with sessions on my setup. No simple example seems to work. Example below: page1.php: <?php // page1.php session_start(); echo 'Welcome to page #1' $_SESSION['favcolor'] = 'green' $_SESSION['animal'] = 'cat' $_SESSION['time'] = time(); // 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>' ?> Page2.php: <?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']); // You may want to use SID here, like we did in page1.php echo '<br /><a href="page1.php">page 1</a>' ?> Output after pressing page2 link: Welcome to page #2 1970 01 01 00:00:00 page 1
View Replies !
Got Objects In Sessions Working, But Handles Are Not Maintained.
I've been playing for a few days now with putting Objects in sessions and maintaining that object during a session. This seems to be working just fine, and I can see and use most of the functionality without a hitch. In my particular case, I have a Class that performs various TCP/IP functions. Basically, it connects to a device using telnet and interacts with that device. I open the connection and login as part of my class, and I want to keep that connection established so that the various pages can issue a command without having to re-connect and re-login each time. So, for example, I do a socket_connect() early on and want to maintain that connection while the class is passed from page to page. However, after the first use of the socket and subsequent redirect to another page, I find I have a valid class with all its properties intact, but the socket handle (a property itself) seems to have become invalid.
View Replies !
Sessions Not Working In Yahoo Small Business
I developed web app using Php and used sessions. Everything works on my test server but sessions just dont work on the clients server which uses Yahoo Small Business to host their site. For example: <?php session_start(); if (!$_SESSION['count']) { echo "Not registered<BR>"; $_SESSION['count'] = 1; $count = 1; } else { $count = $_SESSION['count']++; } echo "count is '$count'"; ?> Always shows count as 1. The yahoo site uses PHP Version 4.3.6. The only difference relevant I can see in the two sites is session.use_trans_sid which is off on Yahoo. Enabling this with ini_set didnt help. Saving session information in the DB using custome session handlers didnt help either. Any ideas as to why this may be happenning? Other relevant php info is pasted below: Session Support enabled Registered save handlers files user Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 On On session.bug_compat_warn On On session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_divisor 100 100 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path /tmp /tmp session.serialize_handler php php session.use_cookies On On session.use_only_cookies Off Off session.use_trans_sid Off Off
View Replies !
Sessions Dont Seem To Be Working With Internet Explorer
I wrote an authentication class in php4. The sessions dont seem to be working with internet explorer, just with FF. here is the code below, a cookies notice pops up when you try and login: <?php class auth { var $UserID; var $AdminLevel; var $FirstName; var $LastName; var $DateAdded; var $MobileTelephone;...
View Replies !
Host Switched Web Server.. Sessions Not Working
our web host switched us to cPanel and now all of our logins on our website are not working at all here is the error message we get. Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /homedirs/sonotek/public_html/sono-tek.com/pdf_download/pdflogin.php:2) in /homedirs/sonotek/public_html/sono-tek.com/pdf_download/pdflogin.php on line 3 I am using session_start(); at the beginning of each script here is a sample: ....
View Replies !
Why Mysql Isnt Connecting
trying to get php to connect with mysql so that I can start querying db(running locally on my machine and php works fine) however I'm having trouble. This is the error it spits out- Warning: mysql_connect(): Access denied for user 'ODBC'@'localhost' (using password: NO) in D:phpwebconnect.php on line 5 Unable to connect to MySQL Could anyone assist me on this matter.
View Replies !
Working With Sessions And Storing Credit Card Info Inside A Session
have a security concern working with sessions and storing credit card info inside a session, going to the payment gateway, redirecting back to my page and doing a soap connection and processing the order with the session variables, and then destroying the session afterwards. is it safe enough to store credit card information in this manner, can hackers get to this? cause its possible to view POST variables with a firefox plugin. or is it safer to write it to a temporary database table, do what i need to do and then delete the row?
View Replies !
Isnt ^ Common Regex Notation?
isnt ^ common regex notation? keep getting this error: Parse error: syntax error, unexpected '^' Code: $goalsheet.=preg_replace("/^[0-9]+ Year Career Goal #[0-9]+: *$", "/^<span class=hd2>[0-9]+ Year Career Goal #[0-9]+: *</span><br>$/", $goallist); aside from the error, i think the regex is off, but i hav had a hard time finding a tutorial that explains how I can ignore text in the middle. Here are some examples of what i'm trying to do: "1 Year Goal #1: Web Developer" -> "<span>1 Year Goal #1: Web Developer</span><br>" "10 Year Goal #2: IT Consultant" -> "<span>10 Year Goal #2: IT Consultant</span><br>" suggestions?
View Replies !
Script Isnt Pulling The Basename From Upload
This upload script im using for some reason wont pull the file name and database it when you go to upload a file and it wont upload the file either... I used this script before and got it to work but for some reason it wont work now.. I checked the other forms and they still work so i must be missing something in the script. Code:
View Replies !
INSERT Short Record = Fine, Long One Isnt
I have a mysql database table that I created by copying another one in phpadmin. The first table works fine. the second table works fine when I insert a short record, but when I do a long one it doesn't appear in the database. any idea what I'm doing wrong? It's not that its truncating the record, there is nothing there.
View Replies !
Security Code Image In PHPNuke Login Isnt Displaying
i installed the PHP Nuke in a remote web space bought from prackhost.Problem is that iam not able to get the security code to login to the site as admin or normal user. All the remaining images like links and logo are comming except that security code. Iam not able to do any furthur action.
View Replies !
How Can I "stick" Yahoo's Page Into Mine
I am trying to "stick" yahoo's home page into the middle of mine using the include function, ie // my page include("http://www.yahoo.com"); // my page continues here but what winds up happening is that links on yahoo's page are prefaced with my URL. For example, the link to Yahoo Finance becomes "http://www.myurl.com/finance" instead of "http://www.yahoo.com/finance" Also, a lot of the pictures are broken images.
View Replies !
PHP Seems To Work Half The Time, Phpinfo() Doesn't Work
I just updated from a phptriad installation of apache/php/mysql to manual installations of them, all the most current ones. When I installed apache and php, things were fine. phpinfo loaded. After I installed mysql, things started messing up. I can connect to mysql so that seemed to go fine. But phpinfo wouldn't list MySQL info. So, I noticed I had the path to PHP in my httpd.conf wrong, I fixed it, restarted and thats when it all started. I added the "php extension" line , enabled php_mysql.dll module, as well as putting libmysql.dll into my windows folder. Restarted the computer, and still problems. What happens exactly is, if I go to my phpinfo.php page which has a simple phpinfo(); line...it doesn't show anything. If I View Source, I actually see the php code in notepad. <? phpinfo(); ?>On other pages it prints some of the php code on screen. But on a few other pages, such as a page that creates and image via imagecreate()...it works.
View Replies !
Creating User Sessions W/out Using Sessions
I'm working on a user management system where I can use the benefits of PHP sessions w/out messing with them. Basically, my idea is to have an entry created into a "sessions table" when the user logs in. The table contains such info as the user's id number and the date/time they logged in. When the user logs out, the entry is deleted. In each page/script, it checks to see if the user is logged in by checking the sessions table for an entry w/their IP address and the date, to make sure it is fairly current (unless anyone can think of a better way to check). Now my delema....obviously, I don't want people that don't properly log out to have a session that could last weeks (depending on when they visit again). I am thinking a script that cleans up entries that are old would do the trick, but obviously I want this script to run say, at least once an hour. Obviously, I am not going to be able to sit at my computer and run this script every hour of every day. I was thinking of using the script and doing a cron job, but I think my host only allows one cron job per day...and only at night. Any thoughts??
View Replies !
Working Connection... Not Working? (Advanced)
It has tons of modules, and obviously a config file which opens the db connection. But there is one, and only one, module having strange troubles. $query is just a simple INSERT INTO command. But it does not inserts anything. I only obtain... nothing. Neither an error from the server! Code:
View Replies !
My Each(..) Doesn't Work
I've created a form on the fly that contains a track name, and track number.(Code below for FORM & SUBMIT) These details are stored within a matrix. I submit the page and access the matrix. I then use an each to fed into a list. So that the name and number of a track should be fed into separate variables. What do I find.. My magic trick has failed. If I access the variables directly through "$info[Name]" or "$info[Num] then I get the correct values. If I use: "list($name, $num) = each($info); " I find that $num is infact the name of the track and $name comes up as the text "name" Code:
View Replies !
Md5() Doesn't Work?
I have my php/mysql setup so when a user registers, it stores the md5()'d version of their password in the sql database, and when they want to log in, it compares an md5'd version of their input the the data in the database. BUT the md5 version of the input is different than what I got before. And if I try to do an echo() of it, I always get 06d80eb0c50b49a509b49f2424e8c805. It's really messed up. Why doesn't md5() work properly? Taking the md5 of identical text should generate identical results. I even get results of different lengths! md5 was set at 32 bytes I though.j Example: I input the password "test". php-my-admin shows password as "098f6bcd4621d37". OK so far. Login page echo's md5 of "test" as "06d80eb0c50b49a509b49f2424e8c805". What is wrong with this function!! It's not just an echo issue either, as a SELECT * FROM table WHERE password='$md5pass' returns 0 rows.
View Replies !
|