Re: [PHP] writing to a file
Don't even bother with that previous answer. You have what you want to write in a string, $new. Read the file and put that into another string, $previous. Then concatenate the strings with the "." operator: $previous=$new . $previous and write $previous to the file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Silly sessions problem.
WRONG!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] I don't understand HTTP_SESSION_VARS
Hi, The php manual at: http://www.php.net/manual/en/ref.session.php says: "If track_vars is enabled and register_globals is disabled, only members of the global associative array $HTTP_SESSION_VARS can be registered as session variables. " so, did you try this: session_register($HTTP_SESSION_VARS["my_session_var"]; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Session Confusion
Hi, All the session functions check to see if you have a session running first before starting a session, to prevent you from starting two sessions by accident. If for some reason you want to start another session, you can do that by supplying your own session id to the function session_start() to start another session. However, you do not need to do that for your purposes. You can start the only session you need when they submit their form info, and to keep them from signing up twice, before you record the data use an if statement to check if there is a session(if ($PHPSESSID)). If there is already a session, do not record the data, and display a message: "You have already signed up, proceed to login." and redirect them to the login page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Session Confusion
Hi, Just to explain a point on my previous post: If at the top of your page that processes the registration info, you include: session_start(); session_register("is_registered"); is_registered="yes"; and then use this test: if($PHPSESSID) { warning, redirect to login } else { record info, redirect to login } Will the condition in the if statement be true? It seems like it should because you started the session. But a session id is a cookie, and a cookie is not available on the page it is set. So, the first time this script is encountered, e.g. when they register for the first time, even though you started the session, the if statement condition will be false, indicating the first time someone is registering. Subsequently, if someone uses the back button and then clicks submit to get to this page again, then the cookie will be set, and the if statement will return true, causing the other branch of the if statement to execute. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] I don't understand HTTP_SESSION_VARS
Hi, That code causes php to crash. I have never had that happen before. Every time I try to run that script, I am given an internal server warning. ""Johnson, Kirk"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Try as below. Note both the global and the session_register statements. > > > function set session() > > { > > global $my_session_var,$HTTP_SESSION_VARS; > > session_start(); > > $my_session_var = "Blah blah"; > > session_register($HTTP_SESSION_VARS['my_session_var']); > > } > > Kirk > > > > -Original Message- > > From: Michael Champagne [mailto:[EMAIL PROTECTED]] > > Sent: Friday, March 23, 2001 1:32 PM > > To: PHP General Mailing List > > Subject: [PHP] I don't understand HTTP_SESSION_VARS > > > > > > I'm still having problems with this. I was able to get > > sessions and session > > variables working ok with register_globals=on, but I had read > > that it was > > better not to keep register_globals on so I turned it off and > > I'm trying to > > figure out how this works now. > > > > I'm registering a variable in one function say like this: > > function set session() > > { > > global $my_session_var; > > session_start(); > > $my_session_var = "Blah blah"; > > session_register('my_session_var'); > > } > > > > Then I'm trying to read it in another function like this: > > function read_session() > > { > > global $HTTP_SESSION_VARS; > > session_start(); > > echo ($HTTP_SESSION_VARS[my_session_var]); > > } > > > Michael Champagne, Software Engineer > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] I don't understand HTTP_SESSION_VARS
Also, you are registering a variable rather than a name. So, unless there is a quoted name for the variable value, I don't think that would work. For instance, $a="b" session_register($a); actually registers a variable called $b. I made that mistake in my post too. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] I don't understand HTTP_SESSION_VARS
Hi, The default php setting is with track vars on, and register globals on I believe. I have never tried anything else. I turned globals off to see if I could help you with your problem. If you check the manual, they do not put much explanation into how to use sessions with globals off, though I have read that some webservers may have globals turned off. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] I don't understand HTTP_SESSION_VARS
Hi, Go post your globals question at the php forum at www.devshed.com . You will usually get extremely quick responses to questions about php. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] writing to a file
Hi, What was so difficult about implementing my last post? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] register_globals on or off?
Hi, Could someone explain what the following passage in php.ini means: You should do your best to write your scripts so that they do not require ; register_globals to be on; Using form variables as globals can easily lead ; to possible security problems, if the code is not very well thought of. If register_globals is off, does that mean you cannot access form variables by just referring to their name? And, if that is so, how do you pass information from forms to your action script? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Dear Friends & Future Millionaire:
AS SEEN ON NATIONAL TV: Making over half million dollars every 4 to 5 months from your home for an investment of only $25 U.S. Dollars expense one time THANK'S TO THE COMPUTER AGE AND THE INTERNET ! == BE A MILLIONAIRE LIKE OTHERS WITHIN A YEAR!!! Before you say ''Bull'', please read the following. This is the letter you have been hearing about on the news lately. Due to the popularity of this letter on the Internet, a national weekly news program recently devoted an entire show to the investigation of this program described below, to see if it really can make people money. The show also investigated whether or not the program was legal. Their findings proved once and for all that there are ''absolutely NO Laws prohibiting the participation in the program and if people can -follow the simple instructions, they are bound to make some mega bucks with only $25 out of pocket cost''. DUE TO THE RECENT INCREASE OF POPULARITY & RESPECT THIS PROGRAM HAS ATTAINED, IT IS CURRENTLY WORKING BETTER THAN EVER. This is what one had to say: ''Thanks to this profitable opportunity. I was approached many times before but each time I passed on it. I am so gladI finally joined just to see what one could expect in return for the minimal effort and money required. To my astonishment, I received total $ 610,470.00 in 21 weeks, with money still coming in." Pam Hedland, Fort Lee, New Jersey. === Here is another testimonial: "This program has been around for a long time but I never believed in it. But one day when I received this again in the mail I decided to gamble my $25 on it. I followed the simple instructions and walaa . 3 weeks later the money started to come in. First month I only made $240.00 but the next 2 months after that I made a total of $290,000.00. So far, in the past 8 months by re-entering the program, I have made over $710,000.00 and I am playing it again. The key to success in this program is to follow the simple steps and NOT change anything.'' More testimonials later but first, = PRINT THIS NOW FOR YOUR FUTUREREFERENCE == $ If you would like to make at least $500,000 every 4 to 5 months easily and comfortably, please read the following...THEN READ IT AGAIN and AGAIN!!! $ FOLLOW THE SIMPLE INSTRUCTION BELOW AND YOUR FINANCIAL DREAMS WILL COME TRUE, GUARANTEED! INSTRUCTIONS: =Order all 5 reports shown on the list below = For each report, send $5 CASH, THE NAME & NUMBER OF THE REPORT YOU ARE ORDERING and YOUR E-MAIL ADDRESS to the person whose name appears ON THAT LIST next to the report. MAKE SURE YOUR RETURN ADDRESS IS ON YOUR ENVELOPE TOP LEFT CORNER in case of any mail problems. === When you place your order, make sure you order each of the 5 reports. You will need all 5 reports so that you can save them on your computer and resell them. YOUR TOTAL COST $5 X 5=$25.00. Within a few days you will receive, vie e-mail, each of the 5 reports from these 5 different individuals. Save them on your computer so they will be accessible for you to send to the 1,000's of people who will order them from you. Also make a floppy of these reports and keep it on your desk in case something happen to your computer. IMPORTANT - DO NOT alter the names of the people who are listed next to each report, or their sequence on the list, in any way other than what is instructed below in step '' 1 through 6 '' or you will loose out on majority of your profits. Once you understand the way this works, you will also see how it does not work if you change it. Remember, this method has been tested, and if you alter, it will NOT work !!! People have tried to put their friends/relatives names on all five thinking they could get all the money. But it does not work this way. Believe us, we all have tried to be greedy and then nothing happened. So Do Not try to change anything other than what is instructed. Because if you do, it will not work for you. Remember, honesty reaps the reward!!! 1 After you have ordered all 5 reports, take this advertisement and REMOVE the name & address of the person in REPORT # 5. This person has made it through the cycle and is no doubt counting their fortune. 2 Move the name & address in REPORT # 4 down TO REPORT # 5. 3 Move the name & address in REPORT # 3 down TO REPORT # 4. 4 Move the name & address in REPORT # 2 down TO REPORT # 3. 5 Move the name & address in REPORT # 1 down TO REPORT # 2 6 Insert YOUR name & address in the REPORT # 1 Position. PLEASE MAKE SURE you copy every name & address ACCURATELY! == Take this entire letter, with the modified list of names, and save it on your computer. DO NOT MAKE ANY OTHE