[PHP] how to redirect to other page?
i have used header to redirect to other page. however, it has said that i have written something out the screen before header. would anyone please to help me? the following is all my code. The above function "checkUser" just used to check whether the user exist or not. nothing will be written out to the screen if the user is found in the database. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Running php code inside of a string within a php script..
Writing the string to a file and then include()ing it would work. It does seem a bit heavy handed, but unless there's a string equivelant of include() this may actually be the best way. Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -Original Message- > From: Aviv Revach [mailto:[EMAIL PROTECTED]] > Sent: 01 March 2001 18:02 > To: Lucas Persona; php-list > Subject: Re: [PHP] Running php code inside of a string within a php > script.. > > > Hey! > > At 14:29 02/03/01 -0300, Lucas Persona wrote: > >Hy there! > > > >Aviv Revach wrote: > > > How can I make those php3 commands to work as they supposed to? > > > > Take a look at the eval() function > >http://www.php.net/manual/en/function.eval.php > > It does exactly what you are looking for... > > Actually it doesn't. My string does not(!!) contains only php code. > It contains HTML tags, text, and php code (called with ). > > Now, What should I do in order to run both the html tags and > the php commands > in it? > > > Thank you in advance - > >Aviv Revach > > BRILLIANeT Website - >http://www.brillianet.com/ > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] NETSCAPE screws up query string : more problems!
On Sunday 04 March 2001 20:38, you wrote: > Julian, > i tried : > > href=\"pro_page1.php3?title=".urlencode($myrow[title])."\"> > > instead > > href=\"pro_page1.php3?title='".urlencode($myrow[title])."'\"> > > notice the single quote ' missing. And that WORKED!!! > It displayed the right value in the next PHP page. > Unfortunately there's another problem. it only > DISPLAYED the right value...but when it adds the value > in the database...it adds with the plus + sign. i.e., > it adds : Project+One instead of Project One. try rawurlencode instead of urlencode -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Very funny, Scotty! Now beam up my clothes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Get remote IP ot Host
Hi, I have problem with "REMOTE_ADDR" or "REMOTE_DOST". "REMOTE_ADDR" always return me 127.0.0.1 (localhost) !!! The php program is on remote server ( not locally ) - www.f2s.com. How can I get IP or HOST of the visitor ? Thanks, Rosen Marinov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
php-general Digest 5 Mar 2001 09:43:25 -0000 Issue 548
php-general Digest 5 Mar 2001 09:43:25 - Issue 548 Topics (messages 42526 through 42592): question about php sessions 42526 by: Ed Lazor User login using session algorithm 42527 by: Arcady Genkin NEWEST CRAZE 42528 by: newmarketing5644.juno.com anchor "#" not working? 42529 by: andrew 42530 by: Brian White 42531 by: Simon Garner 42534 by: andrew 42538 by: Don Read 42545 by: Brian White 42547 by: Brian White Re: IE 5.5,authentication,PHP sessions: IE never stops 42532 by: Michael A. Peters 42552 by: Ken 42553 by: Ken 42557 by: Simon Garner 42559 by: Ken 42560 by: Simon Garner 42563 by: Mitchell Kirschner 42572 by: Ken 42574 by: Ed Lazor 42575 by: Simon Garner 42577 by: Don Read Day of the Week 42533 by: Chris Anderson 42535 by: Alexander Wagner Please help!! how to compare an array with another 42536 by: Jimmy Bäckström php, secure pages & htdig 42537 by: Miles Thompson Re: PHP & PostgreSQL 42539 by: Andrew Halliday configure for WDDX functions 42540 by: Tom Why doesnt pass-by-value work? 42541 by: Andrew Halliday 42544 by: Andrew Halliday How to connect to PostgreSQL with phpPgAdmin 42542 by: Paulo Parola Re: Change the Input to st different.. 42543 by: David Robley undefined symbol: xmlXPtrNewContext 42546 by: Jack Lauman Re: date 42548 by: Michael Hall 42550 by: Simon Garner Re: Running php code inside of a string within a php script.. 42549 by: Jovan Sedlan 42590 by: Tim Ward connecting do MS Access... 42551 by: Christian Dechery Unix-time problem 42554 by: Nicklas af Ekenstam 42566 by: Don Read simple OO question 42555 by: John LYC 42556 by: Andrew Halliday 42562 by: John LYC 42573 by: Andrew Halliday 42576 by: Andrew Halliday Question 42558 by: Deependra B. Tandukar Page not found error 42561 by: Randy Johnson 42564 by: Lewis Bergman mail problem 42565 by: Peter Houchin 42567 by: David Robley what does $$ mean? 42568 by: Ed Lazor 42569 by: Jason Murray 42578 by: Philip Olson Re: Problem getting PostgreSQL to compile 42570 by: K Old max array size question.. 42571 by: Jeff Re: Re : [PHP] NETSCAPE screws QUERY STRING 42579 by: John LYC File Upload doesn't work with Netscape Serious problem! 42580 by: Dhaval Desai Function to compare an array with another array 42581 by: Jimmy Bäckström Object Oriented Databases 42582 by: Fabian Fabela dealing with no record 42583 by: Jacky.lilst 42586 by: David Robley NETSCAPE screw query string : THANKS ALL ! SOLVED!! 42584 by: Thomas Edison Jr. Re: PHP web based mailing list administrator 42585 by: Manuel Lemos comparing values 42587 by: Paul Re: IE 5.5,authentication,PHP sessions: IE never stops running? 42588 by: Harshdeep S Jawanda how to redirect to other page? 42589 by: JW Re: NETSCAPE screws up query string : more problems! 42591 by: Christian Reiniger Get remote IP ot Host 42592 by: Rosen Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- Hi =) Is it possible to track a user session across multiple domains? We have several related web sites and want to enable a user to login through one site and end up logged in to them all. I tested and it didn't work and I'm guessing it's a limitation of cookies. As in, a cookie created under one domain isn't available to another. Is this right or is there a way to accomplish what I'm talking about? Thanks =) -Ed I'm planning to write a simple user login module. I want it to be a stand-alone class, and not rely on cookies (I'm passing all variables via GET method anyways, so I just want to pass a session ID in the URL). Before I go ahead and do some mistake, could somebody have a look at the outline of the algorithm I've come up with? Any opinions greately appreciated. http://www.thpoon.com/~antipode/tmp/user_auth.png The algorithm is presented as a flowchart. p.s. I'd like to "roll my own", even though I know that there is authentication code available. Many thanks, -- Arcady Genkin Nostalgia isn't what it used to be. Hey...Janet Here... We Haven't Talked In So Long!! How Have You Been? Thought I would Forward you this email! I usually delete these but I opened this one, like what I saw, and thought you would like to see this. http://www.geocities.com/anewmarket/ IF THE LINK IS NOT HIGHLIG
[PHP] RE: function questions
why are you using this construct instead of echo()? e.g. echo("Hey there " . foo::bar($baz) . " how are you doing?"); Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -Original Message- > From: kevin1 [mailto:[EMAIL PROTECTED]] > Sent: 02 March 2001 09:57 > To: php-general > Subject: function questions > > > I have a here doc: > > print << Hey there foo::bar($baz) how are you doing? > END; > > foo::bar is a method that returns the name of $baz. I can't > seem to get > that to interpolate properly. It would make my life cleaner > and easier > if this could work. Is this at all possible? > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Is it possible to get call stack information?
Is there anyway within PHP to get a complete dump of the call-stack? I can't use the Zend debugger for technical reasons (awaiting bug fix before it will work in our environment). I'd love to have a call that would return an array of call stack info. to the current line. Thanks, Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Get remote IP ot Host
> I have problem with "REMOTE_ADDR" or "REMOTE_DOST". > > "REMOTE_ADDR" always return me 127.0.0.1 (localhost) !!! > The php program is on remote server ( not locally ) - www.f2s.com. > > How can I get IP or HOST of the visitor ? The problem might be, there is a proxy / redirection on the same server. You might try HTTP_X_FORWARDED_FOR. ( or so... try test.php3 for exact info... ) -- Krankenhaus Martha-Maria Nuernberg EDV-Organisation Michael Meinl Tel: 0911/959-1493 -1493 Fax: 0911/959-1412 -1422 --- Linux - The choice of the GNU generation -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] help gurus: multi-dimensional array problem.
andrew wrote: > > Because I want to display it like this: > > category1 (href anchor to category1 below) > category2 > category3 > > category1 > link1 > link2 > link3 > > category2 > link1 > etc... > Hello, Ever heard of mysql_data_seek()? Have a look in the PHP Docs. Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP & Apache 2.0
Do someone know when PHP will work as apixs under Apache 2.0 ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] dealing with no record
"Jacky@lilst" wrote: > > People > If I run a sniplet like this: > > ** > $query="select name from foo"; > $result= mysql_query($query); > while($row = mysql_fetch_row($result)) > stuff...to display record found > ... > *** > what am I suppose to do if I also want the code to be able to deal with the case >that no record found and redirect user to other page? Hello, In the PHP Manual, section MySQL, there is a description of a function called mysql_num_rows()... Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: Function to compare an array with another array
function ArrayCompare($array1, $array2) { $answer = new Array() foreach ($array1 as $element) { if (($key = array_search($element, $array2)) === false) { $answer[$key] = $array2[$key]; } } return $answer; } this will return an array that is a copy of the first array with only those elements that are not in array2. If you only want the first one either just use the first one( foreach(){ ... break;}) or put a break in the if. Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -Original Message- > From: Jimmy Bäckström [mailto:[EMAIL PROTECTED]] > Sent: 05 March 2001 06:38 > To: PHP General List > Subject: Function to compare an array with another array > > > Shu! > I need some help here. > I have a script where I want to compare two arrays with > eachother, and return one value from that does not exists in > both arrays. I have an array of pictures id number created > from a database query. I use sessions to save id numbers of > pictures into an array. I want the first array to be compared > to the second and return the first key/value-pair that are > not found in the session array... > Is there a way I can do this? > > Thankful for any help! > /Broder B > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] subscribe my mail-id for PHP mailing lists
dear sir can you please subscribe my mail-id for PHP mailing group lists Thanks in advance satish -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to redirect to other page?
On Mon, 5 Mar 2001, JW wrote: > i have used header to redirect to other page. [cut] > if ($result == false) > { > header ("HTTP/1.0 404 Not Found"); > exit; > } > else > { > header ("../Form/first.html"); ^ According to RFC, you should use: header('302 Moved'); header('Location: http://new.location.com'); Greets, Batonik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] apache does not understand php3
hi, i have installed php4. from my browser i can read php .. but not php3. what should i do? regards, marcos [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Is PHP ready for XML?
I am beginning on how to work with xml, but i need some prelim help. let us say i have an XML file as follows: --- Jonathan Swift Gulliver's Travels Agatha Christie Murder on 57 --- I want to know if PHP supports the following to do with the above file: - How to list the above information on a HTML page (I mean using PHP of course) - in tables.Which functions should I use, EXPAT functions or DOM functions? (Whats the difference?) - What if I need to search through a XML file? How would I go about doing it - recommended way? - What if I needed to add a new tag to all the BOOKS in the XML file. For instance, 2390737-380973 How would I do this for all the books in my XML file? I'd appreciate any help! Thanks! Erick. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.230 / Virus Database: 111 - Release Date: 25-Jan-01 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Inserting DATE in mySQL!!
I'm using the following code to insert date into my mySQL table named "Booking". I've created variables that store the date with dashes "-" seperating them. But it's not working. It's giving me an error on the $SQl line. following is the code : ?? Cheers, T. Edison jr. = Rahul S. Johari (Director) ** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : [EMAIL PROTECTED] Tel : 91-4546512/4522124 *** __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Inserting DATE in mySQL!!
What field type are you using to store time? Echo your $sql and compare it to MySQL's documentation on the time column and how you have defined the field. Miles At 03:51 AM 3/5/01 -0800, Thomas Edison Jr. wrote: >I'm using the following code to insert date into my >mySQL table named "Booking". I've created variables >that store the date with dashes "-" seperating them. >But it's not working. It's giving me an error on the >$SQl line. > >following is the code : > > $db = mysql_connect("localhost","root"); > mysql_select_db("motorola",$db); > $realsdate="$syear"."-"."$smonth"."-"."$stdate"; > $realedate="$eyear"."-"."$emonth"."-"."$endate"; > $realstime="$shh".":"."$smm"."-"."$sttime"; > $realetime="$ehh".":"."$emm"."-"."$entime"; > $sql = INSERT INTO booking >(room,sdate,edate,stime,etime,purpose,reserved) VALUES >('$rooms','$realsdate','$realedate','$realstime','$realetime','$purpose','$res'); > $result = mysql_query($sql) or Die ("An unexpected >error occured. Please go back and book again."); >?> > >?? >Cheers, >T. Edison jr. > > >= >Rahul S. Johari (Director) >** >Abraxas Technologies Inc. >Homepage : http://www.abraxastech.com >Email : [EMAIL PROTECTED] >Tel : 91-4546512/4522124 >*** > >__ >Do You Yahoo!? >Get email at your own domain with Yahoo! Mail. >http://personal.mail.yahoo.com/ > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] help functions
Has anyone spent any time and thought into including help within the library, ie. so you could do a. mysql.connect().help() or something like that so as a developer addeds a new function we as end users might be able to understand the function. Most likely by creating a help file to return to the browser because right now I'm finding a lot of undocumentented features. thanks, evan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] apache does not understand php3
Hello Marcos, In your httpd.conf file there's a line that looks similar to: AddType application/x-httpd-php4 .php4 .phtml Just add the php3 extension. It should be something like this: AddType application/x-httpd-php4 .php4 .phtml .php3 HTH Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] help gurus: multi-dimensional array problem.
Get a list of unique categories then get a list of each one would do it. $link_id = mysql_connect($host, $usr, $pass) or die (mysql_error()); mysql_select_db($database, $link_id); $sql="select distinct category from links"; $result = mysql_query($sql, $link_id) or die ("no results"); $cat_list = new Array(); while ($row=mysql_fetch_array($result)) { $cat_list[] = $row["category"]; echo("$category"); }; foreach ($cat_list as $this_Cat) { echo("$this_Cat"); $sql="select name, url from links where category = '$this_Cat'"; $result = mysql_query($sql, $link_id); while ($row=mysql_fetch_array($result)) { echo ("" . $row["name"] . ""); }; } haven't tested this but the principal should be okay and do what you're after Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -Original Message- > From: andrew [mailto:[EMAIL PROTECTED]] > Sent: 03 March 2001 19:59 > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [PHP] help gurus: multi-dimensional array problem. > > > Because I want to display it like this: > > > category1 (href anchor to category1 below) > category2 > category3 > > > category1 > link1 > link2 > link3 > > category2 > link1 > etc... > > > > On 3/3/01 2:49 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > Addressed to: andrew <[EMAIL PROTECTED]> > > [EMAIL PROTECTED] > > > > ** Reply to note from andrew <[EMAIL PROTECTED]> Sat, > 03 Mar 2001 14:26:30 > > -0500 > >> > >> help! :)> > >> > >> I'm trying to return a list of links under associated > categories from a > >> database table that has the fields: "linkID, category, name, url". > >> > >> I'm selecting the fields and then trying to construct a > multi-dimensional > >> array so that the correct items get put into it (and then > printed out): > >> > > > > Why build an array, and store ANOTHER copy of all the data in memory > > while the script runs? That is just a waste of memory... > > > > > > SELECT Category, Name, URL FROM Links ORDER BY Category, Name; > > > > > > > > To display them: > > > > $OldCategory = ''; > > > > while( list( $Category, $Name, $URL ) = mysql_fetch_row( > $Result )) { > > > > if( $OldCategory != $Category ) { > > print "Category Header $Category\n"; > > > > $OldCategory = $Category; > > } > > > > print "$Name\n"; > > } > > > > > > > > > > > > Rick Widmer > > Internet Marketing Specialists > > http://www.developersdesk.com > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Inserting DATE in mySQL!!
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("Thomas Edison Jr.") wrote: > I'm using the following code to insert date into my > mySQL table named "Booking". I've created variables > that store the date with dashes "-" seperating them. > But it's not working. It's giving me an error on the > $SQl line. > > following is the code : > > $db = mysql_connect("localhost","root"); > mysql_select_db("motorola",$db); > $realsdate="$syear"."-"."$smonth"."-"."$stdate"; > $realedate="$eyear"."-"."$emonth"."-"."$endate"; > $realstime="$shh".":"."$smm"."-"."$sttime"; > $realetime="$ehh".":"."$emm"."-"."$entime"; > $sql = INSERT INTO booking > (room,sdate,edate,stime,etime,purpose,reserved) VALUES > ('$rooms','$realsdate','$realedate','$realstime','$realetime','$purpose','$res > '); > $result = mysql_query($sql) or Die ("An unexpected > error occured. Please go back and book again."); > ?> Your value for the variable "sql" isn't enclosed in quotes. BTW, tracking down problems with a sql query gets easier when you give yourself a more informative die() message, such as: or die ("MySQL says: " . mysql_errorno() . " " . mysql_error() . "\nPHP says: $errormsg"); -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Inserting DATE in mySQL!!
CC Zona [[EMAIL PROTECTED]] wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] ("Thomas Edison Jr.") wrote: > > > I'm using the following code to insert date into my > > mySQL table named "Booking". I've created variables > > that store the date with dashes "-" seperating them. > > But it's not working. It's giving me an error on the > > $SQl line. > > > > following is the code : > > > > > $db = mysql_connect("localhost","root"); > > mysql_select_db("motorola",$db); > > $realsdate="$syear"."-"."$smonth"."-"."$stdate"; > > $realedate="$eyear"."-"."$emonth"."-"."$endate"; > > $realstime="$shh".":"."$smm"."-"."$sttime"; > > $realetime="$ehh".":"."$emm"."-"."$entime"; > > $sql = INSERT INTO booking > > (room,sdate,edate,stime,etime,purpose,reserved) VALUES > > ('$rooms','$realsdate','$realedate','$realstime','$realetime','$purpose','$res > > '); > > $result = mysql_query($sql) or Die ("An unexpected > > error occured. Please go back and book again."); > > ?> > > Your value for the variable "sql" isn't enclosed in quotes. BTW, tracking > down problems with a sql query gets easier when you give yourself a more > informative die() message, such as: > > or die ("MySQL says: " . mysql_errorno() . " " . mysql_error() . "\nPHP ^ Just a technicality, but I think I remember this to be mysql_errno(). But CC is right - in your "die", give yourself as much info about the error as possible. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com > says: $errormsg"); > > -- > CC > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] help functions
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("Montgomery-Recht, Evan") wrote: > Has anyone spent any time and thought into including help within the > library, ie. so you could do a. > > mysql.connect().help() or something like that so as a developer addeds a new > function we as end users might be able to understand the function. Most > likely by creating a help file to return to the browser because right now > I'm finding a lot of undocumentented features. But at the point where a function would be sufficently documented to have this built-in help file, wouldn't the same information be readily available in the online manual? -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Inserting DATE in mySQL!!
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Hardy Merrill) wrote: > > or die ("MySQL says: " . mysql_errorno() . " " . mysql_error() . "\nPHP > ^ > > Just a technicality, but I think I remember this to be > mysql_errno(). But CC is right - in your "die", give yourself > as much info about the error as possible. Oops, you're right about the typo. Sorry about that. It's *very late at night here. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] HREFs that can't be
> > How is 3 different from 1? > 1: http://www.somedomain.com/program.php?parm1=value1 > 3: http://www.somedomain.com/program.php/value1 > $PATF_INFO now contains '/value1' Ahh. > This is pretty much acceptable to search engines. Even better add: > > ForceType application/x-httpd-php > > to httpd.conf. Then the following url will work: > http://www.somedomain.com/program/value1/value2/command.php > program _is_ the program. $PATH_INFO containls: >'/value1/value2/command.php' I've tried setting this up, but for the life of me, I could not get it to work. I've just settled with including the ".php" after the program name and that works just as well... http://www.somedomain.com/program.php/value1/value2/command.php --^^ > Which you can: $Params = explode( '/', $PATH_INFO ); and > get an array: >$Params[0] : value1 >$Params[1] : value2 >$Params[2] : command.php Yup. I do this, but using the above. > > > Why do you want to eliminate all get params and cookies? > > > That might > > > have a lot of control as to what the best approach will be. > > GET because they can be modified and > So can these URL based param passing schemes. Even POST > params are not all that secure from a determined hacker. All it > takes is a little work with a program to fake POST values. The > only advantage they have is taking a little more work. Yes, I know. But that little extra work is enough. Plus, we are going to try a few things (including encrypting; not one way) the hidden variables. That and trying to make sure that the form submission request originated from our server. I'm still trying to find the answer as to when HTTP_REFERER is available and when it isn't... still haven't heard anything back on that one... > > Cookies because not all users will have them turned on. > Good reason. > If you don't care about serach engines, you can just use PHP4 sessions, > and append the session ID, or compile with --enable-trans-sid and let > php use cookies when available or place the session ID in the URN if > they are not. As I've mentioned in another post, this is *not* working. We have that directive turned on/compiled in and it still does not append the session ID to URLs if the user's browser does not accept cookies. I submitted a few code samples last week that I set up to demonstrated this. Everything looks ok in the php.ini and everything that needed to be was turned on when PHP4 (we are using 4.0.3pl1) was compiled, but still the session ID is not being appended to the URL. I wish I knew what was wrong. Chris
Re: [PHP] help gurus: multi-dimensional array problem.
Tim Ward wrote: > > Get a list of unique categories then get a list of each one would do it. > > $link_id = mysql_connect($host, $usr, $pass) or die (mysql_error()); > mysql_select_db($database, $link_id); > $sql="select distinct category from links"; > $result = mysql_query($sql, $link_id) or die ("no results"); > $cat_list = new Array(); > while ($row=mysql_fetch_array($result)) > { $cat_list[] = $row["category"]; > echo(" href=\"$PHP_SELF?#$category\">$category"); > }; > > foreach ($cat_list as $this_Cat) > { echo("$this_Cat"); > $sql="select name, url from links where category = > '$this_Cat'"; > $result = mysql_query($sql, $link_id); > while ($row=mysql_fetch_array($result)) > { echo ("" . $row["name"] > . ""); > }; > } > > haven't tested this but the principal should be okay and do what you're > after > > Tim Ward > Senior Systems Engineer > Hello, This sulution is not very good: too many SELECTs, too much memory usage... Why not just use 2 Tables: Category and Links, and work with a LEFT JOIN? Then you could get all data needed with a single SQL statment, no additional arrays would be needed, either. Don't forget: MySQL is a RELATIONAL database - Why not make usage of it? Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] undefined symbol: xmlXPtrNewContext
I'm having the exact same problem, did someone find a way to correct that problem Evething looks good when compiling, the error occured when I try to start Apache. I am using sablotron 0.51 with libxmlparse and libxmltok that came from the Sablotron RPM version 0.44 (because I could not find them anywhere else). Regards, Sebastien Roy PHP programmer [EMAIL PROTECTED] Jack Lauman wrote: > I get the following error when I attempt to start Apache 1.3.19 > (RedHad 7.0): > > apachectl start > > Syntax error on line 230 of /etc/httpd/conf/httpd.conf: > Cannot load /usr/lib/apache/libphp4.so into server: > /usr/lib/apache/libphp4.so: > undefined symbol: xmlXPtrNewContext > /usr/sbin/apachectl start: httpd could not be started > > I'm using libxml 2.3.3, and I assume the error is from the ./configure > statement --xith-dom > > I'd appreciate any suggestions on how to resolve it. > > TIA > > Jack > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Problem getting PostgreSQL to compile
On Mon, 5 Mar 2001, K Old wrote: > Yes, I've checked phpinfo() and not it is not compiled in. That is the > problem. I have recompiled PHP with pgsql support and there is some > problem. I'm not sure why it isn't compiling it in. I've tried everything > I knowthe installation goes fine...no error messages, everything seems > ok. > > Any ideas? when you run configure, the status messages that are output, do they list pgsql as being found? even with --with-pgsql enabled, if it can't find the libraries or header files, it will re-disable it again ... > > > >From: The Hermit Hacker <[EMAIL PROTECTED]> > >To: K Old <[EMAIL PROTECTED]> > >CC: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> > >Subject: Re: [PHP] Problem getting PostgreSQL to compile > >Date: Fri, 2 Mar 2001 22:30:11 -0400 (AST) > > > > > >have you checked phpinfo() to make sure that pgsql support is actually > >compiled in? if so, any errors on connection, or just silently fails? > > > >On Fri, 2 Mar 2001, K Old wrote: > > > > > Hello, > > > > > > I'm running RH 7 and Apache. I have the latest version of PostgreSQL > >and it > > > is installed and running correctly. I have installed PHP with the > > > --with-pgsql and it seems to install everything needed, but when I try > >to > > > use pg_connect() it fails to connect. Any ideas what I can do? > > > > > > Thanks, > > > Kevin > > > [EMAIL PROTECTED] > > > _ > > > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > >Marc G. Fournier ICQ#7615664 IRC Nick: > >Scrappy > >Systems Administrator @ hub.org > >primary: [EMAIL PROTECTED] secondary: > >scrappy@{freebsd|postgresql}.org > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > _ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy Systems Administrator @ hub.org primary: [EMAIL PROTECTED] secondary: scrappy@{freebsd|postgresql}.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Help Please: Php configuration
Thanks a lot!!! Yes it is working now with both cgi as well as php4isapi.dll. I removed php4isapi.dll from filter, which was crashing my web server. From: "Phil Driscoll" <[EMAIL PROTECTED]> To: "archana sharma" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> Subject: Re: [PHP] Help Please: Php configuration Date: Sun, 4 Mar 2001 14:33:36 - MIME-Version: 1.0 Received: from [194.217.242.88] by hotmail.com (3.2) with ESMTP id MHotMailBC6B9E89006440043213C2D9F2580DFB0; Sun Mar 04 06:39:06 2001 Received: from dialsolutions3.demon.co.uk ([194.222.141.102] helo=philsntserver)by anchor-post-30.mail.demon.net with smtp (Exim 2.12 #1)id 14ZZdR-000FX1-0U; Sun, 4 Mar 2001 14:37:21 + >From [EMAIL PROTECTED] Sun Mar 04 06:40:49 2001 Message-ID: <011001c0a4b8$445fca40$0c81@philsntserver> X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 I'm guessing that you are adding the ISAPI version of php. If so, try installing it as a CGI instead (set the script mappings to php.exe instead of php4isapi.dll and remove php4isapi.dll from the filters list). Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] max array size question..
Jeff wrote: > > I'm trying to read in a text file that has 42620 lines. Each line has > zip code information separated by commas. I have no problem reading the > file into an array. But when I try and read each element in the array > and put it into another array I get a "500 server error". The second to > last line is what's causing the problem. > > After doing some debugging I found out that at around iteration 18000 is > when the server error occurs. Any ideas? I know I should use a > database, but i'm intrigued by this problem. Check out if the memory usage is overrun; check if timeout occurs. (Your probgram isn't much help without the data) -- Paul K Egell-Johnsen Developer/PR Manager eZ systems as http://ez.no/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] delete an element from an array
Hi! how can i decrement the length of an array! In fact i'm trying to delete an element from an array , i'v put the content of i in i-1 (loop) and i tried to decrement the array legnththis way: count($x)=count($x)-1; but it generates an error! Thanks _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] input textfield value cat!
Hi! i'm storing values in session variables, when i get a value wich is a sequence of words seperated by space, it echoes successfully but when i try to initialize the value of an input textfield with it i got only the first word! i tried to encode decode but no way ! Thanks _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /sapi/cgi cgi_main.c
sniper Mon Mar 5 07:08:36 2001 EDT Modified files: /php4/sapi/cgi cgi_main.c Log: Fix help text for -f Index: php4/sapi/cgi/cgi_main.c diff -u php4/sapi/cgi/cgi_main.c:1.97 php4/sapi/cgi/cgi_main.c:1.98 --- php4/sapi/cgi/cgi_main.c:1.97 Sun Mar 4 17:26:36 2001 +++ php4/sapi/cgi/cgi_main.cMon Mar 5 07:08:36 2001 @@ -241,13 +241,10 @@ prog = "php"; } - php_printf("Usage: %s [-q] [-h]" - " [-s]" - " [-v] [-i] [-f ] | " - "{ [args...]}\n" + php_printf("Usage: %s [-q] [-h] [-s [-v] [-i] [-f ] | { +[args...]}\n" " -q Quiet-mode. Suppress HTTP Header output.\n" " -s Display colour syntax highlighted source.\n" - " -f Parse . Implies `-q'\n" + " -f Parse . Implies `-q'\n" " -v Version number\n" " -c Look for php.ini file in this directory\n" #if SUPPORT_INTERACTIVE -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] delete an element from an array
I'm not sure what you mean - are you trying to remove an element from the array while you are *inside* a loop that is iterating through that same array? If the loop is small enough, copy it in so we can all see what you are trying to do. kaab kaoutar [[EMAIL PROTECTED]] wrote: > Hi! > how can i decrement the length of an array! > In fact i'm trying to delete an element from an array , i'v put the content > of i in i-1 (loop) and i tried to decrement the array legnththis way: > count($x)=count($x)-1; > but it generates an error! > > Thanks > > _ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] delete an element from an array
Hi! FIRST OF ALL THANKS ! well do u mean that the only way to remove an elemnt from an array is to copy it into another array? it does not suit me cause the array is a session variable and i need to update it ! Thanks _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] delete an element from an array
Have a look at http://www.php.net/manual/en/function.unset.php "unset" may do what you want. HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com kaab kaoutar [[EMAIL PROTECTED]] wrote: > > Hi! > FIRST OF ALL THANKS ! > well do u mean that the only way to remove an elemnt from an array is to > copy it into another array? it does not suit me cause the array is a session > variable and i need to update it ! > > Thanks > _ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Match Records
I`m trying to find the best method to match records between two tables in a MySQL database. But it must match atleast once, so here is a scenario for you to think about. Member - Job, Salary, Location Jobs - Job, Salary, Location All values will be enum sets in both tables as follows Job = enum 'developer','designer','none' Salary = enum '10K','15K','none' Location = enum 'usa','uk','none' Ok so the user has come to the site and I have his Job Salary and Location stored, he clicks a link which then performs the search. His values are as follows.. Job = developer, Salary = 10K, Location = uk I want to search the Jobs table and match it with the above, this part I can do. The next stage is if it doesn`t find any matches it then finds the nearest. So if the only record I have in the Jobs table is as follows Job = developer, Salary = none, Location = uk How do I go about making it pick up the nearest. At the moment I am using SELECT * FROM Jobs where Job='$Job' and Salary='$Salary' and Location='$Location' So obviously it won`t match them, anyone wake me up from my slumber and help me out with this? Cheers Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] delete an element from an array
Thanks! but i know this function! i can't do that cause my varibale is multidimenssional, and i don't want to update all that ! for one element ! we can't decrement the length of the array ?! no way ? >From: Hardy Merrill <[EMAIL PROTECTED]> >To: kaab kaoutar <[EMAIL PROTECTED]> >CC: [EMAIL PROTECTED] >Subject: Re: [PHP] delete an element from an array >Date: Mon, 5 Mar 2001 10:57:49 -0500 > >Have a look at > > http://www.php.net/manual/en/function.unset.php > >"unset" may do what you want. > >HTH. > >-- >Hardy Merrill >Mission Critical Linux, Inc. >http://www.missioncriticallinux.com > >kaab kaoutar [[EMAIL PROTECTED]] wrote: > > > > Hi! > > FIRST OF ALL THANKS ! > > well do u mean that the only way to remove an elemnt from an array is to > > copy it into another array? it does not suit me cause the array is a >session > > variable and i need to update it ! > > > > Thanks > > >_ > > Get Your Private, Free E-mail from MSN Hotmail at >http://www.hotmail.com. > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] MySQL - Problem with multiple INSERTs?
Howdy, I'm getting weird problems trying to INSERT to two different tables, in consecutive mysql_queries. Before, I had 3 queries going, and only 2 would work at any time. It seemed like it was 'rotating' the bad query - first the 1st query would fail (the other two were fine), then I'd empty all my tables and refresh, and this time the 2nd query was the problem, and if I did it again the 3rd was. All queries worked fine in phpMyAdmin, both individually and when executed en masse. I've boiled it down to just two queries that don't work. I've included everything below (including table schemata), to enable reproduction. It seems like a bug to me - the question is, is the bug in PHP, MySQL, or my brain? This is driving me CRAZY - Chris mysql_connect("localhost", "myusername", "mypassword"); mysql_db_query("DocCountry", "INSERT INTO projects (idCreator, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); mysql_db_query("DocCountry", "INSERT INTO files (idProject, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); CREATE TABLE projects ( id int(11) NOT NULL auto_increment, timestamp timestamp(14), idCreator int(11) DEFAULT '0' NOT NULL, name varchar(80) NOT NULL, comment text NOT NULL, authLevel varchar(32) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE files ( id tinyint(4) NOT NULL auto_increment, idProject tinyint(4) DEFAULT '0' NOT NULL, name tinyint(4) DEFAULT '0' NOT NULL, comment text NOT NULL, PRIMARY KEY (id) ); (P.S. I've tried things like using SET syntax, using mysql_query instead of mysql_db_query, etc. Nothing helps.) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] stumped on mailing a complete page
On 3 Mar 2001 17:17:15 -0800, Brett <[EMAIL PROTECTED]> wrote: >I want to send a confirmation email upon receiving an order, and would like >to send the page that I display on the browser to the user. ob_start(); // do something mail('confirm@somewhere', 'confirmation', ob_get_contents()); ob_end_flush(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] input textfield value cat!
I'm using a variable! > >From: "Brad S. Jackson" <[EMAIL PROTECTED]> >To: "kaab kaoutar" <[EMAIL PROTECTED]> >Subject: Re: [PHP] input textfield value cat! >Date: Mon, 5 Mar 2001 10:08:21 -0600 > > > >Make sure you have quotes around the value. > > > > >Hi! >i'm storing values in session variables, when i get a value wich is a >sequence of words seperated by space, it echoes successfully but when i try >to initialize the value of an input textfield with it i got only the >first >word! i tried to encode decode but no way ! >Thanks > > _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] NETSCAPE Screws QUERY STRING!!!!!!
On 4 Mar 2001 04:17:18 -0800, Thomas Edison Jr. <[EMAIL PROTECTED]> wrote: >The Internet Explorer converts the spaces in a query >string into it's hexadecimal value of "%20" >automatically, but netscape is not doing so. It's not >reading the space and thus not displaying the page at >all and giving the HTTP error 400. Use urlencode() or rawurlencode() when generating those URLs. The standards don't allow raw spaces in a URL string, so you'll need to encode your data when generating a link to work with browsers other than IE. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] delete an element from an array
kaab kaoutar [[EMAIL PROTECTED]] wrote: > Thanks! but i know this function! > i can't do that cause my varibale is multidimenssional, and i don't want to > update all that ! for one element ! > we can't decrement the length of the array ?! no way ? Here's an example of a multidimensional array - I "unset" one of the values in the middle - I don't know why this won't work for you: array('1' => "a111", '2' => "a222", '3' => "a333"), "b" => array('1' => "b111", '2' => "b222", '3' => "b333"), "c" => array('1' => "c111", '2' => "c222", '3' => "c333")); foreach ($arr1 as $key1 => $value1) { echo ""; echo "key=[$key1], value=[$value1]"; foreach ($value1 as $key2 => $value2) { echo " key2=[$key2], value2=[$value2]"; } } unset($arr1["b"]["2"]); echo "Unset b2 now"; foreach ($arr1 as $key1 => $value1) { echo ""; echo "key=[$key1], value=[$value1]"; foreach ($value1 as $key2 => $value2) { echo " key2=[$key2], value2=[$value2]"; } } ?> Here's the output displayed on the browser: --- key=[a], value=[Array] key2=[1], value2=[a111] key2=[2], value2=[a222] key2=[3], value2=[a333] key=[b], value=[Array] key2=[1], value2=[b111] key2=[2], value2=[b222] key2=[3], value2=[b333] key=[c], value=[Array] key2=[1], value2=[c111] key2=[2], value2=[c222] key2=[3], value2=[c333] Unset b2 now key=[a], value=[Array] key2=[1], value2=[a111] key2=[2], value2=[a222] key2=[3], value2=[a333] key=[b], value=[Array] key2=[1], value2=[b111] key2=[3], value2=[b333] key=[c], value=[Array] key2=[1], value2=[c111] key2=[2], value2=[c222] key2=[3], value2=[c333] > > > > >From: Hardy Merrill <[EMAIL PROTECTED]> > >To: kaab kaoutar <[EMAIL PROTECTED]> > >CC: [EMAIL PROTECTED] > >Subject: Re: [PHP] delete an element from an array > >Date: Mon, 5 Mar 2001 10:57:49 -0500 > > > >Have a look at > > > > http://www.php.net/manual/en/function.unset.php > > > >"unset" may do what you want. > > > >HTH. > > > >-- > >Hardy Merrill > >Mission Critical Linux, Inc. > >http://www.missioncriticallinux.com > > > >kaab kaoutar [[EMAIL PROTECTED]] wrote: > > > > > > Hi! > > > FIRST OF ALL THANKS ! > > > well do u mean that the only way to remove an elemnt from an array is to > > > copy it into another array? it does not suit me cause the array is a > >session > > > variable and i need to update it ! > > > > > > Thanks > > > > >_ > > > Get Your Private, Free E-mail from MSN Hotmail at > >http://www.hotmail.com. > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > _ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/pdf pdf.c
rjs Mon Mar 5 08:18:50 2001 EDT Modified files: /php4/ext/pdf pdf.c Log: fixed bug in PDF_getbuffer (happend only on Windows) When using PDFlib V4.0 the pdf_set(grey/rgbcolor) functions are replaced by the PDFlib V4.0 function pdf_setcolor Index: php4/ext/pdf/pdf.c diff -u php4/ext/pdf/pdf.c:1.74 php4/ext/pdf/pdf.c:1.75 --- php4/ext/pdf/pdf.c:1.74 Thu Mar 1 11:51:53 2001 +++ php4/ext/pdf/pdf.c Mon Mar 5 08:18:50 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: pdf.c,v 1.74 2001/03/01 19:51:53 rjs Exp $ */ +/* $Id: pdf.c,v 1.75 2001/03/05 16:18:50 rjs Exp $ */ /* Id: pdf.c,v 1.73 2001/02/26 06:07:11 andi Exp */ /* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE. @@ -293,7 +293,7 @@ #else php_info_print_table_row(2, "PDFlib GmbH Version", tmp ); #endif - php_info_print_table_row(2, "Revision", "$Revision: 1.74 $" ); + php_info_print_table_row(2, "Revision", "$Revision: 1.75 $" ); php_info_print_table_end(); } @@ -1498,7 +1498,11 @@ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); +#if (PDFLIB_MAJORVERSION >= 4) + PDF_setcolor(pdf, "fill", "gray", (float) Z_DVAL_PP(arg2), 0, 0, 0); +#else PDF_setgray_fill(pdf, (float) Z_DVAL_PP(arg2)); +#endif RETURN_TRUE; } /* }}} */ @@ -1517,7 +1521,11 @@ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); +#if (PDFLIB_MAJORVERSION >= 4) + PDF_setcolor(pdf, "stroke", "gray", (float) Z_DVAL_PP(arg2), 0, 0, 0); +#else PDF_setgray_stroke(pdf, (float) Z_DVAL_PP(arg2)); +#endif RETURN_TRUE; } /* }}} */ @@ -1536,7 +1544,11 @@ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); +#if (PDFLIB_MAJORVERSION >= 4) + PDF_setcolor(pdf, "both", "gray", (float) Z_DVAL_PP(arg2), 0, 0, 0); +#else PDF_setgray(pdf, (float) Z_DVAL_PP(arg2)); +#endif RETURN_TRUE; } /* }}} */ @@ -1557,7 +1569,11 @@ convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); +#if (PDFLIB_MAJORVERSION >= 4) + PDF_setcolor(pdf, "fill", "rgb", (float) Z_DVAL_PP(arg2), (float) +Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), 0); +#else PDF_setrgbcolor_fill(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4)); +#endif RETURN_TRUE; } /* }}} */ @@ -1578,7 +1594,11 @@ convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); +#if (PDFLIB_MAJORVERSION >= 4) + PDF_setcolor(pdf, "stroke", "rgb", (float) Z_DVAL_PP(arg2), (float) +Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), 0); +#else PDF_setrgbcolor_stroke(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4)); +#endif RETURN_TRUE; } /* }}} */ @@ -1599,7 +1619,11 @@ convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); +#if (PDFLIB_MAJORVERSION >= 4) + PDF_setcolor(pdf, "both", "rgb", (float) Z_DVAL_PP(arg2), (float) +Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), 0); +#else PDF_setrgbcolor(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4)); +#endif RETURN_TRUE; } /* }}} */ @@ -2179,11 +2203,7 @@ if (argc == 2) { convert_to_string_ex(arg2); -#ifdef VIRTUAL_DIR - virtual_filepath(Z_STRVAL_PP(arg2), &filename); -#else filename = Z_STRVAL_PP(arg2); -#endif pdf_file = PDF_open_file(pdf, filename); } else { /* open in memory */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] passing variable via url
using PHP 3.x on Linux, I've always been able to pass along a variable like http://www.domain.com/index.php3?foo=bar and then I could print out this with something like echo $foo; would print out "bar" I've recently installed the latest PHP4 onto a Windows2000 server, I'm trying the same thing here, a simple test, and echo $foo; gives me nothing however including a PHPINFO() on the page displays this: HTTP_GET_VARS["foo"] bar I'm I missing something here ? Kevin Kevin Heflin | ShreveNet, Inc. | Ph:318.222.2638 x103 VP/Production | 333 Texas St #175| FAX:318.221.6612 [EMAIL PROTECTED]| Shreveport, LA 71101 | http://www.shreve.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] input textfield value cat!
On Monday 05 March 2001 17:29, you wrote: > I'm using a variable! > > Well, you *still* need to have quotes around it: > >Make sure you have quotes around the value. > > > > -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...to paraphrase Churchill, while representative democracy may be terrible, it's still the best system that large corporations can buy. - David Weinberger JOHO January 25, 2000 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] passing variable via url
On Monday 05 March 2001 17:43, you wrote: > using PHP 3.x on Linux, I've always been able to pass along a variable > like http://www.domain.com/index.php3?foo=bar > > and then I could print out this with something like > echo $foo; > would print out "bar" > > I've recently installed the latest PHP4 onto a Windows2000 server, I'm > trying the same thing here, a simple test, and > echo $foo; > > gives me nothing > > however including a PHPINFO() on the page displays this: > HTTP_GET_VARS["foo"] bar > > I'm I missing something here ? Check whether register_globals is set to "on" -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...to paraphrase Churchill, while representative democracy may be terrible, it's still the best system that large corporations can buy. - David Weinberger JOHO January 25, 2000 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] input textfield value cat!
On Mon, 5 Mar 2001, kaab kaoutar wrote: > I'm using a variable! > > Quote the value: \"> Greets, Batonik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] imap problems.
ok, here we go. imap functions seem tobe funny. I could not get php to compile with the latest imap, I was getting errors about xml, go figure. and could not not like lib/yes go figure. I downloaded php 4.0.5dev all compiled well, but I get strange things happening, like imap functions do not return errors they just timeout. some functions just dont work, only timeout and cause segfaults, I cant tell if there are errors or not because of this. foreach($this->mail_headers as $pos => $val) $this->mail_body[$pos] = imap_body($this->mail_stream, $pos); where mail_headers is an array with all the headers pos and their value. this causes segfaults. any idea's? I would pref not to use the dev version of php? I also noticed on ftp://ftp.cac.washington.edu/imap/ that the newest imap is beta, anything stable out there? -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED]
[PHP] Re: [PHP-WIN] Re: IE 5.5,authentication,PHP sessions: IE never stops
At 09:51 PM 3/4/01 -0500, Ken wrote: >Anyway, can someone please test to see if this doesn't happen in IE5.0? > >I really hate this situation, yessir. I have installed IE 5.00.2614.3500 (that's what came with Win 98 2nd edition CDROM vers 4.10.A) and it does NOT have the problem you have described. However, it has another bug that is almost as good. Make this page called mytest.php (I am using Xitami on localhost for the server) "; echo "You entered $PHP_AUTH_PW as your password."; } ?> These are the steps I did. 1. open mytest.php and when the password prompt appears, I enter a userid/password. 2. I see the "Hello" page with my userid and password. 3. close IE and reopen mytest.php, again the prompt appears -- this is good. 4. close IE and Restart Windows. 5. open mytest.php and when the password prompt appears, I hit CANCEL. 6. the message "Sorry you are not authorized" appears 7. in the address box I type www.google.com and wait for it to appear 8. I press the BACK button and guess what I see? I see the "Hello" page with my userid and password from step 2 !! apparently the page is retrieved from the browser cache. John Henckel alt. mailto:[EMAIL PROTECTED] Zumbro Falls, Minnesota, USA (507) 753-2216 http://geocities.com/jdhenckel/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: IE 5.5,authentication,PHP sessions: IE never stops
At 10:56 AM 3/5/01 -0600, John Henckel wrote: >1. open mytest.php and when the password prompt appears, I enter a userid/password. >2. I see the "Hello" page with my userid and password. >3. close IE and reopen mytest.php, again the prompt appears -- this is good. >4. close IE and Restart Windows. >5. open mytest.php and when the password prompt appears, I hit CANCEL. >6. the message "Sorry you are not authorized" appears >7. in the address box I type www.google.com and wait for it to appear >8. I press the BACK button and guess what I see? I see the "Hello" page with my >userid and password from step 2 !! apparently the page is retrieved from >the browser cache. This is exactly one of the things I was complaining about: It is NOT a browser cache issue - it still remembers your username and password, and will continue to send it with page requests. This happens when you hit "cancel" on the new password prompt. You'd think it would forget the username and password at this point, but it doesn't. You have to clear the password field and hit OK. Crazy, huh? - Ken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Verify session in function
I am building my first basic function to verify a session. If the verification is not in the function it works... What am I missing? (I couldn´t find anything about this in the mailing list archive) -- This works --> session_start(); if (isset($PHPSESSID)){ echo "ok"; } else echo "not ok"; } -- This does not work -> session_start(); verifySess(); function verifySess() { if (isset($PHPSESSID)){ echo "ok"; } else echo "not ok"; } } Thanks, // Tobias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Start you php script over??
Hello, Is there a way for me to tell my php script to start over? I want to have an if then statement to check if something is done. Then if it isn't I want the php script to start over. Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Supress error message to apache log?
I have the following php function- function doclink ($documentdir, $rpmname, $doc_file) { $string="rpm -qd $rpmname |head -1 |sed s?\"$documentdir\"?\"\"? |cut -d\"/\" -f2"; $rpm_installed=exec($string); $DOC_ABSOLUTE="$documentdir/$rpm_installed"; if (file_exists("$DOC_ABSOLUTE/$doc_file")) { if (is_link("$rpmname")) { unlink("$rpmname"); } symlink("$DOC_ABSOLUTE", "$rpmname"); return "$rpmname/$doc_file"; } else { return "failed"; } } later its used when creating a page of documentation links for the user, like this- $mysqldoc=doclink($docdir, "MySQL", "manual_toc.html"); if (strstr($mysqldoc,"failed")) { echo "\n"; } else { echo "MySQL Documentation\n"; } Works beautifully, problem is- if the rpm isn't installed that's querried in the doclink function, the error message rpm puts out is sent to the apache error.log. I don't want that. Is there a way to supress the error message for that exec call? Thanks -=-=-=-=-=-=-=-=-=-=-=-=-=-=- Michael A. Peters Abriasoft Senior Developer http://www.abriasoft.com/ (510) 623-9726x357 Fax: (510) 249-9125 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] delete an element from an array
Since its the last element, just pop it out: array_pop() --- kaab kaoutar <[EMAIL PROTECTED]> wrote: > Hi! > how can i decrement the length of an array! > In fact i'm trying to delete an element from an > array , i'v put the content > of i in i-1 (loop) and i tried to decrement the > array legnththis way: > count($x)=count($x)-1; > but it generates an error! > > Thanks > > _ > Get Your Private, Free E-mail from MSN Hotmail at > http://www.hotmail.com. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Start you php script over??
> Is there a way for me to tell my php script to start over? I > want to have an if then statement to check if something is > done. Then if it isn't I want the php script to start over. header( "location: $PHP_SELF" ); OR header( "location: $REQUEST_URI" ); if you are using a query string/GET variables Chris
Re: [PHP] Verify session in function
U just have to add global $PHPSESSID to make the session variable global; >From: "Tobias Talltorp" <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >Subject: [PHP] Verify session in function >Date: Mon, 5 Mar 2001 18:30:00 +0100 > >I am building my first basic function to verify a session. >If the verification is not in the function it works... >What am I missing? >(I couldn´t find anything about this in the mailing list archive) > >-- This works --> >session_start(); > >if (isset($PHPSESSID)){ > echo "ok"; > } else > > echo "not ok"; > } > > >-- This does not work -> >session_start(); >verifySess(); > >function verifySess() { > if (isset($PHPSESSID)){ > echo "ok"; > } else > > echo "not ok"; > } > } > >Thanks, >// Tobias > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Start you php script over??
header() http://$SERVER_NAME/$PHP_SELF"); exit(); } ?> i your using sessions without coookies. header("Location: http://$SERVER_NAME/$PHP_SELF?PHPSESSID=$PHPSESSID"); -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] ""Brandon Orther"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, Is there a way for me to tell my php script to start over? I want to have an if then statement to check if something is done. Then if it isn't I want the php script to start over. Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Supress error message to apache log?
I feel dumb... $string="rpm -qd $rpmname 2>/dev/null |head -1 |sed s?\"$documentdir\"?\"\"? |cut -d\"/\" -f2"; On Monday, March 5, 2001, at 09:33 AM, Michael A. Peters wrote: > I have the following php function- > > function doclink ($documentdir, $rpmname, $doc_file) { > $string="rpm -qd $rpmname |head -1 |sed s?\"$documentdir\"?\"\"? |cut -d\"/\" >-f2"; > $rpm_installed=exec($string); > $DOC_ABSOLUTE="$documentdir/$rpm_installed"; > if (file_exists("$DOC_ABSOLUTE/$doc_file")) { > if (is_link("$rpmname")) { > unlink("$rpmname"); >} > symlink("$DOC_ABSOLUTE", "$rpmname"); > return "$rpmname/$doc_file"; > } else { > return "failed"; > } > } > > later its used when creating a page of documentation links for the user, like this- > > $mysqldoc=doclink($docdir, "MySQL", "manual_toc.html"); > if (strstr($mysqldoc,"failed")) { > echo "\n"; > } else { > echo "MySQL > Documentation\n"; > } > > Works beautifully, problem is- if the rpm isn't installed that's querried in the >doclink > function, the error message rpm puts out is sent to the apache error.log. I don't >want that. > > Is there a way to supress the error message for that exec call? > > Thanks > -=-=-=-=-=-=-=-=-=-=-=-=-=-=- > Michael A. Peters > Abriasoft Senior Developer > > http://www.abriasoft.com/ > > (510) 623-9726x357 > Fax: (510) 249-9125 > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=- Michael A. Peters Abriasoft Senior Developer http://www.abriasoft.com/ (510) 623-9726x357 Fax: (510) 249-9125 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] HELP!!! FTP!!!!
Hi my name is bruno from Brazil. I have a linux server with Apache and PHP 4 running. What i wanna do is upload a file. Look the problem: I have a lan.(local Network) Consider this: Network server running apache : 6.6.6.6 Network client station : 6.6.6.5 If The apache server executes the php code when a client station requires a php page to make ftp conection, the remote host is the apache server and local host is th apache server. I think this for this cause: Look my code: WHAT IS WRONG???
[PHP] getting info.. help!
Hello, Is there a way to remove all the spaces in the beginning of a string? Example: " 45 fasfda asdfasf" would be "45 fasfda asdfasf" and " 45 fasfda asdfasf" would be "45 fasfda asdfasf" No matter how many spaces in the begging in I just want it to delete the first spaces. I hope you can understand. :Þ Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] getting info.. help!
trim() -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] ""Brandon Orther"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, Is there a way to remove all the spaces in the beginning of a string? Example: " 45 fasfda asdfasf" would be "45 fasfda asdfasf" and " 45 fasfda asdfasf" would be "45 fasfda asdfasf" No matter how many spaces in the begging in I just want it to delete the first spaces. I hope you can understand. :Þ Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] getting info.. help!
> Hello, > > Is there a way to remove all the spaces in the beginning of a string? > > Example: > > " 45 fasfda asdfasf" would be "45 fasfda asdfasf" > > and > > " 45 fasfda asdfasf" would be "45 fasfda asdfasf" > look at http://www.php.net/manual/en/function.ltrim.php or maybe http://www.php.net/manual/en/function.trim.php -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] getting info.. help!
ltrim removes spaces on the left rtrim removes spaces on the right trim removes spaces on both the left and right Larry Jeannette MIS Director, e.Republic -Original Message- From: Brandon Orther [mailto:[EMAIL PROTECTED]] Sent: Monday, March 05, 2001 11:08 AM To: PHP User Group Subject: [PHP] getting info.. help! Hello, Is there a way to remove all the spaces in the beginning of a string? Example: " 45 fasfda asdfasf" would be "45 fasfda asdfasf" and " 45 fasfda asdfasf" would be "45 fasfda asdfasf" No matter how many spaces in the begging in I just want it to delete the first spaces. I hope you can understand. :Þ Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Pam Auth 0.2 released
Hi, I've released Pam Auth 0.2 after many months :) Pam Auth is a php4 extension that allows simple pam authentication. Possible uses for this include using php to authenticate against local password files (dangerous!), samba/nt domains, ldap, mysql databases, and anything else which pam supports. Changes in version 0.2 include: - fixed problem with building on some systems - fixed problem with core dumps on solaris - fixed typo which caused errors to not be properly returned - added ability to specify pam servicename in php.ini - it now compiles as a shared module (although it won't load...) I hope to figure out the shared library issue soon which should simplify the installation process greatly. For more information and to download, please visit http://www.math.ohio-state.edu/~ccunning/pam_auth.html Please let me know if you encounter any problems with this version. -- Chad Cunningham [EMAIL PROTECTED] "Well, once again my friend, we find that science is a two-headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is bad! Oh beware the other head of science, Arthur, it bites!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Regular Expression Help
I want to delete everything after a tab (or space) on each line of a text file and can't figure it out. An example line is ARIA5.19-0.0625 -1.19 5.254.5 48.5100300 I want to the output to be ARIA Thanks. Jeff Oien -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regular Expression Help
> I want to delete everything after a tab (or space) on each line of > a text file and can't figure it out. > > An example line is > ARIA 5.19 -0.0625 -1.19 5.25 4.5 48.5 100300 > you can explode on a tab $arrlines = explode("\t", $the_line); then save $arrlines[0] from every line. Don't know if it's the most optimal way but it works :) -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: [PHP-WIN] Re: IE 5.5,authentication,PHP sessions: IE never stops
Hi Ken, > At 10:56 AM 3/5/01 -0600, John Henckel wrote: > >1. open mytest.php and when the password prompt appears, I enter a userid/password. > >2. I see the "Hello" page with my userid and password. > >3. close IE and reopen mytest.php, again the prompt appears -- this is good. > >4. close IE and Restart Windows. > >5. open mytest.php and when the password prompt appears, I hit CANCEL. > >6. the message "Sorry you are not authorized" appears > >7. in the address box I type www.google.com and wait for it to appear > >8. I press the BACK button and guess what I see? I see the "Hello" page with my >userid and password from step 2 !! apparently the page is retrieved from >the browser cache. > > This is exactly one of the things I was complaining about: It is NOT a browser cache >issue - it still remembers your username and password, and will continue to send it >with page requests. This happens when you hit "cancel" on the new password prompt. >You'd think it would forget the username and password at this point, but it doesn't. >You have to clear the password field and hit OK. Crazy, huh? > > - Ken There is a suggestion in the PHP online documentation that has worked for me (except in Opera 5, which seems to ignore the Realm). Add a timestamp to the Realm that changes with each new session. IE 5.0 will prompt for a different password, because it sees it as a different login. Later, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RPMs for PHP accessing PostgreSQL via ODBC over RedHat
Hi, We are currently running the following configuration on our server: Linux Red Hat 7.0 PostgreSQL 7.1beta4-1 PHP 4.0.1pl2 I need to add some RPM package (or perhaps an apache module) to enable PHP to access PostgreSQL via ODBC. In order to have PostgreSQL native access support we installed package 'php-pgsql-4.0.1pl2-9.i386.rpm'. Is there some similar RPM package to enable ODBC access in PHP4.0.1pl2? If not, how should I procceed? TIA, Paulo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] get current events from mysql query by date?
I have a mysql database of events. It contains the following fields: - EventID - EventName - EventDescription - EventStartDate - EventEndDate I would like to query the database for the next 5 events from the current date (today). Any ideas? Regards, Matthew Delmarter Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Document Contains No Data in Netscape?
I have a set of pages I've been working on to do address entry for registered users to a MySQL database. I'm running up against a wall that I've been fighting for two days... process is thus: checks session vars to see if user is logged in. if not, present login screen. if logged in: see if this is a submitted form, or a blank request for one. if blank request, present the HTML form. if submitted: check the incoming data to determine if the address type (home, work or other) is set. if not, give error. if set, checks to see if that type was already in the database for that user, and checks to see if this address was flagged as the mailing address. if either case, give error and exit. past all that? The the script SHOULD run the mysql_query and insert the submitted data to the database. if successful, should return one of two options: either go to the site main index page, or reload a blank address form if the user wants to enter an additional address. My problem is coming in AFTER the type and mailing checks, and before the mysql_query. I can't find any problems with the script; everything looks right to me. However: if I fill out the form and leave out the type field, I get the correct error. if I mark a type that exists in the database already, or that type already has a mailing flag set, I get the correct error. if I fill out the form correctly, and hit either button, I get a Netscape error "Document Contains No Data". What in tarnation is going on? Can someone help me please? Robert Cooper AwakeningRetreat.Net Webmaster - Attached script below address.php - Must Specify address type. Click the back arrow on your browser, select a type, and resubmit. http://www.awakeningretreat.net/\">Continue without entering address information."; include("footer.html"); exit; } else { mysql_connect("localhost","www","") or die("Unable to connect to SQL server"); mysql_select_db("awakening") or die("Unable to select database"); $query = mysql_query("select type, mailing from address where id='$id'"); $result = mysql_num_rows($query); if ($result > 0 ) { while ($row = mysql_fetch_array($query)) { if ($row[type] == $type) echo "$type address already exists in database. Back to address entry."; if ($row[mailing] == $mailing) echo "You have already defined $row[type] as mailing address. Back to address entry."; } exit; } else { $result = mysql_query("INSERT INTO address VALUES ('$id', '$street', '$city', '$state', '$ZIP', '$type', '$mailing')"); if (!$result) { echo "Unknown database error in address. Please contact the mailto:[EMAIL PROTECTED]\">Webmaster with this information."; exit; } else { include("header.html"); echo "Finished updating addresses."; include("footer.html"); switch ($action) { case "Finish" : header("Location: http://www.awakeningretreat.net/"); break; case "Add Another" : header("Location: /register/address.php"); break; } } } } } else { include("header.html"); echo " Address Information Street : City : State : ZIP : Address Type : HOME WORKOTHER This is my Mailing Address Submit and: http://www.awakeningretreat.net/\">OR: continue without entering address information. NOTES: Privacy Policy All fields on this page are optional. However, answering them will help other Awakeners find you! "; include("footer.html"); } } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] get current events from mysql query by date?
> I have a mysql database of events. It contains the following fields: > > - EventID > - EventName > - EventDescription > - EventStartDate > - EventEndDate > > I would like to query the database for the next 5 events from the current > date (today). Any ideas? works if EventStartDate is a timestamp (i think) $strselect = "SELECT EventName FROM table WHERE EventStartDate > UNIX_TIMESTAMP() LIMIT 5"; if EventStartDate is not a timestamp what is it then? hope it helps -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Hide Include-Files from the Web
How bout an Apache redirect for .inc files to go to denied.htm or something? PHP scripts could get to them, but they wouldn't be accessible via http. At 08:01 PM 3/3/01 +0100, [EMAIL PROTECTED] wrote: >Hi! > >as I wrote in my mail: >1. >I won't name them ".inc" but ".inc.php" (so *I* know, it's an include file) >2. >I don't even want them to be executable!!! > >and therefore my question was, if this (on top of every include-file) would >be safe enough: >>> if (substr($SCRIPT_URL,-8)==".inc.php") exit; >$PHP_SELF better than $SCRIPT_URL in line above??? > >thanks >michi > >> Include files do not have to end with '.inc', which is purely a convention >> of dubious value. If you use '.php' as the extension for included files, >> they will have to be parsed by PHP and can't be read as plain text from >> outside. >> >> > Hi! >> > >> > I want my include-files not be seen from outside AND not be executed!!! >> > I don't have access to a directory outside DOCUMENT_ROOT and I don't >> have >> > .htaccess!!! >> > >> > I think about something like: >> > 1. >> > name: .inc.php >> > 2. >> > add code: >> > if ($PHP_SELF==MY_NAME) exit; >> > as first line in the inluded script. >> > so, if the script is being included from another script, the code will >> be >> > executed - but if the file will be called directly, no code is executed! >> > BUT - how do I get the include-file's name? >> > >> > or is it safe enough, to use something like >> > if (substr($SCRIPT_URL,-8)==".inc.php") exit; > >-- >Sent through GMX FreeMail - http://www.gmx.net > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] get current events from mysql query by date?
This is just a guess but wanted to take a shot at it. Something like SELECT EventID, EventName, EventDescription, EventStartDate, EventEndDate WHERE EventStartDate > CURRENT_DATE ORDER BY EventStartDate ASC LIMIT 5; How did I do? Jeff Oien > I have a mysql database of events. It contains the following fields: > > - EventID > - EventName > - EventDescription > - EventStartDate > - EventEndDate > > I would like to query the database for the next 5 events from the current > date (today). Any ideas? > > Regards, > > Matthew Delmarter > Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Is it odd or even???
Hello, Is there an easy way to check and see if a number is odd or even? Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Is it odd or even???
> Is there an easy way to check and see if a number is odd or even? if( $num % 2 ) { echo "Odd"; } else { echo "Even"; } Chris
Re: [PHP] Is it odd or even???
You could divide it by 2, odd numbers will always have a remainder even umbers never will. here are math functions, but none for odd/even that i see. Jon - Original Message - From: "Brandon Orther" <[EMAIL PROTECTED]> To: "PHP User Group" <[EMAIL PROTECTED]> Sent: Monday, March 05, 2001 3:17 PM Subject: [PHP] Is it odd or even??? > Hello, > > Is there an easy way to check and see if a number is odd or even? > > Thank you, > > > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Is it odd or even???
use the modulus operator: ($number % 2) returns 0 if the value is even Larry Jeannette MIS Director, e.Republic -Original Message- From: Brandon Orther [mailto:[EMAIL PROTECTED]] Sent: Monday, March 05, 2001 12:18 PM To: PHP User Group Subject: [PHP] Is it odd or even??? Hello, Is there an easy way to check and see if a number is odd or even? Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Is it odd or even???
> That won't work. % returns the remainder from a division of > the number divided by the mod number. Yours: > if($num %2 == 0){ > echo "even"; > }else{ > echo "odd"; > } Mine: > > if( $num % 2 ) { > > echo "Odd"; > > > > } else { > > echo "Even"; > > > > } Ours are identical, just the other way around. This: if( $num % 2 ) { means if the result of that operation is anything other than 0 (zero), which is a truth in PHP. Chris
RE: [PHP] Is it odd or even???
Use the modulus operator > -Original Message- > From: Brandon Orther [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 05, 2001 3:18 PM > To: PHP User Group > Subject: [PHP] Is it odd or even??? > > > Hello, > > Is there an easy way to check and see if a number is odd or even? > > Thank you, > > > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Is it odd or even???
Color me confused because I though true was any non zero value and false was zero. I know I am using the following code: if (!($num % 4){ do something} and it does something when $num is evenly divisible by 4 (ie. $num % 4 = 0). If I were testing for odd vs even I'd do the following: if (!($num % 2) { Odd } else { Even } John Guynn This email brought to you by RFCs 821 and 1225. -Original Message- From: Boget, Chris [mailto:[EMAIL PROTECTED]] Sent: Monday, March 05, 2001 2:33 PM To: 'Kenneth R Zink II'; Php (E-mail) Subject: RE: [PHP] Is it odd or even??? > That won't work. % returns the remainder from a division of > the number divided by the mod number. Yours: > if($num %2 == 0){ > echo "even"; > }else{ > echo "odd"; > } Mine: > > if( $num % 2 ) { > > echo "Odd"; > > > > } else { > > echo "Even"; > > > > } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Is it odd or even??? Optimize!!!
You all are a bunch of un-optimizing novices. Just do some bit banging. i.e. if(1 & number){ echo "$number is odd"; }else{ echo "$number is even"; } -Original Message- From: Brandon Orther [mailto:[EMAIL PROTECTED]] Sent: Monday, March 05, 2001 12:18 PM To: PHP User Group Subject: [PHP] Is it odd or even??? Hello, Is there an easy way to check and see if a number is odd or even? Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Hide Include-Files from the Web
Hi! As I wrote before, I don't have .htaccess nor access to the apache-conf!!! michi > How bout an Apache redirect for .inc files to go to denied.htm or > something? PHP scripts could get to them, but they wouldn't be accessible > via http. > > > > At 08:01 PM 3/3/01 +0100, [EMAIL PROTECTED] wrote: > >Hi! > > > >as I wrote in my mail: > >1. > >I won't name them ".inc" but ".inc.php" (so *I* know, it's an include > file) > >2. > >I don't even want them to be executable!!! > > > >and therefore my question was, if this (on top of every include-file) > would > >be safe enough: > >>> if (substr($SCRIPT_URL,-8)==".inc.php") exit; > >$PHP_SELF better than $SCRIPT_URL in line above??? > > > >thanks > >michi > > > >> Include files do not have to end with '.inc', which is purely a > convention > >> of dubious value. If you use '.php' as the extension for included > files, > >> they will have to be parsed by PHP and can't be read as plain text from > >> outside. > >> > >> > Hi! > >> > > >> > I want my include-files not be seen from outside AND not be > executed!!! > >> > I don't have access to a directory outside DOCUMENT_ROOT and I don't > >> have > >> > .htaccess!!! > >> > > >> > I think about something like: > >> > 1. > >> > name: .inc.php > >> > 2. > >> > add code: > >> > if ($PHP_SELF==MY_NAME) exit; > >> > as first line in the inluded script. > >> > so, if the script is being included from another script, the code > will > >> be > >> > executed - but if the file will be called directly, no code is > executed! > >> > BUT - how do I get the include-file's name? > >> > > >> > or is it safe enough, to use something like > >> > if (substr($SCRIPT_URL,-8)==".inc.php") exit; -- Sent through GMX FreeMail - http://www.gmx.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Is it odd or even???
> Color me confused because I though true was any non zero > value and false was zero. Right. And if( $num % 2 ) { echo "it's odd"; } means that the operation returned a remainder - a non zero value. > I know I am using the following code: > if (!($num % 4){ do something} > and it does something when $num is evenly divisible by 4 (ie. > $num % 4 = 0). > If I were testing for odd vs even I'd do the following: > if (!($num % 2) { > Odd And this is: If( NOT ZERO ) { Odd } which is the same as: if( $num % 2 ) { If there is a remainder, it's not zero. Chris
[PHP] carriage return in multipart/form-data form post
We've just moved to a new server and I'm running into an odd problem. The code is below. On my old server it correctly returns: [test] t 116 e 101 s 115 t 116 But on my new server I get: [ test] 13 10 t 116 e 101 s 115 t 116 Has anyone else run into this? "; while ($action){ $c = substr($action,0,1); $action = substr($action,1); echo "$c " . ord($c) . ""; } ?> __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] carriage return in multipart/form-data form post
even the simplest forms product a 0x013 0x10 imediatly after the I wish there was a way to control this behaviour. I thought it was normal, and anoying. -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] "Jeff Schwartz" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... We've just moved to a new server and I'm running into an odd problem. The code is below. On my old server it correctly returns: [test] t 116 e 101 s 115 t 116 But on my new server I get: [ test] 13 10 t 116 e 101 s 115 t 116 Has anyone else run into this? "; while ($action){ $c = substr($action,0,1); $action = substr($action,1); echo "$c " . ord($c) . ""; } ?> __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Document Contains No Data in Netscape?
this is caused by netscape receiving no data. ie. will product no data, because nothing is echo'd. netscape hates this, and will display a warning. the other reason could be there is something wrong with a funky function your using. ie. if pdflib isnt compiled properly with TTF then when you try to use a TTF php will cause apache to seg fault, because of this apache doesnt send your client any data. netscape hates this too. tail your error_logs see what is coming up, any seg faults? this could be it. try adding a few echo statments see what comes up. -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] "Robert Cooper" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a set of pages I've been working on to do address entry for registered users to a MySQL database. I'm running up against a wall that I've been fighting for two days... process is thus: checks session vars to see if user is logged in. if not, present login screen. if logged in: see if this is a submitted form, or a blank request for one. if blank request, present the HTML form. if submitted: check the incoming data to determine if the address type (home, work or other) is set. if not, give error. if set, checks to see if that type was already in the database for that user, and checks to see if this address was flagged as the mailing address. if either case, give error and exit. past all that? The the script SHOULD run the mysql_query and insert the submitted data to the database. if successful, should return one of two options: either go to the site main index page, or reload a blank address form if the user wants to enter an additional address. My problem is coming in AFTER the type and mailing checks, and before the mysql_query. I can't find any problems with the script; everything looks right to me. However: if I fill out the form and leave out the type field, I get the correct error. if I mark a type that exists in the database already, or that type already has a mailing flag set, I get the correct error. if I fill out the form correctly, and hit either button, I get a Netscape error "Document Contains No Data". What in tarnation is going on? Can someone help me please? Robert Cooper AwakeningRetreat.Net Webmaster - Attached script below address.php - Must Specify address type. Click the back arrow on your browser, select a type, and resubmit. http://www.awakeningretreat.net/\">Continue without entering address information."; include("footer.html"); exit; } else { mysql_connect("localhost","www","") or die("Unable to connect to SQL server"); mysql_select_db("awakening") or die("Unable to select database"); $query = mysql_query("select type, mailing from address where id='$id'"); $result = mysql_num_rows($query); if ($result > 0 ) { while ($row = mysql_fetch_array($query)) { if ($row[type] == $type) echo "$type address already exists in database. Back to address entry."; if ($row[mailing] == $mailing) echo "You have already defined $row[type] as mailing address. Back to address entry."; } exit; } else { $result = mysql_query("INSERT INTO address VALUES ('$id', '$street', '$city', '$state', '$ZIP', '$type', '$mailing')"); if (!$result) { echo "Unknown database error in address. Please contact the mailto:[EMAIL PROTECTED]\">Webmaster with this information."; exit; } else { include("header.html"); echo "Finished updating addresses."; include("footer.html"); switch ($action) { case "Finish" : header("Location: http://www.awakeningretreat.net/"); break; case "Add Another" : header("Location: /register/address.php"); break; } } } } } else { include("header.html"); echo " Address Information Street : City : State : ZIP : Address Type : HOME WORKOTHER This is my Mailing Address Submit and: http://www.awakeningretreat.net/\">OR: continue without entering address information. NOTES: Privacy Policy All fields on this page are optional. However, answering them will help other Awakeners find you! "; include("footer.html"); } } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is it odd or even??? Optimize!!!
Clever. For those of us unfamiliar with bitwise ops, here's how this works: The bitwise and op (&) works on bits like this: dig1 dig2 Result 000 010 100 111 An even number's binary representation always ends with 0 (ie 12 = 1100) while an odd ends with 1 (ie 13 = 1101). So doing a bitwise & with 1 will only produce 1 if the last binary digit is 1 (ie an odd num), otherwise 0 (see table). And, like Nathan implies, this will be very fast (way faster than modulus), since you only ever deal with 2 bits of info. For an explanation of other bitwise operators, look here: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/bitwise.html J on 3/5/01 12:36 PM, Nathan Cassano at [EMAIL PROTECTED] wrote: > > You all are a bunch of un-optimizing novices. Just do some bit banging. > > i.e. > > if(1 & number){ > echo "$number is odd"; > }else{ > echo "$number is even"; > } > > > -Original Message- > From: Brandon Orther [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 05, 2001 12:18 PM > To: PHP User Group > Subject: [PHP] Is it odd or even??? > > > Hello, > > Is there an easy way to check and see if a number is odd or even? > > Thank you, > > > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.com > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] get current events from mysql query by date?
Addressed to: <[EMAIL PROTECTED]> [EMAIL PROTECTED] ** Reply to note from <[EMAIL PROTECTED]> Mon, 5 Mar 2001 14:10:28 -0600 > > This is just a guess but wanted to take a shot at it. > > Something like > > SELECT EventID, EventName, EventDescription, > EventStartDate, EventEndDate > WHERE EventStartDate > CURRENT_DATE > ORDER BY EventStartDate ASC > LIMIT 5; > > How did I do? Close, very close. I belive CURRENT_DATE is a MySQL function. MySQL functions are identified by not having a space between the function name and the required ( that makes it a function. If CURRENT_DATE is actually a function (I use NOW() because it is shorter) then you need to change the WHERE clause to: WHERE EventStartDate > CURRENT_DATE() If CURRENT_DATE() is not a valid function change it to: WHERE EventStartDate > NOW() Both assume that EventStartDate is a MySQL DATE, DATETIME or TIMESTAMP value. If they are something else, this will not work. It should be one of these types though!!! Rick Widmer Internet Marketing Specialists http://www.developersdesk.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
php-general Digest 5 Mar 2001 21:48:18 -0000 Issue 549
php-general Digest 5 Mar 2001 21:48:18 - Issue 549 Topics (messages 42593 through 42676): Re: function questions 42593 by: Tim Ward Is it possible to get call stack information? 42594 by: Neil Kimber Re: Get remote IP ot Host 42595 by: Michael Meinl Re: help gurus: multi-dimensional array problem. 42596 by: Robert Vetter 42608 by: Tim Ward 42615 by: Robert Vetter PHP & Apache 2.0 42597 by: Benoit Re: dealing with no record 42598 by: Robert Vetter Re: Function to compare an array with another array 42599 by: Tim Ward subscribe my mail-id for PHP mailing lists 42600 by: B Satish , Gurgaon Re: how to redirect to other page? 42601 by: Batonik apache does not understand php3 42602 by: Marcos 42607 by: Martín Cabrera Diaubalick Is PHP ready for XML? 42603 by: Erick Papadakis Inserting DATE in mySQL!! 42604 by: Thomas Edison Jr. 42605 by: Miles Thompson 42609 by: CC Zona 42610 by: Hardy Merrill 42612 by: CC Zona help functions 42606 by: Montgomery-Recht, Evan 42611 by: CC Zona Re: HREFs that can't be 42613 by: Boget, Chris Re: Problem getting PostgreSQL to compile 42614 by: The Hermit Hacker Re: undefined symbol: xmlXPtrNewContext 42616 by: Sebastien Roy Re: Help Please: Php configuration 42617 by: archana sharma Re: max array size question.. 42618 by: Paul K Egell-Johnsen delete an element from an array 42619 by: kaab kaoutar 42621 by: Hardy Merrill 42622 by: kaab kaoutar 42623 by: Hardy Merrill 42625 by: kaab kaoutar 42630 by: Hardy Merrill 42641 by: Christian Cresante input textfield value cat! 42620 by: kaab kaoutar 42628 by: kaab kaoutar 42633 by: Christian Reiniger 42635 by: Batonik Match Records 42624 by: Website4S.aol.com MySQL - Problem with multiple INSERTs? 42626 by: Chris Re: stumped on mailing a complete page 42627 by: Chris Adams Re: NETSCAPE Screws QUERY STRING!! 42629 by: Chris Adams passing variable via url 42631 by: Kansas Territory 42634 by: Christian Reiniger Re: [PHP-WIN] Re: IE 5.5,authentication,PHP sessions: IE never stops 42632 by: John Henckel 42652 by: Chris Poirier imap problems. 42636 by: Chris Lee Re: IE 5.5,authentication,PHP sessions: IE never stops 42637 by: Ken 42673 by: Ken Verify session in function 42638 by: Tobias Talltorp 42643 by: kaab kaoutar Start you php script over?? 42639 by: Brandon Orther 42642 by: Boget, Chris 42644 by: Chris Lee Supress error message to apache log? 42640 by: Michael A. Peters 42645 by: Michael A. Peters HELP!!! FTP 42646 by: Bruno Freire getting info.. help! 42647 by: Brandon Orther 42648 by: Chris Lee 42649 by: Henrik Hansen 42650 by: Larry Jeannette Pam Auth 0.2 released 42651 by: Chad Cunningham Regular Expression Help 42653 by: Jeff Oien 42654 by: Henrik Hansen RPMs for PHP accessing PostgreSQL via ODBC over RedHat 42655 by: Paulo Parola get current events from mysql query by date? 42656 by: Matthew Delmarter 42658 by: Henrik Hansen 42660 by: Jeff Oien 42676 by: php3.developersdesk.com Document Contains No Data in Netscape? 42657 by: Robert Cooper 42674 by: Chris Lee Re: Hide Include-Files from the Web 42659 by: Richard Kitamura - Media Net Link, Inc. 42669 by: mailing_list.gmx.at Is it odd or even??? 42661 by: Brandon Orther 42662 by: Boget, Chris 42663 by: Jon Rosenberg 42664 by: Larry Jeannette 42665 by: Boget, Chris 42666 by: Brian V Bonini 42667 by: John Guynn 42670 by: Boget, Chris Re: Is it odd or even??? Optimize!!! 42668 by: Nathan Cassano 42675 by: Julian Wood carriage return in multipart/form-data form post 42671 by: Jeff Schwartz 42672 by: Chris Lee Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- why are you using this construct instead of echo()? e.g. echo("Hey there " . foo::bar($baz) . " how are you doing?"); Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -Original Message- > From: kevin1 [mailto:[EMAIL PROTECTED]] > Sent: 02 March 2001 09:57 > To: php-general > Subject: function questions > > > I have a here doc: > > print << Hey there foo::bar($baz
[PHP] Get text between
I need some help with a program, I need to get every instance of text between GET TEXT HERE and save the results in a variable. Does anyone have some example code of how to do it along with how to put the results into just one variable? __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] speeding a site with lots of includes
An app I am currently developing has grown a lot. It currently handles aproximately 12 includes, more or less 13 thousand lines of code. By doing some benchmarks, i realized that the bottleneck is the include() payload. How can I optimize a program like this one ? thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Get text between
> I need some help with a program, I need to get every > instance of text between GET TEXT HERE > and save the results in a variable. Does anyone > have some example code of how to do it along with how > to put the results into just one variable? Try with: $string = "GET TEXT HERE"; $string = strip_tags($string); -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: IE 5.5,authentication,PHP sessions: IE never stops
At 02:39 PM 3/5/01 -0500, Chris Poirier wrote: >There is a suggestion in the PHP online documentation that has worked for >me (except in Opera 5, which seems to ignore the Realm). Add a timestamp >to the Realm that changes with each new session. IE 5.0 will prompt for a >different password, because it sees it as a different login. This is, in fact, what my system attempts to do. The catch is that I CAN'T change the realm with a new session...because I don't GET a new session, because IE 5.5 is not starting a new session when it should! Indeed, when I change the realm, I get the prompt. But I can't tell when the user closed his browser and started a new one, because IE 5.5 (on the machines I'm testing on) is still keeping the old session, acting like the browser never closed. Again, my system works perfectly on the other browsers I've tried. It changes the realm when appropriate. It sets a flag in the database when the user hits logout. And it works the way it should. Just in IE 5.5 (on the machines I'm testing on) do I get this horrible behavior. - Ken >Later, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] mail problem
Now if i include $headers .= "Cc: [EMAIL PROTECTED] " . " , "; $headers .= "[EMAIL PROTECTED]\n"; My page won't load at all apart from the first include i have on my page.. does any one have any idea's? Hiya, am near completeion of a site only i can't get any mail to send to multiple recipients at all .. either in the "To:" section or having on email in "To" and one email address in "CC" section.. and i need to be able to do this ... can any one offer any suggestions ...( I'd prefer to have one in the "To" section and one in the "CC" section I'm am using sendmail on solaris 2.6 to send the actual emails <-- Start of snip---> $address .= $email ; $subject = "VFSA-eRentals Calculation Results"; $body="blah blah\n"; $headers .= "CC: [EMAIL PROTECTED] "; mail("$address", "$subject", "$body", "$headers \nContent-Type: text/plain; charset=iso-8859-1\nContent-Transfer-Encoding: 64bit" ); <--- end of snip---> any help would be greatful :) Peter Houchin Sun Rentals [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP and MySQL ....dynamic query?
Hello everyone. :) I am attempting to construct a query with PHP and MySQL based on user input from a referring form page. Here is an example of what I need this to do: This will involve multiple variables, but I will just use 2 here: if ($dig== "1") { $qual1 = "WHERE (track >= 0)"; } if ($dig== "2") { $qual1 = "WHERE (track >= 0) AND (track <=100)"; } if ($lot == "1") { $qual2 = "AND (acres >= 100)"; } if ($lot == "2") { $qual2 = "AND (acres >= 500) AND (acres <= 650)"; } // create SQL statement $sql = "SELECT * FROM myTable $qual1 $qual2"; // execute SQL query and get result $sql_result = mysql_query($sql,$connection) or die("Could not execute the query"); . You can see my problem here. I want to be able to write parts of my sql statement based upon user input, and then execute it all at once. How do I tie all of my $qual variables in so that this will read/execute it properly? Thanks :)
[PHP] function --> global variables
I have a html form and his "action" is a php file. this is the php file: function checasenha($ID) { $as="\""; global $ID, $limite, $cdusuario, $usuario, $senha; . . . } checasenha($ID); -- Warning: Variable used in global statement already exists in the function in /home/httpd/html/fiesc_sessao/checa_senha.php3 on line 13 The "line 13" is "global $ID, $limite." What's could be the problem? regards, Augusto Cesar Castoldi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Sites Using PHP - For a presentation
Hi all, I am looking for some big name sites using PHP. I will be doing a presentation next month and would like to show a list of sites that are using PHP. Thanks for your Help ___ Send a cool gift with your E-Card http://www.bluemountain.com/giftcenter/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] To the PHP developpers / DOMXML (Update and delete??)
Greetings PHP Developpers. I am presently making a web based application that will be able to add nodes as well as update and remove them from XML documents. I saw in my researches, up to now, That XMLDOM does not support update and delete of nodes. I just wanted to know if someone is presently working on that and when I should expect the release of these functions. Thanks Regards, Dominique Paquin Galea Secured Networks Inc. [EMAIL PROTECTED] FAX: 450 979-9027 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]