Re: [PHP] programming the onclick() event in an anchor
On Wednesday 24 December 2003 08:06 pm, Peter Walter wrote: I have written a session-enabled php page which displays a table of search results. The first column in the table contains anchor links to www.mydomain.com/mypage?seqno= where seqno is a variable I would like to pass when the anchor is clicked. However, I do not wish the ?seqno= to display in the url of the browser. After googling a lot, it appears that I can use JavaScript to set a session variable in the I doubt it- otherwise it would be pretty easy to set, say $_SESSION['logged_in'] onclick() event, but I have not been able to find an example of how to But you /can/ use JS to set a cookie, which can be retrieved (and stored in a session variable if you want) by PHP. http://www.webreference.com/js/column8/ http://us4.php.net/manual/en/reserved.variables.php#reserved.variables.cookies do it. Does anyone have experience doing this? Sample code would be greatly appreciated. http://www.webreference.com/js/column8/functions.html Peter -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- There is a certain right by which we may deprive a man of life, but none by which we may deprive him of death. -Nietzsche -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: basic set and read a cookie probs
On Wednesday 24 December 2003 10:15 pm, Jack E. Wasserstein, DDS, Inc. wrote: Sorry, No such thing as $_POST_VARS next time you're having problems, try doing an error_reporting(E_ALL); It really helps a lot, though I'll admit it can be a bit finicky :) Oh and don't forget to turn it off when you're done w/ development Jack E. Wasserstein [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am using the following code on the php form handler if ($_POST[referdrremember] == true) { setcookie(remailcookie, $_POST_VARS[refdremail],time()+3600,/,wasserstein.com,0); Try to see the cookie in the same script, not sure which one to use with or without $ print the cookie's value is $HTTP_COOKIE_VARS[remailcookie] ; print the cookie's value is 2 $HTTP_COOKIE_VARS[$remailcookie] ; In addition when I get back to the calling form and refresh it I try to see the cookie with this: if ($HTTP_COOKIE_VARS[remailcookie]) { print (remail cookie exists); } else { print (no cookie); } This yeilds no cookie I have also tried $_COOKIE[] as well What am I doing wrong. Thanks in advance, Jack -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- It is an unfortunate fact that every man who seeks to disseminate knowledge must contend not only against ignorance itself, but against false instruction as well. No sooner do we deem ourselves free from a particularly gross superstition, than we are confronted by some enemy to learning who would set aside all the intellectual progress of years, and plunge us back into the darkness of mediaeval disbelief. -HP Lovecraft -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem sending variables with forms
I have a problem that i cant send variable over a form. Because of that when i watn to echo the variable next page an error occured...i use redhat 9.0, apache 2 and php 4.3.4. Please help me Abdullah Teke _ Telephone : +90 555 337 21 89 Messenger : [EMAIL PROTECTED] Web: http://abdullahteke.cjb.net Icq : 164500674
php-general Digest 25 Dec 2003 15:16:12 -0000 Issue 2493
php-general Digest 25 Dec 2003 15:16:12 - Issue 2493 Topics (messages 173314 through 173319): Re: basic set and read a cookie probs 173314 by: Jack E. Wasserstein, DDS, Inc. 173318 by: Evan Nemerson Re: JavaScript question 173315 by: -{ Rene Brehmer }- Problem with session variables on Mac 173316 by: Jim Sara Feldman Re: programming the onclick() event in an anchor 173317 by: Evan Nemerson problem sending variables with forms 173319 by: Abdullah Teke Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Sorry, No such thing as $_POST_VARS Jack E. Wasserstein [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am using the following code on the php form handler if ($_POST[referdrremember] == true) { setcookie(remailcookie, $_POST_VARS[refdremail],time()+3600,/,wasserstein.com,0); Try to see the cookie in the same script, not sure which one to use with or without $ print the cookie's value is $HTTP_COOKIE_VARS[remailcookie] ; print the cookie's value is 2 $HTTP_COOKIE_VARS[$remailcookie] ; In addition when I get back to the calling form and refresh it I try to see the cookie with this: if ($HTTP_COOKIE_VARS[remailcookie]) { print (remail cookie exists); } else { print (no cookie); } This yeilds no cookie I have also tried $_COOKIE[] as well What am I doing wrong. Thanks in advance, Jack ---End Message--- ---BeginMessage--- On Wednesday 24 December 2003 10:15 pm, Jack E. Wasserstein, DDS, Inc. wrote: Sorry, No such thing as $_POST_VARS next time you're having problems, try doing an error_reporting(E_ALL); It really helps a lot, though I'll admit it can be a bit finicky :) Oh and don't forget to turn it off when you're done w/ development Jack E. Wasserstein [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am using the following code on the php form handler if ($_POST[referdrremember] == true) { setcookie(remailcookie, $_POST_VARS[refdremail],time()+3600,/,wasserstein.com,0); Try to see the cookie in the same script, not sure which one to use with or without $ print the cookie's value is $HTTP_COOKIE_VARS[remailcookie] ; print the cookie's value is 2 $HTTP_COOKIE_VARS[$remailcookie] ; In addition when I get back to the calling form and refresh it I try to see the cookie with this: if ($HTTP_COOKIE_VARS[remailcookie]) { print (remail cookie exists); } else { print (no cookie); } This yeilds no cookie I have also tried $_COOKIE[] as well What am I doing wrong. Thanks in advance, Jack -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- It is an unfortunate fact that every man who seeks to disseminate knowledge must contend not only against ignorance itself, but against false instruction as well. No sooner do we deem ourselves free from a particularly gross superstition, than we are confronted by some enemy to learning who would set aside all the intellectual progress of years, and plunge us back into the darkness of mediaeval disbelief. -HP Lovecraft ---End Message--- ---BeginMessage--- you can simply call: Window.location.href = 'http://yourdomain.com/phpscripttocall.php?variable1=value1variable2=value2' ^works in all browsers supporting JavaScript ... there's a few variants of this that will only work in IE or Netscape, but this one is vague enough to work in both... (not sure about Opera, it doesn't run well on my setup, so testing with it is a basically impossible for me)... if you use frames, it's a bit more tricky, but I trust you don't, otherwise just ask ... :) ... I've got the complete JavaScript code to change the content of frames criss-cross of each other in any way and pattern you can dream off... (my site used to be a JS driven monster before I got my webhotel and the option to do it all with PHP) ... Rene At 19:58 02-11-2003, you wrote: Good morning. I know this may be off-topic but I don't know where to turn. I'm building a dynamic web page system with PHP and need to figure out in JavaScript how to do something. I have the timer figured out in JavaScript but what I need is a way to automatically submit a request back to the web server after the timer runs out. What I'm trying to do is display slides in sequence. When the timer expires, it sends back to the web server the parameters of slide group and the last slide displayed. The PHP on the server end builds a new page and sends it to the browser with the next slide in the sequence. Any help would be greatly appreciated and my PHP skills are vastly above my JavaScript skills (very basic beginner). Robin 'Sparky' Kopetzky Black Mesa Computers/Internet Service
RE: [PHP] problem sending variables with forms
Some code samples would be really helpful. You also said an error occurred but failed to mention any details about that error. That aside, I'll make a guess at some possible problems: 1) You're trying at access the wrong super global (e.g. GET when you should be looking for POST). 2) You're trying to access the variable directly but do not have register_globals enabled. 3) You're spelling something wrong (we all do it from time to time). -M -Original Message- From: Abdullah Teke [mailto:[EMAIL PROTECTED] Sent: Thursday, December 25, 2003 8:55 AM To: [EMAIL PROTECTED] Subject: [PHP] problem sending variables with forms I have a problem that i cant send variable over a form. Because of that when i watn to echo the variable next page an error occured...i use redhat 9.0, apache 2 and php 4.3.4. Please help me Abdullah Teke _ Telephone : +90 555 337 21 89 Messenger : [EMAIL PROTECTED] Web: http://abdullahteke.cjb.net Icq : 164500674 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How New Is HERE?
I'm running PHP version 4.3.0 on a Macintosh PowerBook with OS 10.2.1, doing some PHP tutorial exercises. And I've run across something I haven't seen before in the sample code I'm seeing: print HERE [multiple lines of code] HERE; Now, from what I've read, it seems that the point of HERE ... HERE; is to execute all the code between the two HEREs. But when I run this thru my browsers--Netscape 7.02 and IE 5.2--I get the following error message: Parse error: parse error, unexpected $ in [path to file] [line number] Is this HERE ... HERE; new to PHP sometime after version 4.3.0, and I'm just out of luck unless I upgrade? Thank you. Steve Tiano mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with session variables on Mac
$session_time = $current_time - $_SESSION('timestamp'); echo session time = $session_time seconds.br; The output to the browser (Safari) is as follows: inside check IF Time = 1072308706. Fatal error: Call to undefined function: array() in /Library/WebServer/Documents/testit/Logsafe_project/user_auth_fns.php on line 35 As you can see, the code bombs as soon as it hits the $_SESSION('timestamp'). $_SESSION is an array, therefore its elements are indexed like so: $_SESSION['timestamp']. -mike. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How New Is HERE?
AFAIK, it has been in PHP since the beginning of PHP4. I could be wrong, but I think it was one of the new features added when 4.0 came out. Here is a little reference material for you on it. http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc Without seeing a code snippet, I can't tell you what your doing wrong. Probably something simple, but hopefully the document above will help you. Another resource which gives a decent guide to HEREDOC's is the fairly new book Core PHP Programming Third Edition. It's been a while since I read it, but if memory serves it has atleast a page or two on it's usage. I also highly recommend that book anyway to any PHP programmer, beginner all the way to highly advanced. I thought I knew almost everything about PHP and even I still learned about a new function or two from the book. Very worthwhile. Jeremy On Thu, 2003-12-25 at 12:44, [EMAIL PROTECTED] wrote: I'm running PHP version 4.3.0 on a Macintosh PowerBook with OS 10.2.1, doing some PHP tutorial exercises. And I've run across something I haven't seen before in the sample code I'm seeing: print HERE [multiple lines of code] HERE; Now, from what I've read, it seems that the point of HERE ... HERE; is to execute all the code between the two HEREs. But when I run this thru my browsers--Netscape 7.02 and IE 5.2--I get the following error message: Parse error: parse error, unexpected $ in [path to file] [line number] Is this HERE ... HERE; new to PHP sometime after version 4.3.0, and I'm just out of luck unless I upgrade? Thank you. Steve Tiano mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] programming the onclick() event in an anchor
You can place form tags around the anchors and use hidden tags and send via post so the variable is not obvious. A user reading the source would see this though... echo form name=\form1\ action=\https://this.site.com/somePage.php\; method=\post\\n; echo a onClick=\this.form.submit();\SomeLinkText/a\n; echo input type=\hidden\ name=\variable\ value=\.$value.\\n; echo /form\n; I'm not sure off the top of my head if the anchor tag must have any other description. You might be able to use onChange instead of onClick to include selection by using the keyboard, but I'm not sure if the anchor tag responds to onChange. You'd have to try it out. Larry. -Original Message- From: Evan Nemerson [mailto:[EMAIL PROTECTED] Sent: Thursday, December 25, 2003 2:59 AM To: Peter Walter; [EMAIL PROTECTED] Subject: Re: [PHP] programming the onclick() event in an anchor On Wednesday 24 December 2003 08:06 pm, Peter Walter wrote: I have written a session-enabled php page which displays a table of search results. The first column in the table contains anchor links to www.mydomain.com/mypage?seqno= where seqno is a variable I would like to pass when the anchor is clicked. However, I do not wish the ?seqno= to display in the url of the browser. After googling a lot, it appears that I can use JavaScript to set a session variable in the I doubt it- otherwise it would be pretty easy to set, say $_SESSION['logged_in'] onclick() event, but I have not been able to find an example of how to But you /can/ use JS to set a cookie, which can be retrieved (and stored in a session variable if you want) by PHP. http://www.webreference.com/js/column8/ http://us4.php.net/manual/en/reserved.variables.php#reserved.variables.cooki es do it. Does anyone have experience doing this? Sample code would be greatly appreciated. http://www.webreference.com/js/column8/functions.html Peter -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- There is a certain right by which we may deprive a man of life, but none by which we may deprive him of death. -Nietzsche -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] programming the onclick() event in an anchor [FIXED]
Evan, Thank you for responding - as a newbie to PHP, HTML, and JavaScript, the cookie approach is a little too complex for me. However, after googling some more, I came across the following approach which seems to be simple and works well: (a) enclose the result table within a form, specifying the form name as results, the post method, and action as the page url to be loaded when the anchor is clicked. (b) insert a hidden field (seqnum) within the form. (c) In the php code which builds the table, for the anchor link, use the following code: ($seqno is the data to be passed) print a href=\javascript://\ onclick=\document.results.seqnum.value=$seqno;document.results.submit();\; Result: $HTTP_POST_VARS['seqnum'] will be set to the sequence number. The only downside to this method seems to be that the visited anchors do not change color. Can anyone suggest how to fix that? Peter Evan Nemerson wrote: On Wednesday 24 December 2003 08:06 pm, Peter Walter wrote: I have written a session-enabled php page which displays a table of search results. The first column in the table contains anchor links to www.mydomain.com/mypage?seqno= where seqno is a variable I would like to pass when the anchor is clicked. However, I do not wish the ?seqno= to display in the url of the browser. After googling a lot, it appears that I can use JavaScript to set a session variable in the I doubt it- otherwise it would be pretty easy to set, say $_SESSION['logged_in'] onclick() event, but I have not been able to find an example of how to But you /can/ use JS to set a cookie, which can be retrieved (and stored in a session variable if you want) by PHP. http://www.webreference.com/js/column8/ http://us4.php.net/manual/en/reserved.variables.php#reserved.variables.cookies do it. Does anyone have experience doing this? Sample code would be greatly appreciated. http://www.webreference.com/js/column8/functions.html Peter
[PHP] Re: How New Is HERE?
It doesn't execute the code between the HERE ... HERE. It's called heredoc syntax for delimiting strings. Say you had a really long string, with lots of variables in it that needed parsing, and lots of and ' signs. Instead of using print you can use the heredoc syntax. You start with and an identifier (in this case 'HERE') and then end with that identifier and a semicolon. It's just a way for delimiting strings, so you need to look for what's causing that unexpected $ just as if you were looking at a string. I can't help you any more without a code snippet. -- Jasper [EMAIL PROTECTED] wrote: I'm running PHP version 4.3.0 on a Macintosh PowerBook with OS 10.2.1, doing some PHP tutorial exercises. And I've run across something I haven't seen before in the sample code I'm seeing: print HERE [multiple lines of code] HERE; Now, from what I've read, it seems that the point of HERE ... HERE; is to execute all the code between the two HEREs. But when I run this thru my browsers--Netscape 7.02 and IE 5.2--I get the following error message: Parse error: parse error, unexpected $ in [path to file] [line number] Is this HERE ... HERE; new to PHP sometime after version 4.3.0, and I'm just out of luck unless I upgrade? Thank you. Steve Tiano mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Apache 2 and PHP
A few months back the official PHP website still warned againts PHP and Apache 2. I am wondering about the current status of these two technologies when used together. I am about to configure a web server and was going to use Apache 1.3 with PHP4+ as opposed to Apache 2 with PHP4+. What are your opinions, thoughts and experiences. Thanks in advance. R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 26 Dec 2003 03:59:07 -0000 Issue 2494
php-general Digest 26 Dec 2003 03:59:07 - Issue 2494 Topics (messages 173320 through 173327): Re: problem sending variables with forms 173320 by: Mike Brum How New Is HERE? 173321 by: stiano.optonline.net 173323 by: Jeremy Johnstone 173326 by: Jasper Bryant-Greene Re: Problem with session variables on Mac 173322 by: Mike Migurski Re: programming the onclick() event in an anchor 173324 by: Larry Brown Re: programming the onclick() event in an anchor [FIXED] 173325 by: Peter Walter Apache 2 and PHP 173327 by: Radek Zajkowski Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Some code samples would be really helpful. You also said an error occurred but failed to mention any details about that error. That aside, I'll make a guess at some possible problems: 1) You're trying at access the wrong super global (e.g. GET when you should be looking for POST). 2) You're trying to access the variable directly but do not have register_globals enabled. 3) You're spelling something wrong (we all do it from time to time). -M -Original Message- From: Abdullah Teke [mailto:[EMAIL PROTECTED] Sent: Thursday, December 25, 2003 8:55 AM To: [EMAIL PROTECTED] Subject: [PHP] problem sending variables with forms I have a problem that i cant send variable over a form. Because of that when i watn to echo the variable next page an error occured...i use redhat 9.0, apache 2 and php 4.3.4. Please help me Abdullah Teke _ Telephone : +90 555 337 21 89 Messenger : [EMAIL PROTECTED] Web: http://abdullahteke.cjb.net Icq : 164500674 ---End Message--- ---BeginMessage--- I'm running PHP version 4.3.0 on a Macintosh PowerBook with OS 10.2.1, doing some PHP tutorial exercises. And I've run across something I haven't seen before in the sample code I'm seeing: print HERE [multiple lines of code] HERE; Now, from what I've read, it seems that the point of HERE ... HERE; is to execute all the code between the two HEREs. But when I run this thru my browsers--Netscape 7.02 and IE 5.2--I get the following error message: Parse error: parse error, unexpected $ in [path to file] [line number] Is this HERE ... HERE; new to PHP sometime after version 4.3.0, and I'm just out of luck unless I upgrade? Thank you. Steve Tiano mail2web - Check your email from the web at http://mail2web.com/ . ---End Message--- ---BeginMessage--- AFAIK, it has been in PHP since the beginning of PHP4. I could be wrong, but I think it was one of the new features added when 4.0 came out. Here is a little reference material for you on it. http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc Without seeing a code snippet, I can't tell you what your doing wrong. Probably something simple, but hopefully the document above will help you. Another resource which gives a decent guide to HEREDOC's is the fairly new book Core PHP Programming Third Edition. It's been a while since I read it, but if memory serves it has atleast a page or two on it's usage. I also highly recommend that book anyway to any PHP programmer, beginner all the way to highly advanced. I thought I knew almost everything about PHP and even I still learned about a new function or two from the book. Very worthwhile. Jeremy On Thu, 2003-12-25 at 12:44, [EMAIL PROTECTED] wrote: I'm running PHP version 4.3.0 on a Macintosh PowerBook with OS 10.2.1, doing some PHP tutorial exercises. And I've run across something I haven't seen before in the sample code I'm seeing: print HERE [multiple lines of code] HERE; Now, from what I've read, it seems that the point of HERE ... HERE; is to execute all the code between the two HEREs. But when I run this thru my browsers--Netscape 7.02 and IE 5.2--I get the following error message: Parse error: parse error, unexpected $ in [path to file] [line number] Is this HERE ... HERE; new to PHP sometime after version 4.3.0, and I'm just out of luck unless I upgrade? Thank you. Steve Tiano mail2web - Check your email from the web at http://mail2web.com/ . ---End Message--- ---BeginMessage--- It doesn't execute the code between the HERE ... HERE. It's called heredoc syntax for delimiting strings. Say you had a really long string, with lots of variables in it that needed parsing, and lots of and ' signs. Instead of using print you can use the heredoc syntax. You start with and an identifier (in this case 'HERE') and then end with that identifier
[PHP] magic_quotes_gpc setting question.
Hello, Here I've got a few related questions, which are not stated explicitly in the manual. 1. The manual says that the magic_quotes_gpc setting cannot be set at runtime. Is it not possible to set this setting in an ini file, and parse it with the parse_ini_file() function? Also, if this was possible, what will PHP do to the modified variables? Run the stripslashes() functions on all of them? 2. On a related line, are we allowed to use ini values in our ini file that contradict the defined ini values in php.ini? Won't this confuse the parser? 3. What would I do if I didn't have access to my own custom ini file, but could somehow get the file either by using fopen(), file() or file_get_contents()? Can I parse a string (or array) like an ini file? 4. Does parse_ini_file() allow us to specify absolute filenames of the form scheme://... from another server, if our allow_url_fopen is TRUE? Thank You. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php