RE: [PHP] comparing a string

2006-06-20 Thread yangshiqi1089
When the $_REQUEST['x'] is not 0 or '', it will be always correct condition of your if. see the magic*. -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 20, 2006 10:02 PM To: Ross; php-general@lists.php.net Subject: Re: [PHP] comparing a string At 12:43 PM +010

Re: [PHP] Stream download problem

2006-06-20 Thread Michael Satterwhite
Prathaban Mookiah wrote: Micheal, I ran into this problem too. A easy workaround is to right click and choose 'save as' which worked for me. I wish that would work. The URL is along the lines of For complete information on this you want to have a look at http://support. microsoft.com/defau

Re: [PHP] Problem displaying a mysql database field

2006-06-20 Thread Chris
Don wrote: Hi, I have a varchar field in a MySQL database that contains a line of text like so: "This is a line if text" The double quotes are included in the database field. I cannot seem to display it on my HTML page, it always shows as blank. I have tried using both the stripslashes

[PHP] session problem

2006-06-20 Thread weetat
Hi all, I have 2 php page , whenever i click the submit in 1st page , the $_SESSION['LIST_OF_DATA'] display nothing in the 2nd page. If i do echo print_r($_SESSION['LIST_OF_DATA']) in first page , it displayed the data correctly. Anybody have any ideas why php session behaviour is like tha

Re: [PHP] complex control structure- please help

2006-06-20 Thread Chris
IG wrote: Hi all, This may not be complex at all- maybe my head is just screwed up this afternoon! I am looping through arrays all at one time for the following- $filter_subject $filter_body $filter_email $filter_subject_like $filter_body_like $filter_email_like Examples of the following co

Re: [PHP] Stream download problem

2006-06-20 Thread Prathaban Mookiah
Micheal, I ran into this problem too. A easy workaround is to right click and choose 'save as' which worked for me. For complete information on this you may want to have a look at http:// support. microsoft.com/default.aspx/kb/279667 Cheers, Prathap -- Original Message --- Fro

Re: [PHP] Stream download problem

2006-06-20 Thread Prathaban Mookiah
Micheal, I ran into this problem too. A easy workaround is to right click and choose 'save as' which worked for me. For complete information on this you want to have a look at http://support. microsoft.com/default.aspx/kb/279667 Cheers, Prathap -- Original Message --- From: Mi

Re: [PHP] Processing HTML in mail form

2006-06-20 Thread Prathaban Mookiah
Jonas: I am not sure if I understood your problem correct. But the way I understood it, you want the mail to be displayed as: F-namn: J L-namn: R Birth: 12 Address: 34 Zip: 56 City: 78 Phone: 90 Mail: [EMAIL PROTECTED] Desc: N Hair: hair Make: makeup Am I correct? If that is the case, I guess y

Re: [PHP] GD problems

2006-06-20 Thread Chris
Beauford wrote: After my last email I searched around some more and found the following. /Q: gd keeps saying it can't find png or jpeg support. I did install libpng and libjpeg. What am I missing?/ /A: Be sure to do "make install-headers" for libpng and "make install-lib" for libjpeg, in addit

[PHP] Stream download problem

