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 Complete Forum Thread with Replies
Related Forum Messages:
PHP3, Oracle, Apache1.36
I am trying to get the above combination to work. Compiling PHP with Oracle support seems to work in that there are no errors from the compile and install. Likewise with compiling PHP3 as a static module in Apache. However apache gets a segmentation violation code 11 when it hits the first oracle related function in the php code. The documentation on actually getting Oracle support working in PHP is very sparse. Is there anyone out there who has done this successfully who would care to share their secrets? I am using PHP3.0.12, Oracle 7.3.4, Apache 1.3.6 on HP/UX 10.20.
View Replies !
Sessions Without Cookes In Php4
I need to use php sessions without cookies, my session registers works perfect, but I really don't know how to use an expiration time as it is used with cookies. Do you know what can I do to use an expiration time of 15 minutes??. I've tried using mysql to save the session ID's and check there if the sessoin is already registered and how long it has been inactive to see if it's an accepted time, but it really uses a lot of resources just to check. And if you have a lot of visitors at your page your machine almost die. Other thing is that the session Id's keeps saved in my /tmp and are never deleted if you don't do a logout where I use the destroy code.
View Replies !
Sessions Not Returning Anything? - NT - Php4
I use php4 on PWS NT workstation. I use the basic session example in the php docs, the e-commerce tut on devshed and the origional example from devshed(couch sessions) and no luck. I get a page, yet when I view source - nothing after the body tag? Is there a module I have to uncomment in php.ini or something I have to download? I have tried viewing from another machine and multiple browsers.
View Replies !
PHP4+Win98 And Sessions
I've tried PHP4build4, RC1, RC2 and 4.0.0 with Win98 but sessions doesn't work: I've got 2 pages: first_page.php3 <? session_start(); $myvar="test"; session_register("myvar");?> second_page.php3 <? session_start(); echo $myvar; ?> I've launched first_page.php3, then I've launched second_page.php3: the browser doesn't display anything (it should display the world "test").
View Replies !
PHP4 Sessions And Arrays
I'm currently working on a PHP4/MySQL generic shopping cart project, but I am having problems with the cart section. At present, my 'add one item to cart' function works using sessions and arrays, something like: PHP Code:
View Replies !
PHP3 Or PHP4 Tag Not Working
I am setting up my own Apache web server. I downloaded PHP4 but the only php tag that works is .php and not .php3 or .php4. Is this something in the Apache conf file?
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 !
PHP4 - Zlib Functions Not Working
I had to update my server configuration consisting of Apache2 and PHP4. I now have installed: apache2/apache2-prefork 2.0.54-2.1 apache-mod_php4/php4-zlib/php4 4.3.11-0.3.1 "Regular" PHP scripts work just fine, but the websvn script is acting up - after selecting a repository the page just "hangs", i.e. the browser waits "forever" for a response. If that happens there is no error message in the server log and it looks like the thread just gets stuck and never returns. Using Gubed I tracked it down to the zlib functions, i.e. whenever the script calls a line like $output = transArray(gzfile($cachedname)); it hangs there and I can't get control over it anymore. Does anybody have some insight whether I miss anything or tips how i can track this down further?
View Replies !
MySQL_connect() Working In PHP4 Not In PHP5?
I upgraded my development machine to PHP5. My pages with the subject function no longer work. I am able to do an ODBC connect to the data files from other programs. I get the error: Fatal error: Call to undefined function mysql_connect() in <file.php> on line 190. This is a W2K machine running IIS4, if that makes a difference... Still works on server running PHP4.
View Replies !
Ftp_connect() Stopped Working (PHP4.4.2/FC2)
I run puppyfiles.us, and I've been using php on the site for some time. Today, I noticed that my coding isn't working any more. Specifically, I'm getting the following error: Fatal error: Call to undefined function: ftp_connect() in /var/www/vhosts/puppyfiles.us/httpdocs/.VERSIONS on line 25 The offending code in .VERSIONS (an included file) is: $ftp_server = "puppyfiles.us"; $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, "anonymous", "puppyfiles"); if ((!$conn_id) || (!$login_result)) { die("FTP connection has failed !"); }
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 !
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 !
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 !
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 !
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 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 !
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 !
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 !
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 !
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 !
Php4
I'm wanting to work with php4 and want to know which version of mysql to download that works great with php4 api version 3.23.x?
View Replies !
PHP4 Ignored With IIS
I am attempting to get PHP4 working with IIS but the php script is ignored. I installed Apache and it works with the Apache server so it is obviously a configuration error on my part but I can't find it. I have a test.php file that I run with each configuration.
View Replies !
Re Php4.3.4
Re previous problem Thanks to Alvaro, I solved the original problem on php version 4.3.4 However, I now have another one. I have an admin panel which requires a password to access it from a previous page. With the site live on an ISP server, everything is OK. On my local server running Apache and php 4.3.4, when the correct p/w is entered on the previous page, instead of going to the correct page (which consists of 2 frames, it simply reproduces the previous page in both frames. The script being used is: #-----REDIRECT AUTH USER---------- if($HTTP_SESSION_VARS['sessadmin']){ Header('Location:admin.index.php'); } #------AUTHENTICATE PASSWORD------- if($HTTP_POST_VARS['pass']){ if(crypt($HTTP_POST_VARS['pass'], $HTTP_POST_VARS['pass'])=='wiOgiun64DE9.'){ session_register('sessadmin'); $sessadmin='set' $done=1; } Because it works OK on an ISP, I assume it must be a setting in my local apache/php set up.
View Replies !
PHP4 XML DOM
Currently my web server supports only php4. I want to know how to parse the xml and get the element value using dom. I thought they have similar function for getting element by id or tag name, so far i haven't find anyting like that except fro PHP5 with Domdocument. $dom = domxml_open_file ('data.xml'); $e_data = $dom->document_element(); <?xml version="1.0"?> <book> <title>hhelo</title> </book>
View Replies !
GD2 And PHP4.4
It should be possible (as far as I know) to use createimagefromjpg('<urltoimage>'); In PHP4.3.11 it worked just fine, but now I use PHP4.4 and it is not working anymore! I only can do: createimagefromjpeg('blafoo.jpg') (=same dir) or createimagefromjpeg('d:/inetpub/vhosts/......../blafoo.jpg); This function is also used in a plugin (LightBox) for Nuclues and with Nucleus is isn't working also. Anybody a solution? (I *need* to load from url!).
View Replies !
PHP4 And XML
How can I pase this xml file using php. I am currently using xml_parse($xml_parser,file_get_contents($file)); but this get the php code and not the out putted xml. I can't get my head around how to parse the outputted xml using php Code:
View Replies !
XML In Php4
XML for data transfer between 2 servers. It's all working nicely - getting my "interface" object populated works like a charm - however, now that I wanted to test the application on the production server (PHP 4.4.4 - development server is 5.1), I of course, ran into a ton of issues due to php4's lack of XML support (compared to v5). After having tried multiple classes and trying to shimmy something together myself.
View Replies !
PHP4 Vs. PHP 5
I know PHP 5 is the newer (and presumably) better version, but I don't have any experience programming OOP. And I don't want to stumble learning PHP simply because I am struggling with OOP concepts. Yet at the same time, I'd rather learn a newer (more applicable) version, and I do hope to learn OOP programming some day soon.
View Replies !
PHP3 And PHP4 Together
I'm a little new to the PHP thing. I want to try to setup my server to handle PHP3 and PHP4 requests easily. e.g. I have some scripts that are PHP3 and want to start learning PHP4. Instead of doing the simple (like anything I do is simple URL ) thing, I am attempting to set up apache to support MySQL, PHP3, PHP4, SSL, ColdFusion, SteelBlue, and maybe even Frontpage. Tell me I'm insane. Now I have read the "Soothingly Seamless" setup from the website, and had it mostly working, until some unforseen circumstances caused me to have to start over. I can set up Apache to use PHP4, MySQL, and SSL, but for those PHP3 scripts, I am a bit lost. Finally, my question. Is there a simple way (using the Sootingly Seamless page as a reference) to add PHP3 into the mix. Any help on this would be great!
View Replies !
PHP3 Or PHP4
I am starting to write some scripts. Now should I wait until PHP4 documentation and tutorials arise and write in PHP4, or should I just do everything in PHP3? I have a book on PHP3 and I want to know if the language has changed enough to make this book invalid. Thanks. Any clear input is appreciated.
View Replies !
MSSQL With PHP4
I am using win98 and SQL7.0,, the problem is when i try to connect to the database using the next query : <?php $username = "bla"; $password = "bla"; $database = "bla"; $conn = mssql_connect($server, $user, $pass); $select = mssql_select_db($database, $conn); $sql = "SELECT * FROM "; $result = mssql_query($sql, $conn); ?> it gives me the next error message : Fatal error: Call to undefined function: mssql_connect() in C:Inetpubwwwrootphptestmain2.php on line 6
View Replies !
PHP4 And SSL And Raven
1) - Has anyone had intermittent "Page Not Found" or "Page Cannot Be Displayed" errors when using PHP4 over a secure connection. It's not our programming because we get the error when using phpmyadmin over SSL. Phpmyadmin is an open source utility which was programmed by someone else. We are using a RaQ4 Cobalt box running Linux, hosted with Aspre (aspre.net). Our ISP says some other customers have complained about a similar problem but they have no solutions. 2)- We talked with another dedicated server provider (Adgrafix, adgrafix.com) and they said that we would have to install "Raven" to make PHP work over SSL. Has anyone heard of Raven? Is it necessary?
View Replies !
Session In Php4
I have tested a couple functions, they work fine, but when I try the session_start() function, it just hang the browser for a long time and at the end, return me a message saying that the page is not found. Is there some configuration I have to make before I can use session-related function? or what else I should do?
View Replies !
Setting Up PHP4
I have set up PWS and PHP4 on my Windows98 computer but I am still unable to see php coding in .php files in IE. Yes I have put them in the right dir. I think the problem was that I was unable to put the file msvcrt.dll in my C:WINDOWSSYSTEM folder. When ever I try to copy that file into C:WINDOWSSYSTEM I get an error message that says "Cannot creat or replace msvcrt: The specified file is being used by Windows." Whats going on here?
View Replies !
PHP4 Beta
i installed PHP4b2 for NT4/IIS but the PHPpages just won't show - HTTP error 500. how do i troubleshoot this? I have installed the php isapi filter and also *.php is associated with the above filter as per the installation notes. The normal htm pages are OK.
View Replies !
Install Php4
I have installed php4 on my linux server,and all the process is so smooth,but when I write a php file only content a single sentence of <? phpinfo ?>,the system tells me the version of the php is 3.0.15,why?At the same time the php cann't connect ot mysql.
View Replies !
Reddhat 7.1 & Php4
Problem: the file phpinfo.php always showed the script line <? phpinfo(); ?> in redhat 7.1. But: 1. php works in window 2000 2. it also works in win98 3. it also works in a modified redhat 7.1 where I installed apache+mysql+php myself.
View Replies !
PHP LIB Works With PHP4?
I want to install phplib but found "PHP 4 is still in beta. We do not support deployment of this library with beta software." in phplib installation manual. Does it mean that I have to go back to php3? Have anyone have positive experience installing phplib on php4? After I notice this problem. I tried to look up the answer in the web, and found only one negitive answer: - - - - I did and mailed it to php4-beta. If I install a build of PHP4 and the php.ini-dist distributed with PHP4, I get the core as soon as I either define a doc_root or an auto_prepend_file, no matter what I do. Kristian - - - - But it is in php4 beta though. So, I don't dare to go any further because I'm really new to php.
View Replies !
|