[PHP] Page Rendering
Hi all. I am having some problems with a script which reads information from a database and creates a table. It works in IE but not Netscape. I call myself going through the tags to make sure all that were open were closed because Netscape doesn't like unfinished business. What I have is a script that outputs the previous page, 1, 2, ..., next page link (if there are more than x table items per page). It has worked in both browsers but now I have broke something. :o) Any ideas are appreciated. The code is like this ... ?php function pagelinks($prev_page, $num_pages, $next_page, $page) { // This displays the Previous link if ($prev_page) { echo a href=\$PHP_SELF?page=$prev_page\lt;nbsp;Prev/anbsp;|nbsp;; } // No need to output the page number if there is only one page if ($num_pages1) { for ($i = 1; $i = $num_pages; $i++) { if ($i != $page) { echo a href=$PHP_SELF?page=$i$i/a; } else { echo $i ; } } } // Display the Next link. if ($page != $num_pages) { echo nbsp;|nbsp;a href=\$PHP_SELF?page=$next_page\nbsp;Nextnbsp;gt;/a ; } } ? This code is at the top of an include file which is included in pics.php. It seems that $PHP_SELF is interpreted differently in *some* instances between the two browsers. I can't figure it out because PHP_SELF is a server side evaluation. The links are output correctly in IE ... http://www.xyz.com/pics.php?page=2 ... but in Netscape I get ... http://www.xyz.com/?page=2 I had this problem once before and inadvertently fixed it with something else that I was doing. Any hints are appreciated. TIA, Bill
RE: [PHP] Page Rendering
This worked ... thanks! But I am confused. It has worked with PHP_SELF in the past. Why would it not evaluate the variable on the server. Or more specifically, why would the page render fine in both Netscape and IE with the links (from PHP_SELF) being the only thing wrong with the page? Just trying to understand. :o) Bill -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 8:56 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Page Rendering On Tuesday 21 January 2003 22:26, Bill Arbuckle, Jr. wrote: This code is at the top of an include file which is included in pics.php. It seems that $PHP_SELF is interpreted differently in *some* instances between the two browsers. I can't figure it out because PHP_SELF is a server side evaluation. The links are output correctly in IE ... http://www.xyz.com/pics.php?page=2 ... but in Netscape I get ... http://www.xyz.com/?page=2 I had this problem once before and inadvertently fixed it with something else that I was doing. Any hints are appreciated. Most likely $PHP_SELF is in fact blank. If you're using a relatively new version of PHP use $_SERVER['PHP_SELF'] instead. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* On the road, ZIPPY is a pinhead without a purpose, but never without a POINT. */ -- 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
[PHP] How Do I Return Values Across Servers
This may be a no-brainer for everyone but me but ... I have several php scripts residing on a web site on Server A. In a library file on Server A are misc. functions, some of which query an underlying database and return a text string as the result. On another web site on Server B I would like to call these functions to get the result without reinventing the wheel so to speak. So my question is ... How can I call a function that returns a text string from Server A in a script requiring that text during the processing of a web page on Server B ... all in php? Thanks in advance. Bill
RE: [PHP] read javascript variable php?????
location.href=?= $destination ? should work ... hth ... Bill -Original Message- From: Ysrael Guzmán [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 4:30 PM To: [EMAIL PROTECTED] Subject: [PHP] read javascript variable php? example: location.href=$destination; or location.href=?php $destination; ; or echo location.href=', $destino, ';; PLEASE GIVE A IDEA Ysrael Guzmán Meza -- 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] How Do I Return Values Across Servers
Yes, I want to get a value from a script on Server A that runs against a database on Server A, returning that value to a script variable on Server B. I read the manual but must have missed something. This is what *seemed* as if it should work: Server A (containing functions and database) qotd.php ?php requireonce('miscfuncs.php'); $qotd= qotd(); ? ** qotd()is a f(x) in miscfuncs.php = Server B test.php ... HTML stuff ?php include 'http://www.servera.com/qotd.php'; echo $qotd . \nbr\n; ? ... More HTML stuff With this setup I get the following error: Warning: Failed opening 'http://www.servera.com/qotd.php' for inclusion (include_path='.;c:\php4\pear') in c:\webdev\kids\homebody.inc on line 27 Any ideas? I know that I am missing something here. Thanks, Bill -Original Message- From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 4:45 PM To: 'Bill Arbuckle, Jr.'; [EMAIL PROTECTED] Subject: RE: [PHP] How Do I Return Values Across Servers If I understand you want to be able to get a value from a script on another server. Well I would suggest a really each way would be to do have the calling server call a script on the supplying server using include(); which is supported but please see this page regarding URL fopen wrappers: http://www.php.net/manual/en/function.include.php Requests for includes and on the supplying server simply output the value like: ?php $answer = 'no'; ? If you do it this way it will be simply included and be available as a variable instantly. (**subject to security issues and speed) Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 8:17 AM To: [EMAIL PROTECTED] Subject: [PHP] How Do I Return Values Across Servers This may be a no-brainer for everyone but me but ... I have several php scripts residing on a web site on Server A. In a library file on Server A are misc. functions, some of which query an underlying database and return a text string as the result. On another web site on Server B I would like to call these functions to get the result without reinventing the wheel so to speak. So my question is ... How can I call a function that returns a text string from Server A in a script requiring that text during the processing of a web page on Server B ... all in php? Thanks in advance. Bill -- 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