2006-06-20 Thread Michael Satterwhite
I have a site that generates a file to be streamed down. The relevant code is: -- header("Content-type: application/vnd.ms-excel"); header("Content-disposition: attachment; filename=$EXPORT_TIME.txt"); header("Content-disposition: attachment

[PHP] Re: comparing a string

2006-06-20 Thread Rafael
(inline) Adam Zey wrote: Rafael wrote: A single "=" it's an assignment, not a comparison; and though it sometimes work, you shouldn't compare strings with "==", but using string functions, such as strcmp()... or similar_text(), etc. This is PHP, not C. Operators such as == support strin

Re: [PHP] For Loop

2006-06-20 Thread D. Dante Lorenso
Albert Padley wrote: Thanks everyone. Always nice to know there is more than one direction to go in. A alternative to variable variables might use these: http://us3.php.net/manual/en/function.compact.php http://us3.php.net/manual/en/function.extract.php 'extract' looks like it might be

Re: [PHP] For Loop

2006-06-20 Thread Robert Cummings
On Tue, 2006-06-20 at 19:19, Albert Padley wrote: > Thanks everyone. Always nice to know there is more than one direction > to go in. > > Albert > > > On Jun 20, 2006, at 4:52 PM, Ray Hauge wrote: > > > On Tuesday 20 June 2006 15:28, Adam Zey wrote: > >> Ray Hauge wrote: > >>> On Tuesday 20 J

Re: [PHP] For Loop

2006-06-20 Thread Albert Padley
Thanks everyone. Always nice to know there is more than one direction to go in. Albert On Jun 20, 2006, at 4:52 PM, Ray Hauge wrote: On Tuesday 20 June 2006 15:28, Adam Zey wrote: Ray Hauge wrote: On Tuesday 20 June 2006 15:14, Albert Padley wrote: I have a regular for loop - for($i=1; $

Re: [PHP] For Loop

2006-06-20 Thread Ray Hauge
On Tuesday 20 June 2006 15:28, Adam Zey wrote: > Ray Hauge wrote: > > On Tuesday 20 June 2006 15:14, Albert Padley wrote: > >> I have a regular for loop - for($i=1; $i<100; $i++) > >> > >> Within the loop I need to create variables named: > >> > >> $p1name; > >> $p2name; > >> $p3name; > >> etc. > >

Re: [PHP] For Loop

2006-06-20 Thread David Tulloh
Are you sure that you don't want an array? Arrays are normally much better for this type of thing. That said, ${"p{$i}name"} = 'foo'; David Albert Padley wrote: > I have a regular for loop - for($i=1; $i<100; $i++) > > Within the loop I need to create variables named: > > $p1name; > $p2name;

Re: [PHP] For Loop

2006-06-20 Thread Adam Zey
Ray Hauge wrote: On Tuesday 20 June 2006 15:14, Albert Padley wrote: I have a regular for loop - for($i=1; $i<100; $i++) Within the loop I need to create variables named: $p1name; $p2name; $p3name; etc. The integer portion of each variable name needs to be the value of $i. I can't seem to ge

Re: [PHP] For Loop

2006-06-20 Thread Jeffrey Sambells
for($i=1; $i<100; $i++) { ${'p'.$i.'name'} = 'whatever'; } - jeff On 20-Jun-06, at 6:14 PM, Albert Padley wrote: I have a regular for loop - for($i=1; $i<100; $i++) Within the loop I need to create variables named: $p1name; $p2name; $p3name; etc. The integer portion of each variable

Re: [PHP] For Loop

2006-06-20 Thread Ray Hauge
On Tuesday 20 June 2006 15:14, Albert Padley wrote: > I have a regular for loop - for($i=1; $i<100; $i++) > > Within the loop I need to create variables named: > > $p1name; > $p2name; > $p3name; > etc. > > The integer portion of each variable name needs to be the value of $i. > > I can't seem to ge

[PHP] For Loop

2006-06-20 Thread Albert Padley
I have a regular for loop - for($i=1; $i<100; $i++) Within the loop I need to create variables named: $p1name; $p2name; $p3name; etc. The integer portion of each variable name needs to be the value of $i. I can't seem to get my syntax correct? Can someone point me in the right direction? Tha

[PHP] Processing HTML in mail form

2006-06-20 Thread Jonas Rosling
I've done the following code bellow for an e-mail form. But it handles the HTML tags as text. Is there anyway to get the HTML tags processed to form the mail? '. 'L-name: '.$lastname.''. 'Birth: '.$date_of_birth.''. 'Address: '.$post_address.''. 'Zip

Re: [PHP] Problem displaying a mysql database field

2006-06-20 Thread Stut
Don wrote: I have a varchar field in a MySQL database that contains a line of text like so: "This is a line if text" The double quotes are included in the database field. I cannot seem to display it on my HTML page, it always shows as blank. I have tried using both the stripslashes() and

[PHP] Problem displaying a mysql database field

2006-06-20 Thread Don
Hi, I have a varchar field in a MySQL database that contains a line of text like so: "This is a line if text" The double quotes are included in the database field. I cannot seem to display it on my HTML page, it always shows as blank. I have tried using both the stripslashes() and the html

Re: [PHP] Re: comparing strings - again!

2006-06-20 Thread Jochem Maas
John Nichel wrote: > Jochem Maas wrote: ... >> >> exactly. btw: var_dump() should be showing exactly where the white >> space is e.g.: >> >> >> code: >> > $s1 = "Company Director "; $s2 = "Company Director"; var_dump($s1, $s2); >> >> output: >> string(17) "Company Director " >> string(16) "Compan

Re: [PHP] mysql_db_query & INSERT

2006-06-20 Thread Prathaban Mookiah
No. I was looking for a way to do it. mysql_insert_id did the job for me. I can't figure out how I missed out on this function. I browsed through the manual for 2 hours yesterday looking for such a function. Anway, thank you Jay and Chris. And you too John, for your attention. Cheers, Prathap

[PHP] Re: shutting down a web app for maintenance

2006-06-20 Thread Ben Liu
On 6/20/06, Adam Zey <[EMAIL PROTECTED]> wrote: Shutting down Apache would do the trick ;) But if you're in a shared hosting environment that may not be possible. Yeah, don't have full control over the server in this case. As for sessions, it depends how you track them. You can't kill all PH

[PHP] Re: shutting down a web app for maintenance

2006-06-20 Thread Adam Zey
Shutting down Apache would do the trick ;) But if you're in a shared hosting environment that may not be possible. As for sessions, it depends how you track them. You can't kill all PHP sessions in one go, but you could have your web app nuke the sessions of users after they come back after ma

