|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Thu Nov 21 2002 - 01:28:41 CST
php-general Digest 21 Nov 2002 07:28:41 -0000 Issue 1717
Topics (messages 125303 through 125382):
Newbie: php/mysql (Select)
125303 by: Mr. BuNgL3
125310 by: Mr. BuNgL3
125312 by: Jason Wong
125317 by: DL Neil
125322 by: Van Andel, Robert
125355 by: Ernest E Vogelsinger
Graph Question..
125304 by: James Hatridge
125305 by: Jonathan Sharp
125308 by: Van Andel, Robert
125313 by: Jim Hatridge
125316 by: Andrew Brampton
125351 by: Van Andel, Robert
Re: Pause for user input?
125306 by: . Edwin
125309 by: Larry Brown
125358 by: Jason Sheets
Re: [PHP-DEV] PHP/MySQL memory leak?
125307 by: Steven Roussey
Parsing an array from a posted form
125311 by: Verdon Vaillancourt
125314 by: Nick Eby
125315 by: 1LT John W. Holmes
125318 by: Verdon Vaillancourt
preg_replace question
125319 by: electroteque
125323 by: Chris Shiflett
125325 by: 1LT John W. Holmes
125326 by: electroteque
125332 by: electroteque
125337 by: electroteque
125340 by: electroteque
125341 by: Chris Shiflett
125346 by: 1LT John W. Holmes
Re: How to: If($var != '#' OR '#')
125320 by: electroteque
125324 by: Chris Shiflett
125327 by: 1LT John W. Holmes
125334 by: Ernest E Vogelsinger
Anti Spam software
125321 by: electroteque
125363 by: Alister
Re: scrolling data from db
125328 by: Support . Fourthrealm.com
125350 by: Justin French
125353 by: Justin French
125365 by: Support . Fourthrealm.com
Sectioning a File
125329 by: Stephen
How to unregister a single array item...
125330 by: . Nilaab
125331 by: Nick Eby
125338 by: Nick Eby
Re: interpreting variables containing in another variable
125333 by: Ernest E Vogelsinger
script seen on php.net manual
125335 by: Pedro Furtado
125336 by: Chris Boget
Re: web server and permissions
125339 by: Ernest E Vogelsinger
125345 by: Dennis Gearon
125356 by: Ernest E Vogelsinger
Re: Header Location not working
125342 by: Baumann Reto
125343 by: Baumann Reto
125344 by: Baumann Reto
Session Not Registering on Page it is Set On
125347 by: vernon
125354 by: Kevin Stone
Re: [PHP-QA] Newbie Issue blank result for .php correct displayfor .html version
125348 by: Dane Barber
Re: Stripping HTML tags, but keeping entities...
125349 by: Justin French
Re: copying tables
125352 by: Justin French
A very powful tool
125357 by: internet
Reading part of a file
125359 by: Stephen
125366 by: Stephen
125367 by: Matt
125369 by: Stephen
Re: Help with functions()
125360 by: Tracy Finifter Rotton
125362 by: Jason Sheets
force SQL user/host/password in sql.safe_mode
125361 by: fantomas
how does sql.safe_mode work?
125364 by: fantomas
Animated GIF Help!
125368 by: Heo, Jungsu
Session not Registering
125370 by: Stephen
Variable passing through a form
125371 by: Michael Benbow
125372 by: Peter Houchin
Newbie: nested include and object in session
125373 by: Michael Wai
125374 by: Jonathan Sharp
Add On: Variable passing through a form
125375 by: Michael Benbow
Passing Variables from one php doc to another
125376 by: Rodrigo de Oliveira Costa
125381 by: Jason Wong
MY CLIENT
125377 by: GEORGE EMEKA
125378 by: Troy May
125382 by: John Taylor-Johnston
Re: Opening a file to manipulate it
125379 by: Troy May
125380 by: Tarsy
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi...
I'm with a little sintax problem...
The question is that i have two search fields (titulotxt and cdstxt) and i
want to create an mysql condition... i trying:
$sql1=($titulotxt) ? "titulo like '%".$titulotxt."%'":"";
$sql2=($cdstxt) ? "cds like '$cdstxt'":"";
$sql="SELECT * FROM divx WHERE" .$sql1 " && " .$sql2 " ORDER BY titulo";
but the bastard is giving me a sintax error on the 3 line... Can anyone
teach me how i must do to validate the mysql condition and make it work?
Thanks
attached mail follows:
Hi...
I'm with a little sintax problem...
The question is that i have two search fields (titulotxt and cdstxt) and i
want to create an mysql condition... i trying:
$sql1=($titulotxt) ? "titulo like '%".$titulotxt."%'":"";
$sql2=($cdstxt) ? "cds like '$cdstxt'":"";
$sql="SELECT * FROM divx WHERE" .$sql1 " && " .$sql2 " ORDER BY titulo";
but he's giving me a sintax error on the 3 line... Can anyone
teach me how i must do to validate the mysql condition and make it work?
Thanks
attached mail follows:
On Thursday 21 November 2002 03:53, Mr. BuNgL3 wrote:
> Hi...
> I'm with a little sintax problem...
> The question is that i have two search fields (titulotxt and cdstxt) and i
> want to create an mysql condition... i trying:
>
> $sql1=($titulotxt) ? "titulo like '%".$titulotxt."%'":"";
> $sql2=($cdstxt) ? "cds like '$cdstxt'":"";
> $sql="SELECT * FROM divx WHERE" .$sql1 " && " .$sql2 " ORDER BY titulo";
>
> but he's giving me a sintax error on the 3 line... Can anyone
> teach me how i must do to validate the mysql condition and make it work?
Try:
$sql="SELECT * FROM divx WHERE" .$sql1. " && " .$sql2. " ORDER BY titulo";
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* He thinks by infection, catching an opinion like a cold. */
attached mail follows:
> On Thursday 21 November 2002 03:53, Mr. BuNgL3 wrote: > > Hi... > > I'm with a little sintax problem... > > The question is that i have two search fields (titulotxt and cdstxt) and i > > want to create an mysql condition... i trying: > > > > $sql1=($titulotxt) ? "titulo like '%".$titulotxt."%'":""; > > $sql2=($cdstxt) ? "cds like '$cdstxt'":""; > > $sql="SELECT * FROM divx WHERE" .$sql1 " && " .$sql2 " ORDER BY titulo"; > > > > but he's giving me a sintax error on the 3 line... Can anyone > > teach me how i must do to validate the mysql condition and make it work? > > Try: > > $sql="SELECT * FROM divx WHERE" .$sql1. " && " .$sql2. " ORDER BY titulo";
and add a space after the WHERE.
Also consider the positioning of the single quotes (') and double-quotes (") in the $sql1 assignment statement - they must be nested.
Finally, consider echoing sql1, $sql2, and $sql to be able to see with your own eyes! =dn
attached mail follows:
$sql1 = "titulo like '%$titulotxt%'" $sql2 = "cd like '$cdstxt'"; $sql = "SELECT * FROM divx WHERE $sql1 AND $sql2 ORDER BY titulo";
I think you are getting the error because of the ($titulotxt) ? portion of your sql statements. You really only need the two statements listed above and then put into your actual sql statement.
Robbert van Andel
-----Original Message-----
From: Mr. BuNgL3 [mailto:mrbungle
netcabo.pt]
Sent: Wednesday, November 20, 2002 11:54 AM
To: php-general
lists.php.net
Subject: [PHP] Newbie: PHP/MySQL (SELECT)
Hi... I'm with a little sintax problem... The question is that i have two search fields (titulotxt and cdstxt) and i want to create an mysql condition... i trying:
$sql1=($titulotxt) ? "titulo like '%".$titulotxt."%'":""; $sql2=($cdstxt) ? "cds like '$cdstxt'":""; $sql="SELECT * FROM divx WHERE" .$sql1 " && " .$sql2 " ORDER BY titulo";
but he's giving me a sintax error on the 3 line... Can anyone teach me how i must do to validate the mysql condition and make it work? Thanks
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php"The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers."
attached mail follows:
At 20:23 20.11.2002, Mr. BuNgL3 said: --------------------[snip]-------------------- >Hi... >I'm with a little sintax problem... >The question is that i have two search fields (titulotxt and cdstxt) and i >want to create an mysql condition... i trying: > > $sql1=($titulotxt) ? "titulo like '%".$titulotxt."%'":""; > $sql2=($cdstxt) ? "cds like '$cdstxt'":""; > $sql="SELECT * FROM divx WHERE" .$sql1 " && " .$sql2 " ORDER BY titulo"; > >but the bastard is giving me a sintax error on the 3 line... Can anyone >teach me how i must do to validate the mysql condition and make it work? --------------------[snip]--------------------
As already said, put a space after the WHERE clause.
What happens if $sql1 or $sql2 are empty (as your example provisons)? Create an $sql3 that combines $sql1 and $sql2, and construct your SQL accordingly:
$sql1 = ($titulotxt ? null : "titulo like '%$titulotxt%'"); $sql2 = ($cdstxt ? null : "cds like '$cdstxt'"); $sql3 = $sql1 . ($sql1 && $sql2 ? ' AND ' : null) . $sql2; $sql = 'SELECT * FROM divx ' . ($sql3 ? "WHERE $sql3 " : null) . 'ORDER BY titulo';
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Hi all,,
I d/l'ed a class for graphs last night. When I got the class working instead of a line graph I got the netscape symbol for no picture, ie a broken box. I must have missed something. Could someone give me a clue what I'm doing wrong?
Thanks
JIM
--
Jim Hatridge
Linux User #88484
------------------------------------------------------
BayerWulf
Linux System # 129656
The Recycled Beowulf Project
Looking for throw-away or obsolete computers and parts
to recycle into a Linux super computer
attached mail follows:
Please post code.
-js
James Hatridge wrote: > Hi all,, > > I d/l'ed a class for graphs last night. When I got the class working instead > of a line graph I got the netscape symbol for no picture, ie a broken box. I > must have missed something. Could someone give me a clue what I'm doing > wrong? > > Thanks > > JIM
attached mail follows:
More information would be helpful. Perhaps the code to the page that is causing you trouble (i.e. the one where you are using the class you downloaded yesterday). Perhaps you are missing a key piece there.
Robbert van Andel
-----Original Message-----
From: James Hatridge [mailto:James.Hatridge
epost.de]
Sent: Wednesday, November 20, 2002 7:07 AM
To: PHP-GEN
Subject: [PHP] Graph Question..
Hi all,,
I d/l'ed a class for graphs last night. When I got the class working instead
of a line graph I got the netscape symbol for no picture, ie a broken box. I
must have missed something. Could someone give me a clue what I'm doing wrong?
Thanks
JIM
--
Jim Hatridge
Linux User #88484
------------------------------------------------------
BayerWulf
Linux System # 129656
The Recycled Beowulf Project
Looking for throw-away or obsolete computers and parts
to recycle into a Linux super computer
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
"The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers."
attached mail follows:
On Wednesday 20 November 2002 20:37, Van Andel, Robert wrote: > More information would be helpful. Perhaps the code to the page that is > causing you trouble (i.e. the one where you are using the class you > downloaded yesterday). Perhaps you are missing a key piece there. > > Robbert van Andel
HI Robbert et al..
Below is part of the code. I don't think I should send it all to the list, it's quite large. Looking at all this I think that I'm missing a lib for graphs. But I can't find anything on my SuSE 8.1 disks. What libs do I need for doing graphs?
Thanks
JIM
>
> -----Original Message-----
> From: James Hatridge [mailto:James.Hatridge
epost.de]
> Sent: Wednesday, November 20, 2002 7:07 AM
> To: PHP-GEN
> Subject: [PHP] Graph Question..
>
>
>
> Hi all,,
>
> I d/l'ed a class for graphs last night. When I got the class working
> instead
>
> of a line graph I got the netscape symbol for no picture, ie a broken box.
> I
>
> must have missed something. Could someone give me a clue what I'm doing
> wrong?
>
> Thanks
>
> JIM
#############
<? require "Color.php"; require "Graph.php"; require "Barchart.php";
$white = new Color(255,255,255); $blue = new Color(0,0,255); $red = new Color(255,0,0); $green = new Color(0,255,0);
$line = new Barchart(500,500,$white);
$ar1 = array(12,13,16,2,5,10,0,1,2,8); $ar2 = array(20,13,-1,2,23,11,1,3,4,9); $ar3 = array(11,15,20,12,6,-10,28,30,10,0);
$line->addArray($ar1, $white); $line->addArray($ar2, $green); $line->addArray($ar3, $red); $line->printHTML();
?>
##########
--
Vielfeind -- Viel Ehr'
Antiamerikanische Propaganda in der Philatelie des 20. Jahrhunderts
http:/www.fecundswamp.net/~hatridge/stamps/index.html
attached mail follows:
Try going direct to the image's URL, this might show any PHP errors. If that doesn't work, you can request the page via telnet and see if any errors are appearing
Andrew
----- Original Message -----
From: "James Hatridge" <James.Hatridge
epost.de>
To: "PHP-GEN" <php-general
lists.php.net>
Sent: Wednesday, November 20, 2002 3:06 PM
Subject: [PHP] Graph Question..
Hi all,,
I d/l'ed a class for graphs last night. When I got the class working instead of a line graph I got the netscape symbol for no picture, ie a broken box. I must have missed something. Could someone give me a clue what I'm doing wrong?
Thanks
JIM
--
Jim Hatridge
Linux User #88484
------------------------------------------------------
BayerWulf
Linux System # 129656
The Recycled Beowulf Project
Looking for throw-away or obsolete computers and parts
to recycle into a Linux super computer
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
What I'm wondering is if you are calling the graphic's placing into the page correctly. I believe the class will probably work.
I have a page that includes a graph that I generate using mySQL and PHP. This is the code I use to actually display the graphic (not what generates it).
ImageJPEG($pic,$graphname);
echo "<p align=\"center\"><image src=\"$graphname\"></p>\n";
Of course there is a significant amount of code that actually generates $pic, but this is what I had to do to make the graphic appear.
Robbert van Andel
-----Original Message-----
From: Jim Hatridge [mailto:hatridge
fecundswamp.net]
Sent: Wednesday, November 20, 2002 12:03 PM
To: PHP-GEN
Subject: Re: [PHP] Graph Question..
On Wednesday 20 November 2002 20:37, Van Andel, Robert wrote: > More information would be helpful. Perhaps the code to the page that is > causing you trouble (i.e. the one where you are using the class you > downloaded yesterday). Perhaps you are missing a key piece there. > > Robbert van Andel
HI Robbert et al..
Below is part of the code. I don't think I should send it all to the list, it's quite large. Looking at all this I think that I'm missing a lib for graphs. But I can't find anything on my SuSE 8.1 disks. What libs do I need for doing graphs?
Thanks
JIM
>
> -----Original Message-----
> From: James Hatridge [mailto:James.Hatridge
epost.de]
> Sent: Wednesday, November 20, 2002 7:07 AM
> To: PHP-GEN
> Subject: [PHP] Graph Question..
>
>
>
> Hi all,,
>
> I d/l'ed a class for graphs last night. When I got the class working
> instead
>
> of a line graph I got the netscape symbol for no picture, ie a broken box.
> I
>
> must have missed something. Could someone give me a clue what I'm doing
> wrong?
>
> Thanks
>
> JIM
#############
<? require "Color.php"; require "Graph.php"; require "Barchart.php";
$white = new Color(255,255,255); $blue = new Color(0,0,255); $red = new Color(255,0,0); $green = new Color(0,255,0);
$line = new Barchart(500,500,$white);
$ar1 = array(12,13,16,2,5,10,0,1,2,8); $ar2 = array(20,13,-1,2,23,11,1,3,4,9); $ar3 = array(11,15,20,12,6,-10,28,30,10,0);
$line->addArray($ar1, $white); $line->addArray($ar2, $green); $line->addArray($ar3, $red); $line->printHTML();
?>
##########
--
Vielfeind -- Viel Ehr'
Antiamerikanische Propaganda in der Philatelie des 20. Jahrhunderts
http:/www.fecundswamp.net/~hatridge/stamps/index.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
"The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers."
attached mail follows:
"Larry Brown" <larry.brown
dimensionnetworks.com> wrote:
> The idea is to have the script start to load, prompt for a question or more, > then use the data from the response to complete loading the page and avoid > having to post all of the variables from page to page to get all of the > responses back. A lot of the questions are formed based on the answers to > previous questions so I'm trying to keep the number of separate pages to a > minimum by using such a technique. I understand that Java can provide this > function, but I want to do as much with PHP and as little as possible with > Java.
I think you're referring to JavaScript and NOT Java.
But, whether it's Java or Javascript, you cannot really pause/stop the browser then do something to "complete loading the page." (Unless you press "stop"--but this would require you to reload.)
Anyway, Javascript (if you're referring to it) doesn't have that kind of function (AFAIK). Javascript can hide/unhide element on your form. It can also enable/disable a checkbox, for example. But those functions would only work AFTER the page is already loaded--and _not_ while it is loading. (Also, *after* the Javascript file--if you're using and external one--is already downloaded inside the your visitors' disk, etc.)
- E
PS BTW, Javascript (support) can be turned off by your visitors--maybe you already know that...
And... not all browsers supports Java. (But then again, you don't even need a browser to run Java! What am I saying here?...)
attached mail follows:
I understand that the Javascript will not pause the page from loading; however, it should, like you stated, modify the page and hence change what the client is seeing interactively which could include hiding/revealing different questions based on their input. This should ultimately present a form with answers to those customized questions without traversing a number of pages. I only asked the question hoping there was a method of accomplishing this that I wasn't aware of in PHP. It is understandable that it would not be possible server-side, but I figured I would check with the gurus.
Thanks,
Larry S. Brown Dimension Networks, Inc. (727) 723-8388
-----Original Message-----
From:
Edwin [mailto:copperwalls
hotmail.com]
Sent: Wednesday, November 20, 2002 2:39 PM
To: Larry Brown
Cc: php-general
lists.php.net
Subject: Re: [PHP] Pause for user input?
"Larry Brown" <larry.brown
dimensionnetworks.com> wrote:
> The idea is to have the script start to load, prompt for a question or more, > then use the data from the response to complete loading the page and avoid > having to post all of the variables from page to page to get all of the > responses back. A lot of the questions are formed based on the answers to > previous questions so I'm trying to keep the number of separate pages to a > minimum by using such a technique. I understand that Java can provide this > function, but I want to do as much with PHP and as little as possible with > Java.
I think you're referring to JavaScript and NOT Java.
But, whether it's Java or Javascript, you cannot really pause/stop the browser then do something to "complete loading the page." (Unless you press "stop"--but this would require you to reload.)
Anyway, Javascript (if you're referring to it) doesn't have that kind of function (AFAIK). Javascript can hide/unhide element on your form. It can also enable/disable a checkbox, for example. But those functions would only work AFTER the page is already loaded--and _not_ while it is loading. (Also, *after* the Javascript file--if you're using and external one--is already downloaded inside the your visitors' disk, etc.)
- E
PS BTW, Javascript (support) can be turned off by your visitors--maybe you already know that...
And... not all browsers supports Java. (But then again, you don't even need a browser to run Java! What am I saying here?...)
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
In CLI you can use readline
See the readline section in the PHP manual at http://www.php.net/manual/en
Jason
On Wed, 2002-11-20 at 06:42, Larry Brown wrote: > Does anyone know of a method to pause during the processing of a script to > prompt a user for information and then incorporate the user's response for > the remainder of the script? > > Larry S. Brown > Dimension Networks, Inc. > (727) 723-8388 > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
If you can, use PHP 4.0.6 for server processing like that. It is the last version that worked in our experience. A script using 4.0.6 can run for months for us. Anything newer will die after a few hours/days. Not sure where the problem is. May not be MySQL extension. Could be anywhere.
Unless you are using persistent connections and unbuffered queries, then there is a memory leak in the MySQL extension.
-steve-
attached mail follows:
Hi All :)
I have a form that is being passed to a mail function when submitted. It is working OK, except that I am having trouble with values from arrays such as checkbox lists. For example, I have a list such as:
<input type="checkbox" name="graphicFormat[]" value="eps" /> .eps <input type="checkbox" name="graphicFormat[]" value="jpg" /> .jpg <input type="checkbox" name="graphicFormat[]" value="tif" /> .tif <input type="checkbox" name="graphicFormat[]" value="gif" /> .gif <input type="checkbox" name="graphicFormat[]" value="png" /> .png <input type="checkbox" name="graphicFormat[]" value="psd" /> .psd <input type="checkbox" name="graphicFormat[]" value="bmp" /> .bmp <input type="checkbox" name="graphicFormat[]" value="other" /> other
I am using something like:
for ($z=0;$z<count($graphicFormat);$z++) { $graphicFormat = stripslashes($graphicFormat[$z]); }
Which will return a count of the number of items in the array. What I want returned is a string of the values selected such as:
"eps, gif, other"
Any suggestions?
Best Regards, verdon
Ps. Please cc me as I am on digest mode Pps. Please excuse if my question is TOO fundamental
attached mail follows:
you can use the implode() function:
for ($z=0;$z<count($graphicFormat);$z++) { $graphicFormat = stripslashes($graphicFormat[$z]); }
echo implode(", ", $graphicFormat);
"Verdon Vaillancourt" <vern
verdon.ca> wrote in message
news:BA015328.52E8%vern
verdon.ca...
> Hi All :)
>
> I have a form that is being passed to a mail function when submitted. It
is
> working OK, except that I am having trouble with values from arrays such
as
> checkbox lists. For example, I have a list such as:
>
> <input type="checkbox" name="graphicFormat[]" value="eps" /> .eps
> <input type="checkbox" name="graphicFormat[]" value="jpg" /> .jpg
> <input type="checkbox" name="graphicFormat[]" value="tif" /> .tif
> <input type="checkbox" name="graphicFormat[]" value="gif" /> .gif
> <input type="checkbox" name="graphicFormat[]" value="png" /> .png
> <input type="checkbox" name="graphicFormat[]" value="psd" /> .psd
> <input type="checkbox" name="graphicFormat[]" value="bmp" /> .bmp
> <input type="checkbox" name="graphicFormat[]" value="other" /> other
>
> I am using something like:
>
> for ($z=0;$z<count($graphicFormat);$z++) {
> $graphicFormat = stripslashes($graphicFormat[$z]);
> }
>
> Which will return a count of the number of items in the array. What I want
> returned is a string of the values selected such as:
>
> "eps, gif, other"
>
> Any suggestions?
>
> Best Regards,
> verdon
>
> Ps. Please cc me as I am on digest mode
> Pps. Please excuse if my question is TOO fundamental
>
attached mail follows:
> I have a form that is being passed to a mail function when submitted. It is > working OK, except that I am having trouble with values from arrays such as > checkbox lists. For example, I have a list such as: > > <input type="checkbox" name="graphicFormat[]" value="eps" /> .eps > <input type="checkbox" name="graphicFormat[]" value="jpg" /> .jpg > <input type="checkbox" name="graphicFormat[]" value="tif" /> .tif > <input type="checkbox" name="graphicFormat[]" value="gif" /> .gif > <input type="checkbox" name="graphicFormat[]" value="png" /> .png > <input type="checkbox" name="graphicFormat[]" value="psd" /> .psd > <input type="checkbox" name="graphicFormat[]" value="bmp" /> .bmp > <input type="checkbox" name="graphicFormat[]" value="other" /> other > > I am using something like: > > for ($z=0;$z<count($graphicFormat);$z++) { > $graphicFormat = stripslashes($graphicFormat[$z]); > } > > Which will return a count of the number of items in the array. What I want > returned is a string of the values selected such as: > > "eps, gif, other"
$string = implode(",",$graphicFormat);
To see how many checkboxes were selected, use
$num = count($graphicFormat);
---John Holmes...
attached mail follows:
A sincere thanks to John for the prompt and succinct answer. I've seen many answers from John on this list and am much appreciative of his generosity.
Best regards, verdon :)
On 11/20/02 3:07 PM, "1LT John W. Holmes" <holmes072000
charter.net> wrote:
>> I have a form that is... ... >> Which will return a count of the number of items in the array. What I want >> returned is a string of the values selected such as: >> >> "eps, gif, other" > > $string = implode(",",$graphicFormat); > > To see how many checkboxes were selected, use > > $num = count($graphicFormat); > > ---John Holmes... > >
attached mail follows:
how could i remove http://www. ot of a url string sing preg_replace ?
attached mail follows:
--- electroteque <daniel
electroteque.org> wrote:
> how could i remove http://www. ot of a url string using
preg_replace?
No need to reinvent the wheel for this. Just use parse_url() instead:
http://www.php.net/manual/en/function.parse-url.php
Chris
attached mail follows:
> --- electroteque <daniel
electroteque.org> wrote:
> > how could i remove http://www. ot of a url string using
> preg_replace?
>
> No need to reinvent the wheel for this. Just use parse_url() instead:
>
> http://www.php.net/manual/en/function.parse-url.php
>
Or just str_replace(). No need for regular expressions.
http://www.php.net/manual/en/function.str-replace.php
---John Holmes...
attached mail follows:
looks like it returns www in the host array a bit silly when i need just the bits afterwards to do a gethostbyname
-----Original Message-----
From: Chris Shiflett [mailto:shiflett
php.net]
Sent: Thursday, November 21, 2002 7:41 AM
To: electroteque; php-general
lists.php.net
Subject: Re: [PHP] preg_replace question
--- electroteque <daniel
electroteque.org> wrote:
> how could i remove http://www. ot of a url string using
preg_replace?
No need to reinvent the wheel for this. Just use parse_url() instead:
http://www.php.net/manual/en/function.parse-url.php
Chris
attached mail follows:
thats the thing the urls should be able to parse http:// or www or both and i have to unfortunatly clean up a forced port and directory in the url aswell for gethostname to work
-----Original Message-----
From: 1LT John W. Holmes [mailto:holmes072000
charter.net]
Sent: Thursday, November 21, 2002 7:48 AM
To: shiflett
php.net; electroteque; php-general
lists.php.net
Subject: Re: [PHP] preg_replace question
> --- electroteque <daniel
electroteque.org> wrote:
> > how could i remove http://www. ot of a url string using
> preg_replace?
>
> No need to reinvent the wheel for this. Just use parse_url() instead:
>
> http://www.php.net/manual/en/function.parse-url.php
>
Or just str_replace(). No need for regular expressions.
http://www.php.net/manual/en/function.str-replace.php
---John Holmes...
attached mail follows:
this is fine but it didnt parse in just www.domain.com
-----Original Message-----
From: Chris Shiflett [mailto:shiflett
php.net]
Sent: Thursday, November 21, 2002 7:41 AM
To: electroteque; php-general
lists.php.net
Subject: Re: [PHP] preg_replace question
--- electroteque <daniel
electroteque.org> wrote:
> how could i remove http://www. ot of a url string using
preg_replace?
No need to reinvent the wheel for this. Just use parse_url() instead:
http://www.php.net/manual/en/function.parse-url.php
Chris
attached mail follows:
getting really annoying one url will work where another one wont
//$formatted_url = preg_replace("/\b((http(s?):\/\/)|(www\.))\b/i", "", $url); //$formatted_url = preg_replace("/\b((http(s?):\/\/)|(www\.))([\w\.]+)([\/\w+\.]+)\b/i", "$5", $url); $formatted_url = eregi_replace("^(.{2,6}://)?([^:]*)?([^/]*)?(.*)", "\\2", $url);
tried all these dont work
some urls will have http://www. some will only have www. some will have :1023 for forced ports and they all will have /directory afterwards i just need domain.com for example :|
-----Original Message-----
From: 1LT John W. Holmes [mailto:holmes072000
charter.net]
Sent: Thursday, November 21, 2002 7:48 AM
To: shiflett
php.net; electroteque; php-general
lists.php.net
Subject: Re: [PHP] preg_replace question
> --- electroteque <daniel
electroteque.org> wrote:
> > how could i remove http://www. ot of a url string using
> preg_replace?
>
> No need to reinvent the wheel for this. Just use parse_url() instead:
>
> http://www.php.net/manual/en/function.parse-url.php
>
Or just str_replace(). No need for regular expressions.
http://www.php.net/manual/en/function.str-replace.php
---John Holmes...
attached mail follows:
--- Dan Rossi <daniel
electroteque.org> wrote:
> some urls will have http://www. some will only have www. some will
> have :1023 for forced ports and they all will have /directory
> afterwards i just need domain.com for example :|
Out of curiosity, did you not read the replies to your initial question? I recall saying this:
> Just use parse_url() instead: > > http://www.php.net/manual/en/function.parse-url.php
I recall seeing John Holmes say this:
> Or just str_replace(). No need for regular expressions. > > http://www.php.net/manual/en/function.str-replace.php
Chris
attached mail follows:
> thats the thing the urls should be able to parse http:// or www or both and > i have to unfortunatly clean up a forced port and directory in the url > aswell for gethostname to work
Well, your original question should of said that and we wouldn't be wasting time.
preg_match("%\.([^.]+\.[a-z]+)%",$host,$match)
$match[1] would have your name.
---John Holmes...
attached mail follows:
add to that i'd do this
if ($_GET['sc'] !== '2' || $_GET['sc'] !== 8) {
for me single equals seem to assign the variable with the value double equals seem to check the variable for the value
"Jonathan Wright" <mail
djnauk.co.uk> wrote in message
news:20021120184141.GA12806
chef...
> Hiya,
>
> On Wed, Nov 20, 2002 at 11:24:11AM -0600, Jami wrote:
> > I have code that says:
> >
> > if($_GET['sc'] != '2' OR '8'){
> > do this.....
> > }
> >
> > but I doesn't work. What do I need to do to get it to work? I have
checked
> > operator precendence and all that and am still confused on whether I
should
> > be using '||' or 'OR' or something else... I have tried both of those,
as
> > well as 'XOR' and '^'. Help please!
>
> It won't work 'cause you're asking two different questions:
>
> 1. if $_GET['sc'] != 2, and
> 2. 8
>
> Operators can only work on two operands, i.e. one either side, so you if
> you want to ask any more questions, like above, you have to split them
> each into their own question:
>
> if ($_GET['sc'] != '2' || $_GET['sc'] != 8) {
>
> It also works the same when looking for a range like '2 < $x < 6', it has
> to be two questions - '2 < $x && $x < 6'.
>
> Hope that helps! :)
>
> --
> Jonathan Wright..
> // mail
djnauk.co.uk
> // www.djnauk.co.uk
> --
> // life has no meaning unless we can enjoy what we've been given
attached mail follows:
--- electroteque <daniel
electroteque.org> wrote:
> if ($_GET['sc'] !== '2' || $_GET['sc'] !== 8) {
>
> for me single equals seem to assign the variable with the value
> double equals seem to check the variable for the value
A "single equals" is "=" not "!=". Otherwise, you would be correct.
Chris
attached mail follows:
> --- electroteque <daniel
electroteque.org> wrote:
> > if ($_GET['sc'] !== '2' || $_GET['sc'] !== 8) {
> >
> > for me single equals seem to assign the variable with the value
> > double equals seem to check the variable for the value
From the, imagine this, Manual:
$a != $b Not equal TRUE if $a is not equal to $b.
$a !== $b Not identical TRUE if $a is not equal to $b, or they are not of the same type. (PHP 4 only)
---John Holmes...
attached mail follows:
At 18:24 20.11.2002, Jami said: --------------------[snip]-------------------- >I have code that says: > >if($_GET['sc'] != '2' OR '8'){ > do this..... >} --------------------[snip]--------------------
besides all other good examples, you could also if (in_array($_GET['sc'], array('2','8'))) { do this..... }
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
anyone know of any good anti spam software for linux ?? and maybe be able to monitor it with php ?
attached mail follows:
On Thu, 21 Nov 2002 07:26:34 +1100
"electroteque" <daniel
electroteque.org> wrote:
> anyone know of any good anti spam software for linux ?? and maybe be > able to monitor it with php ?
SpamAsassin. You could probably set the spam to be fed to a PHP script as well, but I just throw it all to a text file, or filter it (or not) in the email program.
Alister
attached mail follows:
Hi Eddie, iFrames do offer a really nice solution, but they are an IE only tag. Although I can't vouch for the latest Netscape, I know that the older versions simply ignore the <iFRAME...> tag, and leave a blank spot in its place.
If you know that your client base will ever only use IE, then go for it. Otherwise, you'll have to avoid the iframe.
Peter
At 03:17 PM 11/20/2002 -0500, Edward Peloke wrote:
>Thanks Peter!
>
>I will take a look. As I am new to javascript, why would someone use
>javascript when iframes are easier? Will I be able to use the javascript on
>more browsers? Are the iframes limited?
>
>Thanks,
>Eddie
>
>-----Original Message-----
>From: Support
Fourthrealm.com [mailto:support
fourthrealm.com]
>Sent: Wednesday, November 20, 2002 11:23 AM
>To: Edward Peloke; php-general
lists.php.net
>Subject: Re: [PHP] scrolling data from db
>
>
>Eddie,
>I use the attached on a site of mine... works with JavaScript and <DIV>
>tags.
>
>There are 2 parts to the file - the javascript, and then the HTML code to
>make it happen. Tweak according to your needs.
>
>Peter
>
>
>At 11:00 AM 11/20/2002 -0500, you wrote:
> >I have a large amount of data to present to the user. Currently, I am just
> >putting it in a table and displaying it on the page, if it is more than a
> >page of course the page just scrolls. Is there a way o, without using
> >frames, to put all the data from the db in the middle of the page with a
> >scroll bar on the side that just scrolls the data, I mean the header and
> >footer of the php page do not move? I am sure I will need javascript for
> >this...right?
> >
> >Thanks,
> >Eddie
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>- - - - - - - - - - - - - - - - - - - - -
>Fourth Realm Solutions
>pbechard
fourthrealm.com
>http://www.fourthrealm.com
>Tel: 519-739-1652
>- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
pbechard
fourthrealm.com
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -
attached mail follows:
Hi,
on 21/11/02 3:00 AM, Edward Peloke (epeloke
echoman.com) wrote:
> I have a large amount of data to present to the user. Currently, I am just > putting it in a table and displaying it on the page, if it is more than a > page of course the page just scrolls. Is there a way o, without using > frames, to put all the data from the db in the middle of the page with a > scroll bar on the side that just scrolls the data, I mean the header and > footer of the php page do not move? I am sure I will need javascript for > this...right?
This is certainly not PHP... a combination of javascript + css + a whole lot of testing on browsers + an understanding that it will break some browsers might do it. <iframe>s will do it, <frame>s will too.
Justin French -------------------- http://Indent.com.au Web Developent & Graphic Design --------------------
attached mail follows:
on 21/11/02 7:56 AM, Support
Fourthrealm.com (support
fourthrealm.com)
wrote:
> Hi Eddie, > iFrames do offer a really nice solution, but they are an IE only > tag.
they are part of the HTML spec... so, conforming browsers (NN6, NN7, Opera I think, etc) all have iframe support. The real problem is NN < 6 (of which there are still plenty out there) and the lesser know and non-visual browsers.
> Although I can't vouch for the latest Netscape, I know that the older > versions simply ignore the <iFRAME...> tag, and leave a blank spot in its > place. > > If you know that your client base will ever only use IE, then go for > it. Otherwise, you'll have to avoid the iframe.
That sounds a little harsh!
You can put a message in place of the iframe, for those who don't support it.
<iframe src="" blah blah> Sorry, your browser does not support iframes, to view the content of this frame, <a href="">click here</a>. </iframe>
Or better still, you can actually PUT SOME CONTENT IN THERE.
I have an iframe which lists multiple tour dates for a band, sorted in date order... if the iframe can be used, the user gets ALL upcomming gigs ina scroller, otherwise they just get the next 3 (using approximately the same amount of space), with a link to view all gigs.
iframes CAN work in many cases, if you think about it.
Justin
attached mail follows:
Justin, Creative thinking to a smart solution. I will keep that in mind for future sites.
Peter
At 10:35 AM 11/21/2002 +1100, Justin French wrote: > > If you know that your client base will ever only use IE, then go for > > it. Otherwise, you'll have to avoid the iframe. > >That sounds a little harsh! > >You can put a message in place of the iframe, for those who don't support >it. > ><iframe src="" blah blah> >Sorry, your browser does not support iframes, to view the content of this >frame, <a href="">click here</a>. ></iframe> > >Or better still, you can actually PUT SOME CONTENT IN THERE. > >I have an iframe which lists multiple tour dates for a band, sorted in date >order... if the iframe can be used, the user gets ALL upcomming gigs ina >scroller, otherwise they just get the next 3 (using approximately the same >amount of space), with a link to view all gigs. > > >iframes CAN work in many cases, if you think about it.
- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
pbechard
fourthrealm.com
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -
attached mail follows:
I'm making a module system. I need to make the actual module then a form to go along with it. The only way I can think of doing this is makign a file and then sectioning the file so that the first part is read and put somewhere on a page them the other part is put on the same page later on or on a different page. How can this be done without reading a certain amount of characters? The actual module part won't all be the same length so...how can this be done?
Thanks, Stephen Craton http://www.melchior.us
"Life is a gift from God. Wasting it is like destroying a gift you got from the person you love most." -- http://www.melchior.us
attached mail follows:
Hello, How do I unregister a single array item from an array? For example:
session_start() session_register("item");
$item['name'] = "Some Name"; $item['img'] = "some_image_name.jpg"; $item['desc'] = "Some Description"; $item['price'] = 400;
// Now I want to get rid of the desc array item. // I tried:
session_unregister("item[desc]");
// But that didn't work. However, I had some luck with:
unset($item['desc']);
// Is there another way? // What is the best way to take this out of the session // of the array that I registered above as $item?
attached mail follows:
"
Nilaab" <superbus22
attbi.com> wrote:
> Hello,
> How do I unregister a single array item from an array? For example:
>
>
> session_start()
> session_register("item");
>
> $item['name'] = "Some Name";
> $item['img'] = "some_image_name.jpg";
> $item['desc'] = "Some Description";
> $item['price'] = 400;
>
--snip--
>
> unset($item['desc']);
>
that will work just fine. think of it this way- the array $item is registered (and maybe unregistered) with the session, but its elements aren't individually registered with the array. just register/unregister the array, and otherwise work with the array by setting and unsetting the elements as you described.
attached mail follows:
"Nick Eby" <nick_eby
bonzidev.com> wrote :
> that will work just fine. think of it this way- the array $item is > registered (and maybe unregistered) with the session, but its elements > aren't individually registered with the ________. just register/unregister the > array, and otherwise work with the array by setting and unsetting the > elements as you described. > >
fill in the blank... should've said "session".
attached mail follows:
At 19:15 20.11.2002, ROBERT MCPEAK said: --------------------[snip]-------------------- >I've got a variable - $email_body, that contain's other variables. For >example, echo "$email_body," might look like this: > >$name, $address, $phone, $blah > > >I want those variables to interpreted with corresponding values set earlier >in the script. So, in effect, where name=bob, address=101 east main, >phone=555-5555, and blah=foo, echo "$email_body" would look like this: > >bob, 101 east main, 555-5555, foo --------------------[snip]--------------------
That's what eval() is for. eval() evaluates syntactically correct PHP code.
What you need to do is
$email_body = str_replace('"', '\"', $email_body);
global $php_error;
$php_error = null;
eval("\$email_body = \"$email_body\";");
if ($php_error) die ($php_error);
Of course all double quotes need to be escaped beforehand, as the example shows. The error handling here is somewhat useless but demonstrates the idea.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Hey, http://www.php.net/manual/en/function.mysql-fetch-array.php
regarding, jb at stormvision dot com dot na's post (below)
i need to output &row0=article__2|aaaa|tipo 1:&row1=art2|bbbbb|Tipo 2
how can i achieve this?
This might be usefull for people that work with lots of rows and want to place them all into one array for later usage. This script just takes care of all the tedious work one would have and puts all neccessary field names into your array automatically. This way you can use this script over and over for all kind of mysql functions. $result=mysql_query("select * from mydata order by 'id'")or die('died'); $num_rows = mysql_num_rows($result); $j=0; $x=1; while($row=mysql_fetch_array($result)){ for($j=0;$j<$num_rows;$j++){ $name = mysql_field_name($result, $j); $object[$x][$name]=$row[$name]; }$x++; }
For Later in the script you may use the below array to gain access to your data
$i=1; $ii=count($object); //quick access function for($i=1;$i<=$ii;$i++){ echo $object[$i]['your_field_name']; }
hope it helps
Kindest Regards, Pedro Furtado www.silkonski.com
attached mail follows:
> i need to output > &row0=article__2|aaaa|tipo 1:&row1=art2|bbbbb|Tipo 2 > how can i achieve this?
I believe you can just use urlencode() and urldecode() on the values.
Chris
attached mail follows:
At 19:49 20.11.2002, Dennis Gearon said: --------------------[snip]-------------------- >Please B/CC me, thank you. > >I am on a site that has all the files in both the /home/sitename/www/ >directory and a directory >we'll call /home/directory/includes/ with the following permisssions: > > rwxr-x--r > >The group I have in /etc/group does not have anyone in it, including me. > >The server reads everything fine and the php engine can include fine from the >/home/sitename/includes/ directory. > >The problem is, everyone else on the site can read the includes directory as >well, including my >database password file which get's included.
You should set the owner and group of the includes directory correctly, additional to the file permissions.
If you want only apache (and PHP) to be able to read from the includes directory, and only you may add/modify, you should (assumed dgearon is your username):
chown dgearon:apache /home/sitename/include/. chown -R dgearon:apache /home/sitename/include/* chmod 750 /home/sitename/include/. chmod -R 640 /home/sitename/include/*
This will make your account the owner of the directory and all files, and the group "apache" the owning group. Only the owner may list and modify the directory and files, and only the owner and the owning group may read the directory and its files. All others are blocked access.
>What I would like to set up is: > > [1] the apache/php engine can include from the > includes directory, but not just spit it out. > I think that is taken care of by the > .htaccess file already.
See my comment above
> [2] the apache/php process is in my group, > and everything I want to go out has > the group permissions set to rwx--r--- > (do php/html/inc files also have to be > executable to be serverd?)
no, they are read by the web server, not executed
> [3] 'everyone' does not have the ability to read > my files on myserver.
set the last permission number to zero (see above). The last number stands for "world" which means all others that are not owner or ownergroup.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Would this prevent other PHP users from including files in my include directory?
11/20/2002 1:45:08 PM, Ernest E Vogelsinger <ernest
vogelsinger.at> wrote:
>At 19:49 20.11.2002, Dennis Gearon said: >--------------------[snip]-------------------- >>Please B/CC me, thank you. >> >>I am on a site that has all the files in both the /home/sitename/www/ >>directory and a directory >>we'll call /home/directory/includes/ with the following permisssions: >> >> rwxr-x--r >> >>The group I have in /etc/group does not have anyone in it, including me. >> >>The server reads everything fine and the php engine can include fine from the >>/home/sitename/includes/ directory. >> >>The problem is, everyone else on the site can read the includes directory as >>well, including my >>database password file which get's included. > >You should set the owner and group of the includes directory correctly, >additional to the file permissions. > >If you want only apache (and PHP) to be able to read from the includes >directory, and only you may add/modify, you should (assumed dgearon is your >username): > > chown dgearon:apache /home/sitename/include/. > chown -R dgearon:apache /home/sitename/include/* > chmod 750 /home/sitename/include/. > chmod -R 640 /home/sitename/include/* > >This will make your account the owner of the directory and all files, and >the group "apache" the owning group. Only the owner may list and modify the >directory and files, and only the owner and the owning group may read the >directory and its files. All others are blocked access. > >>What I would like to set up is: >> >> [1] the apache/php engine can include from the >> includes directory, but not just spit it out. >> I think that is taken care of by the >> .htaccess file already. > >See my comment above > >> [2] the apache/php process is in my group, >> and everything I want to go out has >> the group permissions set to rwx--r--- >> (do php/html/inc files also have to be >> executable to be serverd?) > >no, they are read by the web server, not executed > >> [3] 'everyone' does not have the ability to read >> my files on myserver. > >set the last permission number to zero (see above). The last number stands >for "world" which means all others that are not owner or ownergroup. > > > >-- > >O Ernest E. Vogelsinger > (\) ICQ #13394035 > ^ http://www.vogelsinger.at/ > > >
attached mail follows:
At 23:37 20.11.2002, Dennis Gearon said: --------------------[snip]-------------------- >Would this prevent other PHP users from including files in my include >directory? --------------------[snip]--------------------
No - even if _they_ cannot read your include files, they add the include() directive, and PHP will be able to read the file.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
It's mainly MSIE 5.0 for MacOS or MSIE 5.5 for Win9x
"Bigdog" <bigdog
venticon.com> wrote in message
news:1037745842.11547.13.camel
pclnxrhunter.digitalglobe.com...
> What browsers are having the problems?
>
> On Tue, 2002-11-19 at 15:36, Baumann Reto wrote:
> > Hi all
> >
> > Does somebody know if there is a potential problem with
> > Header("Location: ....");
> > not working properly?
> >
> > I have a redirection, but it seems that on some browser, this doesn't
work.
> > Instead of the redirection, the same page is requested again!
> >
> > I'm also using sessions and html-post request to get to this page
(probably
> > they are messing things up).
> > On most browser, the setup is working very well...
> >
> > Thanks for the help
> > reto
>
>
> --
> .: B i g D o g :.
>
>
attached mail follows:
This does work... No problem at all...
The BIG problem is that it has to have something to do with the environment, as the error is not always there. Only if a certain combination of POST/GET request and or browsers as well as session operations occur.
Bur figuring out a certain logic is nearly impossible. reto
"Chris Shiflett" <shiflett
php.net> wrote in message
news:20021119225253.56533.qmail
web14306.mail.yahoo.com...
> --- Baumann Reto <rbaumi
bluewin.ch> wrote:
> > Does somebody know if there is a potential problem with
> > Header("Location: ....");
> > not working properly?
>
> Try this code:
>
> <?
> header("Location: http://www.google.com/");
> ?>
>
> If this does not work, let us know.
>
> Chris
attached mail follows:
Yes, I have an exit() immediately following header...
Could these statements in any way affect the session? Or session update?
"Jason Wong" <php-general
gremlins.biz> wrote in message
news:200211201312.28669.php-general
gremlins.biz...
> On Wednesday 20 November 2002 06:36, Baumann Reto wrote:
> > Hi all
> >
> > Does somebody know if there is a potential problem with
> > Header("Location: ....");
> > not working properly?
> >
> > I have a redirection, but it seems that on some browser, this doesn't
work.
> > Instead of the redirection, the same page is requested again!
>
> Do you have exit() after using header()? You should.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> U X
> e dUdX, e dX, cosine, secant, tangent, sine, 3.14159...
> */
>
attached mail follows:
These pup session are going to drive me nuts!
I can't seem to get this session to register on the same page it is set. For instance I load a record, then set a session right after it using:
session_register("suckered"); $suckered = $row_rouser['ID'];
The session is set throughout the site, but not on the page I set it on. What am I doing wrong?
Thanks
attached mail follows:
What exactly are you doing? The code you posted doesn't explain much. -Kevin
----- Original Message -----
From: "vernon" <vernon
comp-wiz.com>
To: <php-general
lists.php.net>
Sent: Wednesday, November 20, 2002 4:13 PM
Subject: [PHP] Session Not Registering on Page it is Set On
> These pup session are going to drive me nuts! > > I can't seem to get this session to register on the same page it is set. For > instance I load a record, then set a session right after it using: > > session_register("suckered"); > $suckered = $row_rouser['ID']; > > The session is set throughout the site, but not on the page I set it on. > What am I doing wrong? > > Thanks > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Thank you :)
>From: Ray Hunter <bigdog
venticon.com>
>Reply-To: php-general
lists.php.net
>To: "Easystreet.com" <sirsoulhunter
hotmail.com>
>CC: php-qa
lists.php.net
>Subject: Re: [PHP-QA] Newbie Issue blank result for .php correct displayfor
>.html version
>Date: 19 Nov 2002 18:18:47 -0700
>
>This is really not the list for these types of questions...
>
>I put this on the php-general list where you will get faster response.
>
>list: php-general
lists.php.net
>
>On Fri, 2002-11-15 at 17:08, Easystreet.com wrote:
> > I'm going through a tutorial and results are when the file extension is
>.php
> > it returns a blank display in IE 6 when the file extension is .html I
>get
> > the correct display. This is on a Win2K system with IIS disabled,
> > Apache/1.3.27 (Win32) PHP/4.2.3
> >
> > The following added to httpd.conf at the end of the file
> >
> > LoadModule php4_module c:/php/sapi/php4apache.dll
> > AddModule mod_php4.c
> > AddType application/x-httpd-php .php
> >
> > Other .php tests I have been working on which start out with <? work
>with no
> > difficulty
> > as a .php it displays an empty browser with no errors, if I change the
> > extension to .html it displays as I think it should. Any ideas?
> >
> > and here is the start of what I have:
> >
> > <html>
> > <head>
> > <title>Guestbook</title>
> > </head>
> > <body>
> > <center>
> > <form action="<?php echo $_SERVER[PHP_SELF]; ?>" method="POST">
> > <font face="arial" size="1">
> > Name: <input type="text" name="txt_name">
> > Email: <input type="text" name="txt_email"><br><br>
> > Comment:<br>
> > <textarea style="width: 75%" rows="10"
> > name="txt_comment"></textarea>
> > <center><input type="submit" value="Submit"></center>
> > </font>
> > </form>
> > </center>
> > </body>
> > </html>
>--
>
>Ray Hunter
>email: bigdog
venticon.com
>www: http://venticon.com
_________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail
attached mail follows:
on 21/11/02 2:25 AM, David Russell (DavidR
BarloworldOptimus.com) wrote:
> strip_tags($_POST['Duplicate'], '<B> <I> <P> <A> <LI> <OL> <UL> <EM> > <BR> <TT> <STRONG> <BLOCKQUOTE> <DIV> <ECODE> '); > > OK, so this is cool. I got this list from the Slashdot allowed tags > list, which I would assume is ok.
Whoa there... NEVER assume because someone else does something that it's "okay" or "safe". According to your above checks, I'm allowed to do this:
<B onmouseover="window.close();">something evil</b>
Strip tags does not make a post safe at all... *safer* maybe, but no where near safe.
Really, what's needed is another version of strip tags which allows you to specify allowed attributes per tag:
strip_tags_attr($string, '<B> <P class id style> <A href title> <BR>')
But even that wouldn't prevent people from sneaking javascript (OR OTHER CLIENT SIDE SCRIPTING) into the href attribute.
But, I haven't got enough brains to actually write the extension for PHP, so hopefully someone else will pick it up eventually.
In the meantime, the only solution I can think of is to not allow <b>tags</b>... perhaps allow some other form of [i]tag[/i] tag system which doesn't allow any attributes. Then you can simply strip all tags, and then go onto replacing [b] with <b>, etc etc. It's a lot of work, and you will run into even more work when you choose to allow [a href=""] or other attributes, but it IS safer.
Or, perhaps it's "cheaper" for you to do some preliminary stripping of tags as per your code above, and then have a moderator physically check over the code for hidden "evil".
Justin French -------------------- http://Indent.com.au Web Developent & Graphic Design --------------------
attached mail follows:
Hi,
I don't have the answer, but when that happens, the first thing I do is dig around in phpMyAdmin(.org)... it's a web based GUI for MySQL, and most of the time, when you do something (like copy a table), it shows you the query used to do it... then you just need to copy it, and integrate it into your php script.
Failing that, this Q really needs to be asked on the mysql list.
Justin
on 21/11/02 5:54 AM, Steve Buehler (steve
vespro.com) wrote:
> Using PHP and MySQL. > I have looked and can't find the answer to this problem. What I am trying > to do is to copy a mysql table to a new table name in a PHP script. The > reason for this is to keep the original table the way it is and editing the > copy. Now, I know that I can go through a loop reading the old table and > putting it into the new table, but is there an easier way that would just > duplicate or copy the mysql table to a new table name? > > The reason for all of this is my script will create the original table (a > temporary table), populate it, delete what needs to be deleted out of it, > then I need a copy of that table for a subroutine that will be running > multiple times and need the same information to start off with.
Justin French -------------------- http://Indent.com.au Web Developent & Graphic Design --------------------
attached mail follows:
------------------ Virus Warning Message (on lakdiva)
Found virus WORM_KLEZ.H in file Policy.scr The uncleanable file is deleted.
---------------------------------------------------------
attached mail follows:
I'm making a module system. I need to make the actual module then a form to go along with it. The only way I can think of doing this is makign a file and then sectioning the file so that the first part is read and put somewhere on a page them the other part is put on the same page later on or on a different page. How can this be done without reading a certain amount of characters? The actual module part won't all be the same length so...how can this be done?
Thanks, Stephen Craton http://www.melchior.us
"Life is a gift from God. Wasting it is like destroying a gift you got from the person you love most." -- http://www.melchior.us
attached mail follows:
What I'm doing is having a PHP part, let's say that it's a calculator that adds module, that does the adding. The second part of the file is the form that the user uses to put in the numbers. That's what I want to do...
----- Original Message -----
From: "Matt" <mschroebel
epooch.com>
To: "Stephen" <webmaster
melchior.us>
Sent: Wednesday, November 20, 2002 8:11 PM
Subject: Re: [PHP] Reading part of a file
> I think what your trying to do is to read one file containing html, and
> insert some other html in the middle of the first file. If that's
correct,
> you should look into a template class, which can handle that quite nicely.
>
> Other than that, you can break up the first file into 2 parts, a header
and
> a footer. Then you would have a page that does a:
> <?php
> require('header.php');
> require('middle.php');
> require('footer.php');
> ?>
> You put your form or whatever into the middle.php file. Lots of pages are
> built that way, but templates are more flexible. For templates packages,
> you can look into phplib (http://phplib.sourceforge.net/), and smarty
> (http://smarty.php.net/).
>
> If I'm off base, perhaps you could explain a little more about what you're
> trying to do.
>
> ----- Original Message -----
> From: "Stephen" <webmaster
melchior.us>
> To: "PHP List" <php-general
lists.php.net>
> Sent: Wednesday, November 20, 2002 7:33 PM
> Subject: [PHP] Reading part of a file
>
>
> I'm making a module system. I need to make the actual module then a form
to
> go along with it. The only way I can think of doing this is makign a file
> and then sectioning the file so that the first part is read and put
> somewhere on a page them the other part is put on the same page later on
or
> on a different page. How can this be done without reading a certain amount
> of characters? The actual module part won't all be the same length
so...how
> can this be done?
>
> Thanks,
> Stephen Craton
> http://www.melchior.us
>
> "Life is a gift from God. Wasting it is like destroying a gift you got
from
> the person you love most." -- http://www.melchior.us
>
>
>
attached mail follows:
> From: "Stephen" <webmaster
melchior.us>
> Cc: "PHP List" <php-general
lists.php.net>
> Sent: Wednesday, November 20, 2002 8:52 PM
> Subject: Re: [PHP] Reading part of a file
> What I'm doing is having a PHP part, let's say that it's a calculator that > adds module, that does the adding. The second part of the file is the form > that the user uses to put in the numbers. That's what I want to do...
If you have a piece of php code sitting in a file, you can use it anytime by including or requiring it. Say you have a file named add.php and in it you have: --- Top of file --- <?php function add($addend1, $addend2) { return ($addend1 + $addend2); } ?> --- End of file ---
in another file named page calc.php you can do a: --- Top of file --- <?php require 'add.php'; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $sum = add($_POST['addend1'],$_POST['addend2']); echo "<br>The sum of {$_POST['addend1']} and {$_POST['addend2']} is $sum<br>\n"; } ?> <form method="post" action="calc.php"> <input type="text" name="addend1" size="10"><br> <input type="text" name="addend2" size="10"><br> <input type="submit" name="submit" value="Add them"> </form> --- End of file ---
attached mail follows:
That's what my alternative was if there wasn't a way to do it in PHP with some special leet attack. :-)
Thanks!
----- Original Message -----
From: "Matt" <mschroebel
epooch.com>
To: "Stephen" <webmaster
melchior.us>
Cc: "PHP List" <php-general
lists.php.net>
Sent: Wednesday, November 20, 2002 9:27 PM
Subject: Re: [PHP] Reading part of a file
> > From: "Stephen" <webmaster
melchior.us>
> > Cc: "PHP List" <php-general
lists.php.net>
> > Sent: Wednesday, November 20, 2002 8:52 PM
> > Subject: Re: [PHP] Reading part of a file
>
>
> > What I'm doing is having a PHP part, let's say that it's a calculator
that
> > adds module, that does the adding. The second part of the file is the
form
> > that the user uses to put in the numbers. That's what I want to do...
>
> If you have a piece of php code sitting in a file, you can use it anytime
by
> including or requiring it. Say you have a file named add.php and in it
you
> have:
> --- Top of file ---
> <?php
> function add($addend1, $addend2) {
> return ($addend1 + $addend2);
> }
> ?>
> --- End of file ---
>
> in another file named page calc.php you can do a:
> --- Top of file ---
> <?php
> require 'add.php';
> if ($_SERVER['REQUEST_METHOD'] == 'POST') {
> $sum = add($_POST['addend1'],$_POST['addend2']);
> echo "<br>The sum of {$_POST['addend1']} and {$_POST['addend2']} is
> $sum<br>\n";
> }
> ?>
> <form method="post" action="calc.php">
> <input type="text" name="addend1" size="10"><br>
> <input type="text" name="addend2" size="10"><br>
> <input type="submit" name="submit" value="Add them">
> </form>
> --- End of file ---
>
>
>
attached mail follows:
Try:
$meat = testfunction ($var1, $var2, $var3, $var4); echo $meat;
Or, alternatively,
print (testfunction ($var1, $var2, $var3, $var4));
hope this helps.
--t
On 11/20/02 8:40 PM, "Beauford 2002" <beauford.2002
rogers.com> wrote:
> Hi, > > I have form that a user would input information and that info is sent to > a function, but I need to be able to return a result of this function > and is where I am having a problem. > > For example: > > testfunction($var1, $var2, $var3, $var4); //the form fills these > values. > > echo $meat; > > function testfunction($a, $b, $c, $d) { > > The $meat of the function goes here; > > Now I need to return the result of $meat; > > return $meat; > } > > This does not work. I'm new to funtions and obviously missing something, > but I haven't been able to find a good tutorial on this. The PHP manual > isn't much help. > > Any help is appreciated. > >
-- Tracy F. Rotton tracytaupecat.com http://www.taupecat.com/
"... I like the 49ers because they're pure of heart, Seattle because they've got something to prove, and the Raiders because they always cheat." -- Lisa Simpson, "Lisa the Greek"
attached mail follows:
You don't need the () around print.
print testfunction($var1, $var2, $var3, $var4);
Jason
On Wed, 2002-11-20 at 17:48, Tracy Finifter Rotton wrote:
> Try:
>
> $meat = testfunction ($var1, $var2, $var3, $var4);
> echo $meat;
>
>
> Or, alternatively,
>
> print (testfunction ($var1, $var2, $var3, $var4));
>
>
> hope this helps.
>
> --t
>
> On 11/20/02 8:40 PM, "Beauford 2002" <beauford.2002
rogers.com> wrote:
>
> > Hi,
> >
> > I have form that a user would input information and that info is sent to
> > a function, but I need to be able to return a result of this function
> > and is where I am having a problem.
> >
> > For example:
> >
> > testfunction($var1, $var2, $var3, $var4); //the form fills these
> > values.
> >
> > echo $meat;
> >
> > function testfunction($a, $b, $c, $d) {
> >
> > The $meat of the function goes here;
> >
> > Now I need to return the result of $meat;
> >
> > return $meat;
> > }
> >
> > This does not work. I'm new to funtions and obviously missing something,
> > but I haven't been able to find a good tutorial on this. The PHP manual
> > isn't much help.
> >
> > Any help is appreciated.
> >
> >
>
> --
> Tracy F. Rotton
> tracy
taupecat.com
> http://www.taupecat.com/
>
> "... I like the 49ers because they're pure of heart,
> Seattle because they've got something to prove,
> and the Raiders because they always cheat."
> -- Lisa Simpson, "Lisa the Greek"
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hello,
working by an ISP, I'd like to force my users to use given databases - force the hostname, user, password and database too.
I thought I can do that with defining "sql.safe_mode On" but as it seems now, it is not possible to do this.
Any idea about how to do it?
-- Matus "fantomas" Uhlar, uhlarfantomas.sk ; http://www.fantomas.sk/ Warning: I don't wish to receive spam to this address. Varovanie: Nezelam si na tuto adresu dostavat akukolvek reklamnu postu. You have the right to remain silent. Anything you say will be misquoted, then used against you.
attached mail follows:
Hello,
reading manual did not help me answering this question. Where does PHP get the correst host/user/password when sql.safe_mode is on?
-- Matus "fantomas" Uhlar, uhlarfantomas.sk ; http://www.fantomas.sk/ Warning: I don't wish to receive spam to this address. Varovanie: Nezelam si na tuto adresu dostavat akukolvek reklamnu postu. I wonder how much deeper the ocean would be without sponges.
attached mail follows:
Hello~.
I made a PHP script which resize GIF Image.
But, Animated GIF don't Animate ;-(
Manual says 'use imagecolortransparent() to format GIF89'.
But, I don't know how to use imagecolortransparent() ...
Somebody Help me~
My code likes follows
############# cut here #########################
if( eregi("\.gif$", $image_url ) ) $image_type = "gif" ;
else if( eregi( "\.jpg$", $image_url ) ) $image_type = "jpeg" ;
Header("Content-type: image/".$image_type) ;
if( $image_type == "jpeg" ) $src_img = ImageCreatefromjpeg( $image_url ) ; else $src_img = ImageCreatefromgif( $image_url ) ;
if( $src_img == 0 ) die() ;
$SMALL_SIZE = 100 ;
$src_w = ImageSx( $src_img ) ; $src_h = ImageSy( $src_img ) ;
if( $src_w >= $src_h ) { $new_w = $SMALL_SIZE ; $new_h = $src_h * ( $SMALL_SIZE / $src_w ) ; } else { $new_h = $SMALL_SIZE ; $new_w = $src_w * ( $SMALL_SIZE / $src_h ) ; }
$new_img = ImageCreate( $new_w, $new_h ) ; if( $new_img == 0 ) die() ;
ImageCopyResized( $new_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, ImageSX($src_img), ImageSY( $src_img ) ) ;
if( $image_type == "jpeg" ) imagejpeg( $new_img ) ; else if( $image_type == "gif" ) imagegif( $new_img ) ;
################ cut here ###########################
########################## Heo, Jungsu Mr.
SimpleX Internet. http://www.simplexi.com
attached mail follows:
I have a PHP script that logs someone in then takes them to another page indicating their online status. However, when I try echoing out the contents of the session variable, it says this:
Notice: Undefined variable: _SESSION in c:\program files\apache group\apache\htdocs\checker\members\index.php on line 38
Here's the code that registers the variable, or is atleast supposed to:
if ($dbconn) { $querystr = "SELECT user FROM users WHERE (user = '" . prepareData($_POST['user']) . "' and pass=PASSWORD('" . prepareData($_POST['pass']) . "'))"; $result = mysql_query($querystr,$dbconn); if ($result) { if ($frow = mysql_fetch_row($result)) { session_start(); session_register('user'); $_SESSION['user'] = $frow[0]; header("Location: index.php?" . SID); exit(); } else { $error = "Invalid username and password combo."; } }
Here's where I echo it out:
<div align="left" class="log"><font size="2">Logged in as <?php echo $_SESSION['user']; ?></font></div>
Any ideas why it's not working?
Thanks, Stephen Craton http://www.melchior.us
"Life is a gift from God. Wasting it is like destroying a gift you got from the person you love most." -- http://www.melchior.us
attached mail follows:
Hi,
I currently have a page divided into three areas, two of which are iframes.
The user selects a component out of part 1, which decides what is shown in part 2. When something is clicked in part 2 the information updates in the second iframe, or part 3. This is all working fine through $PHP_SELF and target.
I am now working in part 3 of my page which has already had variables passed to it from part 2, however when I try to make selections on this page which should update in the same area ($PHP_SELF) I am losing all the variables which were earlier passed. I have tried $REQUEST_URI also which didn't help.
example:
after coming from part 2 $REQUEST_URI might be test.php?var1=a&var5=f&var16=d . If I then select and option on this new form and then send it to itself I lose everything that was originally there (output might then be test.php?newvar=new)
The line which executes my form is (currently) <form name="tick" action="<?php echo $REQUEST_URI; ?>" method="get" enctype="multipart/form-data"> , and as I said $REQUEST_IRI does contain the variables on initial loading. I need to keep these initial variables and add the new (ie test.php?var1=a&var5=f&var16=d&newvar=new)
Please help!
Thanks, Michael.
attached mail follows:
at a guess would say have some hidden inputs on your form that echo the var's pass from part 2 that way when your form is submitted in part 3 it gets sent along with the new stuff
> -----Original Message-----
> From: Michael Benbow [mailto:Michael.Benbow
CeLTS.monash.edu.au]
> Sent: Thursday, 21 November 2002 2:24 PM
> To: php-general
lists.php.net
> Subject: [PHP] Variable passing through a form
>
>
>
> Hi,
>
> I currently have a page divided into three areas, two of which
> are iframes.
>
> The user selects a component out of part 1, which decides what is shown
> in part 2. When something is clicked in part 2 the information updates
> in the second iframe, or part 3. This is all working fine through
> $PHP_SELF and target.
>
> I am now working in part 3 of my page which has already had variables
> passed to it from part 2, however when I try to make selections on this
> page which should update in the same area ($PHP_SELF) I am losing all
> the variables which were earlier passed. I have tried $REQUEST_URI also
> which didn't help.
>
> example:
>
> after coming from part 2 $REQUEST_URI might be
> test.php?var1=a&var5=f&var16=d . If I then select and option on this
> new form and then send it to itself I lose everything that was
> originally there (output might then be test.php?newvar=new)
>
> The line which executes my form is (currently) <form name="tick"
> action="<?php echo $REQUEST_URI; ?>" method="get"
> enctype="multipart/form-data"> , and as I said $REQUEST_IRI does contain
> the variables on initial loading. I need to keep these initial
> variables and add the new (ie test.php?var1=a&var5=f&var16=d&newvar=new)
>
> Please help!
>
> Thanks,
> Michael.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi everyone, I'm a newbie on PHP and MySQL. I've two questions that want to get some help.
1. How to solve the problem of nested include? That's mean A include B and B include C. 2. Can I save the object in session?
Thanks for your great help!!
Regards, Michael
attached mail follows:
1. see php.net/include_once 2. Yes $_SESSION['foo'] = new foo();
$myFoo = &$_SESSION['foo'];
$myFoo->var = 123;
/* page2.php */
$myFoo = &$_SESSION['foo'];
echo $myFoo->var;
-js
Michael Wai wrote: > Hi everyone, I'm a newbie on PHP and MySQL. I've two questions that want to > get some help. > > 1. How to solve the problem of nested include? That's mean A include B and B > include C. > 2. Can I save the object in session? > > Thanks for your great help!! > > Regards, > Michael > > >
attached mail follows:
Sorry, but I forgot to say the variables froming from part 2 to part 3 can be anything between 1 and 30 or any combination thereof. <input type="hidden"> will be no good here as it is too hard to pre-distringuish which variable names will be transferred
Thanks
Michael Benbow wrote:
> > Hi, > > I currently have a page divided into three areas, two of which are > iframes. > > The user selects a component out of part 1, which decides what is > shown in part 2. When something is clicked in part 2 the information > updates in the second iframe, or part 3. This is all working fine > through $PHP_SELF and target. > > I am now working in part 3 of my page which has already had variables > passed to it from part 2, however when I try to make selections on > this page which should update in the same area ($PHP_SELF) I am losing > all the variables which were earlier passed. I have tried > $REQUEST_URI also which didn't help. > > example: > > after coming from part 2 $REQUEST_URI might be > test.php?var1=a&var5=f&var16=d . If I then select and option on this > new form and then send it to itself I lose everything that was > originally there (output might then be test.php?newvar=new) > > The line which executes my form is (currently) <form name="tick" > action="<?php echo $REQUEST_URI; ?>" method="get" > enctype="multipart/form-data"> , and as I said $REQUEST_IRI does > contain the variables on initial loading. I need to keep these > initial variables and add the new (ie > test.php?var1=a&var5=f&var16=d&newvar=new) > > Please help! > > Thanks, > Michael. > >
-- _________________________________________________________________________ Michael Benbow Centre for Learning and Teaching Support Gippsland CampusIT Support Co-ordinator
Phone: +61 3 9902 6254 Fax: +61 3 9902 6578 Web: http://www.celts.monash.edu.au
attached mail follows:
Hi people, I’m in a lot of trouble, I’m doing a paging for a mySql database result it was going well until I tried it out. It shows the right amount of registries and it shows the next page link, but when I click on the next page it says it is missing a variable, it is the one that is sent by the form witch is the first, but I’m allready sending one variable and I need to send this one also, any ideas? By the way I already trried & , +... and I’m out of ideeas, please help. The code in under my name. Rodrigo <? $id = mysql_connect("localhost","rodrigo","rodrigo"); $con = mysql_select_db("db_mp",$id); $sql = mysql_query("SELECT * FROM tb_base WHERE processo='$processo'"); $rpp =10;//resultado por página ($lpp) $total = mysql_num_rows($sql);//retorna o total de linhas na tabela $pagina = ceil($total / $rpp);//retorna o resultado total de páginas da tabela if(!isset($pagina)){ $pagina = 0; }//// Especifica uma valor para variavel pagina caso a mesma não esteja setada $inicio = $pagina * $rpp;// Retorna qual será a primeira linha a ser mostrada no MySQL $fim = $inicio + $rpp;// Retorna qual será a última linha a ser mostrada no MySQL $resultado = mysql_query("SELECT * FROM tb_base WHERE processo='$processo' LIMIT $inicio,$fim"); // Executa a query no MySQL com o limite de linhas. while($l = mysql_fetch_array($sql)) { echo $l[0]."\n".$l[1]."\n".$l[2]."\n".$l[3]."\n".$l[4]."\n".$l[5]."\n".$l[6]. "\n".$l[7]."\n".$l[8]."<br>\n"; } if($pagina > 0) { $menos = $pagina - 1; $url = "$PHP_SELF?pagina=$menos"; echo "<a href=".$url.">Anterior</a>"; // Vai para a página anterior } for($i=0;$i<$pagina;$i++) { // Gera um loop com o link para as páginas $url = "$PHP_SELF?pagina=$i"; echo " | <a href=".$url.">$i</a>"; } if($pagina < ($pagina - 1)) { $mais = $pagina + 1; $url = "$PHP_SELF?pagina=$mais"; echo " | <a href=".$url.>Próxima</a>"; } ?>
attached mail follows:
On Thursday 21 November 2002 12:53, Rodrigo de Oliveira Costa wrote: > Hi people, I’m in a lot of trouble, I’m doing a paging for a mySql > database result it was going well until I tried it out.
But how did you know it was going well *before* you tried it ;-)
> It shows the > right amount of registries and it shows the next page link, but when I > click on the next page it says it is missing a variable, it is the one > that is sent by the form witch is the first, but I’m allready sending > one variable and I need to send this one also, any ideas?
Not exactly sure what you mean here but if you're going from page to page you have to pass ALL the variables you need each time.
> By the way I already trried & , +... and I’m out of ideeas, please help. > The code in under my name.
If you want to pass multiple variables via the URL then do so like:
http://www.example.com/doo.php?dah=something&dee=somethingelse
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Bones: "The man's DEAD, Jim!" */
attached mail follows:
GOLDEN BUSINESS OPPORTUNITY I am an Attorney and close confidant of MRS. MARYAM ABACHA, the former first lady and wife of the late GEN. SANI ABACHA, the former head of state and commander in chief of the armed forces of the Federal Republic of Nigeria.
She (MRS. M. ABACHA), has as a result of the trust and confidence she has in me mandated that I search for a reliable and trustworthy foreign partner, who will help receive some funds which she had in cash totaling US$45m (Forty Five Million United States Dollars Only) into a personal, company or any reliable foreign bank account for safe keeping for a short period of time, since her family bank accounts within and outside the country have all been frozen by the authorities. (I would refer you to the website of .http://www.transnationale.org/anglais/sources/tiersmonde/dirigeants__aba http://allafrica.com/stories/200203180074.html http://www.time.com/time/europe/magazine/2000/27/swiss.html , for further information about these monies and the ABACHAS)
This money in question has however, been carefully keptin defaced form and deposited with a security company that has branches in Europe and America. You may therefore be required to travel to any of the branches to collect the money on behalf of my client for safe keeping.
It may also interest you to know that she (MRS. ABACHA) and her family have, since the inception of the present democratic government, been placed under partial house arrest, with their international traveler's passports withdrawn pending the resolution of current fund recovery face - off between them and the present RTD GEN. OBASANJO led Federal Government, which from all indications will not exceed this year.
She has decided to offer anybody who will be willing to render this tremendous assistance 20% of the total sum, while 5% shall be set aside for incidental expenses.
Note that this transaction involves no risks whatsoever, as you will have no dealing with my Country, Nigeria. Rather, you will deal directly with the security company, which is based where the money is right now.
Let me have your confidential Tel/Fax Numbers in your response to this proposal.
I shall let you into a complete picture of this mutually beneficial transaction when I have received your anticipated positive reply. This matter should be treated as urgent and confidential. This is very important.
Best Regards,
Barrister George Emeka.
attached mail follows:
Sorry, I'm holding out for the 126 million. :)
-----Original Message-----
From: GEORGE EMEKA [mailto:ge40002002
ecplaza.net]
Sent: Wednesday, November 20, 2002 10:18 PM
To: php-general
lists.php.net
Subject: [PHP] MY CLIENT
Importance: High
GOLDEN BUSINESS OPPORTUNITY I am an Attorney and close confidant of MRS. MARYAM ABACHA, the former first lady and wife of the late GEN. SANI ABACHA, the former head of state and commander in chief of the armed forces of the Federal Republic of Nigeria.
She (MRS. M. ABACHA), has as a result of the trust and confidence she has in me mandated that I search for a reliable and trustworthy foreign partner, who will help receive some funds which she had in cash totaling US$45m (Forty Five Million United States Dollars Only) into a personal, company or any reliable foreign bank account for safe keeping for a short period of time, since her family bank accounts within and outside the country have all been frozen by the authorities. (I would refer you to the website of .http://www.transnationale.org/anglais/sources/tiersmonde/dirigeants__aba http://allafrica.com/stories/200203180074.html http://www.time.com/time/europe/magazine/2000/27/swiss.html , for further information about these monies and the ABACHAS)
This money in question has however, been carefully keptin defaced form and deposited with a security company that has branches in Europe and America. You may therefore be required to travel to any of the branches to collect the money on behalf of my client for safe keeping.
It may also interest you to know that she (MRS. ABACHA) and her family have, since the inception of the present democratic government, been placed under partial house arrest, with their international traveler's passports withdrawn pending the resolution of current fund recovery face - off between them and the present RTD GEN. OBASANJO led Federal Government, which from all indications will not exceed this year.
She has decided to offer anybody who will be willing to render this tremendous assistance 20% of the total sum, while 5% shall be set aside for incidental expenses.
Note that this transaction involves no risks whatsoever, as you will have no dealing with my Country, Nigeria. Rather, you will deal directly with the security company, which is based where the money is right now.
Let me have your confidential Tel/Fax Numbers in your response to this proposal.
I shall let you into a complete picture of this mutually beneficial transaction when I have received your anticipated positive reply. This matter should be treated as urgent and confidential. This is very important.
Best Regards,
Barrister George Emeka.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Geez, how old is that one. Been receiving it for at least a year. And here is is, all spammed up and everything! How did that creep in?
Troy May wrote:
> Sorry, I'm holding out for the 126 million. :)
>
> -----Original Message-----
> From: GEORGE EMEKA [mailto:ge40002002
ecplaza.net]
> Sent: Wednesday, November 20, 2002 10:18 PM
> To: php-general
lists.php.net
> Subject: [PHP] MY CLIENT
> Importance: High
>
> GOLDEN BUSINESS OPPORTUNITY
> I am an Attorney and close confidant of MRS. MARYAM
> ABACHA, the former first lady and wife of the late
> GEN. SANI ABACHA, the former head of state and
> commander in chief of the armed forces of the Federal
> Republic of Nigeria.
>
> She (MRS. M. ABACHA), has as a result of the trust and
> confidence she has in me mandated that I search for a
> reliable and trustworthy foreign partner, who
> will help receive some funds which she had in cash
> totaling US$45m (Forty Five Million United States
> Dollars Only) into a personal, company or any
> reliable foreign bank account for safe keeping for a
> short period of time, since her family bank accounts
> within and outside the country have all been
> frozen by the authorities. (I would refer you to the
> website of
> .http://www.transnationale.org/anglais/sources/tiersmonde/dirigeants__aba
> http://allafrica.com/stories/200203180074.html
> http://www.time.com/time/europe/magazine/2000/27/swiss.html ,
> for further information
> about these monies and the ABACHAS)
>
> This money in question has however, been carefully
> keptin defaced form and deposited with a security
> company that has branches in Europe and America.
> You may therefore be required to travel to any
> of the branches to collect the money on behalf of my
> client for safe keeping.
>
> It may also interest you to know that she (MRS.
> ABACHA) and her family have, since the inception of
> the present democratic government, been placed under
> partial house arrest, with their international
> traveler's passports withdrawn pending the resolution
> of current fund recovery face - off between them and
> the present RTD GEN. OBASANJO led Federal Government,
> which from all indications will not exceed this year.
>
> She has decided to offer anybody who will be willing
> to render this tremendous assistance 20% of the total
> sum, while 5% shall be set aside for incidental
> expenses.
>
> Note that this transaction involves no risks
> whatsoever, as you will have no dealing with my
> Country, Nigeria. Rather, you will deal directly with
> the security company, which is based where the money
> is right now.
>
> Let me have your confidential Tel/Fax Numbers in your
> response to this proposal.
>
> I shall let you into a complete picture of this
> mutually beneficial transaction when I have received
> your anticipated positive reply. This matter should be
> treated as urgent and confidential. This is very
> important.
>
> Best Regards,
>
> Barrister George Emeka.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-- John Taylor-Johnston ----------------------------------------------------------------------------- "If it's not open-source, it's Murphy's Law."' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064
attached mail follows:
Thanks Ed! Yes, another member here told me to use fread(), which is what your link led to if you're not using the CVS version of PHP. (whatever that is)
I got it working with this:
<? $file = "../header.html"; $fp = fopen($file, "r"); $header = fread($fp, filesize($file)); fclose ($fp);
echo $header;
I'm a Perl guy so I was looking for an easier way. In Perl, all you have to do is open it, dump it to a variable and close it. I thought it would be that easy in PHP too. I guess Perl wins there, but PHP is much better overall so far. ;)
Thanks again!
Troy
-----Original Message-----
From:
Edwin [mailto:copperwalls
hotmail.com]
Sent: Saturday, November 16, 2002 9:29 PM
To: Troy May
Cc: php-general
lists.php.net
Subject: Re: [PHP] Opening a file to manipulate it
Hello,
"Troy May" <tmay
pcsympathy.com> wrote:
> Hello,
>
> Extreme newbie here (halfway through my first book :) ). I need to open a
> file, read the whole file into a variable, manipulate it, and then echo it
> to the screen. I'm doing it right from my book and it's not working.
> Here's what I have now:
>
> <? $header = fopen("header.html","r");
>
> echo $header; ?>
>
> It writes "Resource id #1" at the top of the page. What is that?! :)
Check the manual:
http://www.php.net/manual/en/function.fopen.php
You're echoing the result of fopen() which is an "int"--you have to make sure that you're using the function properly ;)
> I have also tried using file(). That displays "Array" on the screen. What > am I doing wrong?
I think it's because you're echoing the result of file() which is an array. You cannot just "echo $the_array;" Try print_r($the_array) and you'll see a different result--though I doubt it's the one you want to see :)
Check the manual again:
http://www.php.net/manual/en/function.file.php
Anyway, I think you're looking for something like this:
http://www.php.net/manual/en/function.file-get-contents.php
Esp. the "User Contributed Notes".
HTH,
- E
attached mail follows:
Try this:
$content = implode('', file('../header.html'));
Or if you're running php 4.3.0 or greater:
$content = file_get_contents('../header.html');
Can't get much easier than that :)
-Mark PS: That was in the user contributed notes Ed mentioned :)
----- Original message -----
From: "Troy May" <tmay
gbis.com>
To: "
Edwin" <copperwalls
hotmail.com>
Date: Sat, 16 Nov 2002 21:45:50 -0800
Subject: RE: [PHP] Opening a file to manipulate it
Thanks Ed! Yes, another member here told me to use fread(), which is what your link led to if you're not using the CVS version of PHP. (whatever that is)
I got it working with this:
<? $file = "../header.html"; $fp = fopen($file, "r"); $header = fread($fp, filesize($file)); fclose ($fp);
echo $header;
I'm a Perl guy so I was looking for an easier way. In Perl, all you have to do is open it, dump it to a variable and close it. I thought it would be that easy in PHP too. I guess Perl wins there, but PHP is much better overall so far. ;)
Thanks again!
Troy
-----Original Message-----
From:
Edwin [mailto:copperwalls
hotmail.com]
Sent: Saturday, November 16, 2002 9:29 PM
To: Troy May
Cc: php-general
lists.php.net
Subject: Re: [PHP] Opening a file to manipulate it
Hello,
"Troy May" <tmay
pcsympathy.com> wrote:
> Hello,
>
> Extreme newbie here (halfway through my first book :) ). I need to open a
> file, read the whole file into a variable, manipulate it, and then echo it
> to the screen. I'm doing it right from my book and it's not working.
> Here's what I have now:
>
> <? $header = fopen("header.html","r");
>
> echo $header; ?>
>
> It writes "Resource id #1" at the top of the page. What is that?! :)
Check the manual:
http://www.php.net/manual/en/function.fopen.php
You're echoing the result of fopen() which is an "int"--you have to make sure that you're using the function properly ;)
> I have also tried using file(). That displays "Array" on the screen. What > am I doing wrong?
I think it's because you're echoing the result of file() which is an array. You cannot just "echo $the_array;" Try print_r($the_array) and you'll see a different result--though I doubt it's the one you want to see :)
Check the manual again:
http://www.php.net/manual/en/function.file.php
Anyway, I think you're looking for something like this:
http://www.php.net/manual/en/function.file-get-contents.php
Esp. the "User Contributed Notes".
HTH,
- E
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]