[PHP] Re: shutting down a web app for maintenance

2006-06-20 Thread Ben Liu
Thanks Adam, What you say makes good sense to me. Is there some method to run a script that kills all active sessions on a host? It could become part of the maintenance script I suppose: 1) Kill all active sessions 2) Put up generic maintenance screen 3) Deny further login attempts - Ben On 6/

[PHP] Re: shutting down a web app for maintenance

2006-06-20 Thread Adam Zey
Ben Liu wrote: Hello All, I'm not sure this is strictly a PHP related question or perhaps a server admin question as well. What do you do when you are trying to shutdown a web application for maintenance (like a membership or registration-required system)? I understand that you can temporarily u

Re: [PHP] shutting down a web app for maintenance

2006-06-20 Thread Ben Liu
Hi Jon, Thanks for the response. What would these solutions mean in regards to users who are active at the moment that the .htaccess file is added? Would it be wise to force some kind of logout, destruction of open sessions, etc. I guess there is no simple, graceful way to allow users to complete

Re: [PHP] shutting down a web app for maintenance

2006-06-20 Thread Jon Anderson
Assuming you're using a web server that supports htaccess files, you could easily just pop in a .htaccess file that denies access to everything. You could even add a PHP ini directive like: php_value auto_prepend_file "maintenance.php" where maintenance.php could contain something like: Down

[PHP] shutting down a web app for maintenance

2006-06-20 Thread Ben Liu
Hello All, I'm not sure this is strictly a PHP related question or perhaps a server admin question as well. What do you do when you are trying to shutdown a web application for maintenance (like a membership or registration-required system)? I understand that you can temporarily upload or activat

Re: [PHP] Paging Help

2006-06-20 Thread Adam Zey
Andrei wrote: Since you query all enregs from table why not query all first and the do mysql_data_seek on result? // Query to show $query_rsData = "SELECT * FROM {table} ORDER BY {Whatever field}"; $rsData = mysql_query($query_rsData, $DB_CONECTION); $num_total_records = mysql_num_rows(

Re: [PHP] MYSQL_CONNECT vs MYSQL_PCONNECT

2006-06-20 Thread Joe Wollard
If you're not sure you should probably stick with mysql_connect() - otherwise you could end up bogging down mysql with way more connections than you need if you're not careful. On Jun 20, 2006, at 12:34 PM, Juanjo Pascual wrote: How can i know which of both is better to use each time? --

[PHP] Re: [?? Probable Spam] [PHP] MYSQL_CONNECT vs MYSQL_PCONNECT

2006-06-20 Thread Andrei
As you didn't mentioned what you use your queries for, maybe read the manual? Andy Juanjo Pascual wrote: > How can i know which of both is better to use each time? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MYSQL_CONNECT vs MYSQL_PCONNECT

2006-06-20 Thread Robert Cummings
On Tue, 2006-06-20 at 12:34, Juanjo Pascual wrote: > How can i know which of both is better to use each time? Use mysql_pconnect() if the connection overhead is large. This is usually the case if the database is off on a remote server somewhere in lala land. Remote servers within your LAN don't us

Re: [PHP] Paging Help

2006-06-20 Thread Andrei
Juanjo Pascual wrote: > // Num of records each time > $NUM_RECORDS = 10; > > if ($_GET["pag"] == "") { >$ini = 0; >$pag = 1; > } > else { >$ini = ($pag - 1) * $NUM_RECORDS; > } > > // Query to show > $query_rsData = "SELECT * FROM table LIMIT " . $ini . ", " . $NUM_RECORDS; > $rsData

[PHP] MYSQL_CONNECT vs MYSQL_PCONNECT

2006-06-20 Thread Juanjo Pascual
How can i know which of both is better to use each time? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Paging Help

2006-06-20 Thread Juanjo Pascual
Links for the pages --- First page: this_page.php?pag=1 Previous page: this_page?pag= Next page: this_page?pag= Last page: this_page?pag= Rodrigo de Oliveira Costa escribió: I have the following problem, I need to make a paging system to show results from search on a Mys

[PHP] Paging Help

2006-06-20 Thread Rodrigo de Oliveira Costa
I have the following problem, I need to make a paging system to show results from search on a Mysql database. I found a class that should do the job but couldn't figure it out how to use it. Does anybody has an Idea of hos to do this? I thank in advance for any help you guys can provide me. R

Re: [PHP] Re: comparing strings - again!

2006-06-20 Thread John Nichel
Jochem Maas wrote: [EMAIL PROTECTED] wrote: var_dump gives Company Director string(17) Company Director string(16) Why would they be different? probably because there is either: 1. white space in the value in your data source 2. white space being outputted along side the value when creati

[PHP] complex control structure- please help

2006-06-20 Thread IG
Hi all, This may not be complex at all- maybe my head is just screwed up this afternoon! I am looping through arrays all at one time for the following- $filter_subject $filter_body $filter_email $filter_subject_like $filter_body_like $filter_email_like Examples of the following could be- $f

Re: [PHP] mysql_db_query & INSERT

2006-06-20 Thread tg-php
After you do your first insert, do: $insertedid = mysql_insert_id(); That will give you the autoincrement ID from the last INSERT you did. Note, this doesn't retrieve the last autoincrement ID from any insert, just the last one for thta specific mysql connection. So you don't have to worry ab

Re: [PHP] Re: comparing strings - again!

2006-06-20 Thread Jochem Maas
Ross wrote: > This does not work although when I echo out the strings they are exactly the > same. Strange! try using var_dump($compare1, $compare2); > > > "Ross" <[EMAIL PROTECTED]> wrote in message news:... >> if (isset($_POST['Submit'])) { >> //echo "post equals".$_POST['x']." corect >

[PHP] Re: comparing a string

2006-06-20 Thread Adam Zey
Rafael wrote: A single "=" it's an assignment, not a comparison; and though it sometimes work, you shouldn't compare strings with "==", but using string functions, such as strcmp()... or similar_text(), etc. This is PHP, not C. Operators such as == support strings for a reason, peopl

Re: [PHP] Re: comparing strings - again!

2006-06-20 Thread Jochem Maas
[EMAIL PROTECTED] wrote: > var_dump gives > > Company Director string(17) > > Company Director string(16) > > Why would they be different? probably because there is either: 1. white space in the value in your data source 2. white space being outputted along side the value when creating a form

Re: [PHP] Re: comparing strings - again!

2006-06-20 Thread ross
Soted it was an extra whitespace character being added to the posted answer. The var_dump function highlighted it! nice Work Jochem. No idea where it campe from though! R. - Original Message - From: "Jochem Maas" <[EMAIL PROTECTED]> To: "Ross" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, J

Re: [PHP] Re: comparing strings - again!

2006-06-20 Thread ross
var_dump gives Company Director string(17) Company Director string(16) Why would they be different? Seems like they have add some extra whitespace? R. - Original Message - From: "Jochem Maas" <[EMAIL PROTECTED]> To: "Ross" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, June 20, 2006 3:57 PM

Re: [PHP] mysql_db_query & INSERT

2006-06-20 Thread tedd
At 8:47 AM +0600 6/20/06, Prathaban Mookiah wrote: >I have run into a tricky situation and need some help to work my way through >the problem. I use MySQL. > >I accept some data from the user and insert them into two tables. > >1. I insert part of the data into the first table. I do not specify the

[PHP] Re: comparing strings - again!

2006-06-20 Thread Ross
This does not work although when I echo out the strings they are exactly the same. Strange! "Ross" <[EMAIL PROTECTED]> wrote in message news:... > if (isset($_POST['Submit'])) { > //echo "post equals".$_POST['x']." corect > is".$correct_answers[$page-1]; > $compare1 = $_POST['x']; > echo "p

Re: [PHP] comparing a string

2006-06-20 Thread tedd
At 12:43 PM +0100 6/20/06, Ross wrote: >I have a quiz where the ansers are held in a array called $correct answers. >When I compare the string > >if ($_REQUEST['x']= $correct_answers[$page-1]) { > > > >with a double == the answer is always correct with the single = it is always >wrong. > >when I e

[PHP] comparing strings - again!

2006-06-20 Thread Ross
if (isset($_POST['Submit'])) { //echo "post equals".$_POST['x']." corect is".$correct_answers[$page-1]; $compare1 = $_POST['x']; echo "page is".$page; $compare2 = $correct_answers[($page-1)]; echo "compare1 is ".$compare1; echo ""; echo "compare2 is ".$compare2; if (strcmp($compare1, $compare2

Re: [PHP] Still trying to figure this out...

2006-06-20 Thread tedd
At 4:19 AM -0500 6/20/06, Rob W. wrote: >- Original Message - From: "Jochem Maas" <[EMAIL PROTECTED]> >To: "Rob W." <[EMAIL PROTECTED]> >Cc: >Sent: Tuesday, June 20, 2006 4:13 AM >Subject: Re: [PHP] Still trying to figure this out... > > >snip > Ahhh crap -- does this mean none of us get

Re: [PHP] Still trying to figure this out...

2006-06-20 Thread tedd
At 11:43 AM +0200 6/20/06, Jochem Maas wrote: > > >a, whether you or anyone else *wants* my opinion is irrelevant. >b, I'm quite sure there are a couple of people here that appreciate at least >*some* of my input on this list. You can count me into that "couple of people" group. I've always found

Re: [PHP] comparing a string

2006-06-20 Thread Larry Garfield
= is the assignment operator. It is not a comparison. == is the weak equality comparator. === is the strong equality comparator. On Tuesday 20 June 2006 06:43, Ross wrote: > I have a quiz where the ansers are held in a array called $correct answers. > When I compare the string > > if ($_REQUE

[PHP] Re: User Login Problem

2006-06-20 Thread Barry
suresh kumar schrieb: Hi, I am facing one problem in my project.i want to restrict more than one user login in the same account . Is there any functions available to check r we can implement using session. Nothing specialized than that. Barry -- Smileys rule (cX.x)C --o(^_^o) Dance f

Re: [PHP] User Login Problem

2006-06-20 Thread Dan McCullough
Or make your own, might be easier to do. On 6/20/06, suresh kumar <[EMAIL PROTECTED]> wrote: Hi, I am facing one problem in my project.i want to restrict more than one user login in the same account .Is there any functions available to check r we can implement using session.

[PHP] Re: comparing a string

2006-06-20 Thread Rafael
(inline) Ross wrote: I have a quiz where the ansers are held in a array called $correct answers. When I compare the string if ($_REQUEST['x']= $correct_answers[$page-1]) { with a double == the answer is always correct with the single = it is always wrong. A single "=" it's an assignment,

Re: [PHP] User Login Problem

2006-06-20 Thread Jochem Maas
suresh kumar wrote: > Hi, > I am facing one problem in my project.i want to restrict more than one > user login in the same account .Is there any functions available to check r > we can implement using session. probably. >

[PHP] User Login Problem

2006-06-20 Thread suresh kumar
Hi, I am facing one problem in my project.i want to restrict more than one user login in the same account .Is there any functions available to check r we can implement using session. A.suresh

[PHP] comparing a string

2006-06-20 Thread Ross
I have a quiz where the ansers are held in a array called $correct answers. When I compare the string if ($_REQUEST['x']= $correct_answers[$page-1]) { with a double == the answer is always correct with the single = it is always wrong. when I echo out the posted answer and the value from the

Re: [PHP] Still trying to figure this out...

2006-06-20 Thread Jochem Maas
Rob W. wrote: > ... > > Dont complain about people asking for help when that is what this list > is for. I wasn't complaining Rob, merely trying to point out that 'help' != 'do my work for me' > >> >>> that's why this list is here, >> >> really, could you please quote your support contract n

Re: [PHP] Still trying to figure this out...

2006-06-20 Thread Rob W.
- Original Message - From: "Jochem Maas" <[EMAIL PROTECTED]> To: "Rob W." <[EMAIL PROTECTED]> Cc: Sent: Tuesday, June 20, 2006 4:13 AM Subject: Re: [PHP] Still trying to figure this out... Rob W. wrote: Ya know, after working on this for 2 days straight, I have tried my own so wh

Re: [PHP] Still trying to figure this out...

2006-06-20 Thread Jochem Maas
Rob W. wrote: > Ya know, after working on this for 2 days straight, I have tried my own so what. > work. I never said I was an expert at php, neither did I. > that's why this list is here, really, could you please quote your support contract number. > so the next time you critisize someone,

Re: [PHP] Still trying to figure this out...

2006-06-20 Thread Rob W.
Yes, I do have it setup right to display my errors, the reason why I wasnt getting any input is because when the array was matched to range(1,24) and the other array had nothing in it, I was either getting a list of numbers 1 though 24 or nothing at all. - Rob - Original Message - Fr

Re: [PHP] Still trying to figure this out...

2006-06-20 Thread Stut
Rob W. wrote: Ya know, after working on this for 2 days straight, I have tried my own work. I never said I was an expert at php, that's why this list is here, so the next time you critisize someone, keep it to your self cause no one cares to hear about it. If you dont wanna help, then stfu. J

Re: [PHP] Still trying to figure this out...

2006-06-20 Thread Rob W.
Ya know, after working on this for 2 days straight, I have tried my own work. I never said I was an expert at php, that's why this list is here, so the next time you critisize someone, keep it to your self cause no one cares to hear about it. If you dont wanna help, then stfu. - Original

Re: [PHP] Still trying to figure this out...

2006-06-20 Thread Jochem Maas
Rob W. wrote: > OMG Chris, Thankyou very much. That is exactally what I needed. If you > wish for me to pay you some amount, I will be very happy to. Please send > me a private email where I can paypal you. If not, Thank you again very > much for the help. just do us all a favor and only come back

[PHP] pear xml_serializer

2006-06-20 Thread weetat
Hi all, I am using PEAR:XML_Serializer to unserializer our customer xml file. However in some customer xml file , there are some value in xml which are not unicode , for example as shown below: I need to amended the value above to be empty. Anyone have any suggestion how to do this ? Than

Re: [PHP] GET, POST, REQUEST

2006-06-20 Thread Satyam
- Original Message - From: "Richard Lynch" <[EMAIL PROTECTED]> On Sun, June 18, 2006 2:19 am, Satyam wrote: - Original Message - From: "Rory Browne" <[EMAIL PROTECTED]> Good code won't be vulnerable to register_globals either, but having register_globals on is a security probl