[PHP] TEST
TEST -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: From where was function called?
You can use the 'magic constants' __FILE__ and __LINE__ For example, if you have an editor that can replace the newline \n character, you can replace all \n with \nerror_log(__FILE__ . '[' . __LINE__ . ']'); Nico Van Der Dussen [EMAIL PROTECTED] wrote in message 3CC45EB5.6064.19C3129@localhost">news:3CC45EB5.6064.19C3129@localhost... Hi, I'm having a real problem: In a codeset of more than 5000 lines of code, I have a rogue call to a function. Is there a way I can determine in a function from where the call was made? (Filename, linenumber etc) Thanks Nico -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] store pics on mysql db
hi...is it possible to store pics (jpeg/gif) on the mysql database? if so, how and what type should that field be? thanks. _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting the name of a file in a download....
At 3:59 PM +1000 23/4/02, Brian White wrote: Is there any way to get it to save as a file called file.zip? Is there any header I can set? The headers it currently returns header(Content-type: application/octet-stream; name=\file.zip\); header(Content-Disposition: attachment; filename=\file.zip\); header(Content-transfer-encoding: binary); ...R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] store pics on mysql db
At 6:37 AM + 23/4/02, mm fernandez wrote: hi...is it possible to store pics (jpeg/gif) on the mysql database? if so, how and what type should that field be? How: just addslashes() on the content and insert it. What: a blob of an appropriate size. ...R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] store pics on mysql db
Yes. The field would need to be some kind of binary blob. You would need to access it using a PHP script that set the header eg: header( Content-type:image/gif ) and then out put the image. At 16:37 23/04/2002, mm fernandez wrote: hi...is it possible to store pics (jpeg/gif) on the mysql database? if so, how and what type should that field be? thanks. _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - Brian White Step Two Designs Pty Ltd Knowledge Management Consultancy, SGML XML Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] get ip of visitors
Hello, How can I take the IP of the visitator of my php page? not gethostbyname... I need the ip of any visitator not for the specified visitator. Thank you Cosmin
Re: [PHP] get ip of visitors
At 11:04 23/04/2002 +0300, Cosmin Vlasiu wrote: Hello, How can I take the IP of the visitator of my php page? not gethostbyname... I need the ip of any visitator not for the specified visitator. Thank you Cosmin Hello, function http_data() { $user_data = array (); // IP Number if (getenv(HTTP_X_FORWARDED_FOR)){ $user_data['ip']=getenv(HTTP_X_FORWARDED_FOR); } else { $user_data['ip'] =getenv(REMOTE_ADDR); } // HOSTNAME if ((getenv(REMOTE_HOST )== )){ $r_hostname = gethostbyaddr($REMOTE_ADDR); if ($r_hostname ==){ $user_data['machine'] = 'unknown'; }else { $user_data['machine'] = $r_hostname; } } else { $user_data['machine'] = getenv(REMOTE_HOST ); } // Browser $user_data['navigateur']= getenv(HTTP_USER_AGENT); // HTTP Refer $user_data['comefrom'] = getenv(HTTP_REFERER); return $user_data; } Hope this helps Luc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: get ip of visitors
Ya I found $ip = gethostbyname($REMOTE_ADDR); Thanks anyway Cosmin Cosmin Vlasiu [EMAIL PROTECTED] wrote in message 007d01c1ea9d$9db78660$[EMAIL PROTECTED]">news:007d01c1ea9d$9db78660$[EMAIL PROTECTED]... Hello, How can I take the IP of the visitator of my php page? not gethostbyname... I need the ip of any visitator not for the specified visitator. Thank you Cosmin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: get ip of visitors
$ipaddr=getenv(REMOTE_ADDR); Cam asta ar fi... On Tue, 23 Apr 2002, Cosmin wrote: Ya I found $ip = gethostbyname($REMOTE_ADDR); Thanks anyway Cosmin Cosmin Vlasiu [EMAIL PROTECTED] wrote in message 007d01c1ea9d$9db78660$[EMAIL PROTECTED]">news:007d01c1ea9d$9db78660$[EMAIL PROTECTED]... Hello, How can I take the IP of the visitator of my php page? not gethostbyname... I need the ip of any visitator not for the specified visitator. Thank you Cosmin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need help sorting an array...tricky
I have an array where each element contains an array that in turn contains 2 numbers indexed by id and parent. Every id except for the first one belongs to another, its parent. What I want to do now is sort the array so that every id is put after its parent starting with id 1. Example: arr1 = ( 0 = array(id = 1, parent = 0), 1 = array(id = 2, parent = 1), 2 = array(id = 3, parent = 1), 3 = array(id = 4, parent = 2), 4 = array(id = 5, parent = 3), 5 = array(id = 6, parent = 2), 6 = array(id = 7, parent = 1), 7 = array(id = 8, parent = 4), 8 = array(id = 9, parent = 5) ) In other words they are in the following order.. 1=0 2=1 3=1 4=2 5=3 6=2 7=1 8=4 9=5 After the sort I want them to be in the following order.. 1=0 2=1 4=2 8=4 6=2 3=1 5=3 9=5 7=1 Note that id 6 isn't placed right after id 4 since id 4 has parents of its own which have precedence. An easier way to illustrate this would be by indenting the list.. 1=0 2=1 4=2 8=4 6=2 3=1 5=3 9=5 7=1 The index of $arr1 makes no difference so the array can be shifted or rebuilt.. If you are wondering I need this for a forum that im building. If you have any suggestions as how to do this better feel free to tell me all about it :) Thanks in advance. // Leif Högberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Arrat question
Hello, Suppose i've got the following array $a = array( color = red, taste = sweet, shape = round, name = apple, 3 = 4 ); Now I would like to remove the color field and value. Whats the best way to do this? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array question
Hello, Suppose i've got the following array: $a = array( color = red, taste = sweet, shape = round, name = apple, 3 = 4 ); Now I would like to remove the color field and value. Whats the best way to do this? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array question
Hello, i think that unset($a['color']); is the best way :) Regards Michal Dvoracek [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: get ip of visitors
Thanks to all, very usefull samples Cosmin Cosmin Vlasiu [EMAIL PROTECTED] wrote in message 007d01c1ea9d$9db78660$[EMAIL PROTECTED]">news:007d01c1ea9d$9db78660$[EMAIL PROTECTED]... Hello, How can I take the IP of the visitator of my php page? not gethostbyname... I need the ip of any visitator not for the specified visitator. Thank you Cosmin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The so-called improvment in PHP 4.2.0
Miguel Cruz wrote: On Mon, 22 Apr 2002, Leif K-Brooks wrote: I use $formvar for form processing, I don't use the arrays. This is how I was taught to do it. If my host upgrades to 4.2.0, my website is as good as gone! What am I supposed to do?! Fix them! This direction was first announced in 4Q1999; 2.5 years ought to be enough preparation time. No, it isn't! For anything that breaks old functionality, 'forever' is not enough time. This change improves your security, so it'd be rational to be happy about it. No it doesn't. It just provides another excuse for lazy programming. Nothing will save a lazy programmer or one that doesn't understand basic principles. -Stathis. In any case, you can probably override it for your web space with a .htaccess directive, should you want to persist in your resistance to positive change. Also, if you were taught to do it the $formvar way in the past year or so, you should find the person who taught you and tweak their nose. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dynamic drop down
Hey, I am trying to make a drop down list such that, when some one selects an option, it refreshs and displays the option on the same page. There are a couple of things already in the URL [ the query string ], which need to remain there. How would I do this easily? Regards, Kunal Jhunjhunwala Minds think with ideas, not information. No amount of data, bandwidth, or processing power can substitute for inspired thought. - Clifford Stoll -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 23 Apr 2002 11:02:04 -0000 Issue 1303
php-general Digest 23 Apr 2002 11:02:04 - Issue 1303 Topics (messages 94084 through 94134): Re: From where was function called? 94084 by: Martin Towell 94119 by: Adrian Ciutureanu Re: Second opinion needed - javascript blocker 94085 by: Martin Towell 94114 by: Justin French LogiCreate: looking for resellers 94086 by: Michael Kimsal 94087 by: Richard Archer 94088 by: Michael Kimsal 94089 by: Michael Kimsal Unsubscribe? 94090 by: Josiah Wallingford 94091 by: Martin Towell 94092 by: Miguel Cruz Why isn't this working? :( 94093 by: Leif K-Brooks 94094 by: Martin Towell 94096 by: Richard Archer Re: ereg size limit??? 94095 by: SP Regex: catchall function to validate Last and First names 94097 by: Carl E Shmidt Re: Why isn't this working? :( - I found my solution! 94098 by: Leif K-Brooks remove last character in a string 94099 by: Craig Westerman 94100 by: Rasmus Lerdorf 94101 by: Tyler Longren 94103 by: Craig Westerman 94105 by: Evan Nemerson 94106 by: Rasmus Lerdorf 94107 by: Tyler Longren 94108 by: Tyler Longren 94110 by: Matthew Walker 94111 by: Jarrad Kabral Can php support ttf?? 94102 by: zhaoxd 94104 by: Rahul Bhide 94109 by: Matthew Walker 94112 by: Richard Archer Interesting Links, can be not PHP 94113 by: Mantas Kriauciunas 94115 by: Martin Towell 94116 by: Mantas Kriauciunas Setting the name of a file in a download 94117 by: Brian White 94122 by: Richard Archer TEST 94118 by: kip store pics on mysql db 94120 by: mm fernandez 94121 by: Brian White 94123 by: Richard Archer get ip of visitors 94124 by: Cosmin Vlasiu 94125 by: Luc Saint-Elie 94126 by: Cosmin Vlasiu 94127 by: Claudiu 94132 by: Cosmin Vlasiu need help sorting an array...tricky 94128 by: Leif Högberg Arrat question 94129 by: Bas Jochems Array question 94130 by: Bas Jochems 94131 by: Michal Dvoracek Re: The so-called improvment in PHP 4.2.0 94133 by: Rouvas Stathis dynamic drop down 94134 by: Kunal Jhunjhunwala Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- um - (unix) grep (windows) find files That's something that I've been wanting for a while - a function call stack that the php script can look at. -Original Message- From: Nico van der Dussen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 3:04 AM To: [EMAIL PROTECTED] Subject: [PHP] From where was function called? Hi, I'm having a real problem: In a codeset of more than 5000 lines of code, I have a rogue call to a function. Is there a way I can determine in a function from where the call was made? (Filename, linenumber etc) Thanks Nico -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- You can use the 'magic constants' __FILE__ and __LINE__ For example, if you have an editor that can replace the newline \n character, you can replace all \n with \nerror_log(__FILE__ . '[' . __LINE__ . ']'); Nico Van Der Dussen [EMAIL PROTECTED] wrote in message 3CC45EB5.6064.19C3129@localhost">news:3CC45EB5.6064.19C3129@localhost... Hi, I'm having a real problem: In a codeset of more than 5000 lines of code, I have a rogue call to a function. Is there a way I can determine in a function from where the call was made? (Filename, linenumber etc) Thanks Nico ---End Message--- ---BeginMessage--- What about: 1. getting rid of anything between script and /script.* 2. get rid of any attributes that start with on and end with a quotes or space Maybe I'm forgetting about some valid attributes that start with on, you might have to cater for them Does this work? HTH Martin -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 6:49 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: AW: [PHP] Re: Second opinion needed - javascript blocker Thynks, but I don't want to block html, I want to block javascript! And since onmouseover and similar events can be put in any tag, I'm trying to block them. on 4/22/02 4:44 PM, J Smith at [EMAIL PROTECTED] wrote: Then I'd suggest using the strip_tags() function and define which tags you'd like to leave untouched. J Red Wingate wrote: He might want to use this function but doing so no links or bold underline Tags will be destroyed as well. ---End Message---
[PHP] file download in IE
Hi! How on earth do I make Internet Explorer to download a file generated with: header(Content-type: application/octet-stream); header(Content-Disposition: attachment; filename=$fname); include($this-dir . $fname); exit; It works on http but I need it on https and if I try to download it through https Internet explorer says it can't find the website.. after it asks me if I want to save the file. I have checked the page and it works with: netscape under windows and konqueror, galeon, netscape under linux. I have seen reports on the web about this feature of Internet explorer and they all say to download some service pack.. I have updated my internet explorer to the latest 6 version with all the updates on the web but it still does not work! Anyone knows a workaround for this? I don't want to do it with header (Location: somefile) because the file that I want to make available for download is outside the webroot and i want it to be accessible only through my script. Thanks a lot! Eagerly waiting for a response, Mihai -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ASP to PHP
I got a strange request from a client. He wants to be able to take his ASP pages and move them over to PHP so that he can run them on apache on his linux server. I saw a tool yesterday ASP2PHP, but I am wanting to know does it work, how much is lost, is it easy to use? Is there another way to change ASP file to PHP with out a lot of re-writes? Chuck Payne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] file download in IE
I think this is only an issue with an un-patched IE5.01, anything higher than that should work fine. .b -Original Message- From: Negrea Mihai [mailto:[EMAIL PROTECTED]] Sent: 23 April 2002 12:26 To: [EMAIL PROTECTED] Subject: [PHP] file download in IE Hi! How on earth do I make Internet Explorer to download a file generated with: header(Content-type: application/octet-stream); header(Content-Disposition: attachment; filename=$fname); include($this-dir . $fname); exit; It works on http but I need it on https and if I try to download it through https Internet explorer says it can't find the website.. after it asks me if I want to save the file. I have checked the page and it works with: netscape under windows and konqueror, galeon, netscape under linux. I have seen reports on the web about this feature of Internet explorer and they all say to download some service pack.. I have updated my internet explorer to the latest 6 version with all the updates on the web but it still does not work! Anyone knows a workaround for this? I don't want to do it with header (Location: somefile) because the file that I want to make available for download is outside the webroot and i want it to be accessible only through my script. Thanks a lot! Eagerly waiting for a response, Mihai -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ASP to PHP
Having moved a moderately sized website last year from ASP to PHP I can say from experience that if you can re-write it, the move will go smoother and you will have fewer lines of code. I ended up with about 1/2 as many lines of code to maintain after the port was done. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 6:38 AM To: [EMAIL PROTECTED] Subject: [PHP] ASP to PHP I got a strange request from a client. He wants to be able to take his ASP pages and move them over to PHP so that he can run them on apache on his linux server. I saw a tool yesterday ASP2PHP, but I am wanting to know does it work, how much is lost, is it easy to use? Is there another way to change ASP file to PHP with out a lot of re-writes? Chuck Payne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic drop down
Hi Kunul, I think I have code that does what you want: function QuickJumpSelect($name=, $optionvalues, $optionnames, $stylestr=) { ($stylestr != )? $style = $stylestr : $style = ; // Calculate stuff $count = count($optionnames); $output = ; // -- Start outputting the SELECT -- $output .= SELECT NAME=\$name\$style $size OnChange=JumpToRef(this); $output .= option value=\\Jump to:/option\n; for($idx = 0; $idx $count; ++$idx){ $name = $optionnames[$idx]; $val = trim($optionvalues[$idx]); $output .= option value=\$val\$name/option\n; } $output .= /SELECT\n; return $output; } // - end function --- Call it like this: $JumpPad = QuickJumpSelect(EenieMeenieMinyMoe, $array_of_urls, $array_of_names_to_show_in_list, $stylestring); stylestring is a CSS argument, like: $stylestring = style=\width: 100px; font-family: Arial; font-size: 10px\; Now you can just print $JumpPad where you want it to be. --- All the best, Eivind :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ASP to PHP
I am in the process of porting an ASP site to PHP and am really chuffed with how easy it is so far. I am slightly worried that doing a straight conversion may not be the best idea, but I plan to go through the site again when i'm done, and optimise for PHP where possible. .b -Original Message- From: Cal Evans [mailto:[EMAIL PROTECTED]] Sent: 23 April 2002 12:53 To: Chuck PUP Payne; [EMAIL PROTECTED] Subject: RE: [PHP] ASP to PHP Having moved a moderately sized website last year from ASP to PHP I can say from experience that if you can re-write it, the move will go smoother and you will have fewer lines of code. I ended up with about 1/2 as many lines of code to maintain after the port was done. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 6:38 AM To: [EMAIL PROTECTED] Subject: [PHP] ASP to PHP I got a strange request from a client. He wants to be able to take his ASP pages and move them over to PHP so that he can run them on apache on his linux server. I saw a tool yesterday ASP2PHP, but I am wanting to know does it work, how much is lost, is it easy to use? Is there another way to change ASP file to PHP with out a lot of re-writes? Chuck Payne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array indices
Hi all, I have a question regarding array indices: At a certain point in code, I run array_diff() on two arrays to produce a reduced version of one of the argument arrays. Problem is, I dont want the key-value associations to be preserved. I need that the returned array has new (integer, not string) indices in numerical order from 0...N without holes. Does anybody know how to do this? I have looked at different sort functions etc, but I'd rather not do a sort to the array. The code is for random selection with reduction of the sample set (i.e. with withdrawal). All the best, Eivind -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: IP of visitors
This variable contains the IP address of the visitor: $HTTP_SERVER_VARS[REMOTE_ADDR] Best regards, Eivind -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: get ip of visitors
This variable contains the IP address of the visitor: $HTTP_SERVER_VARS[REMOTE_ADDR] Best regards, Eivind - Original Message - From: Cosmin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 12:16 PM Subject: [PHP] Re: get ip of visitors Thanks to all, very usefull samples Cosmin Cosmin Vlasiu [EMAIL PROTECTED] wrote in message 007d01c1ea9d$9db78660$[EMAIL PROTECTED]">news:007d01c1ea9d$9db78660$[EMAIL PROTECTED]... Hello, How can I take the IP of the visitator of my php page? not gethostbyname... I need the ip of any visitator not for the specified visitator. Thank you Cosmin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] object variables declararing
hi have look at this code: class test { function test(){ //$this-a = 10; print_r($this); } function test2(){ print_r($this); } } $t=new test(); $t-test2(); what do you see? empty object twice... now uncomment the commented line. now the object got a variable - which is quite unusual, because what`s the reason for declaring them with var keyword except nice looking code? i uderstand on-the-flight creation of local variables, but class variables? hm... can someone explain the reason of enabling this possibility? rash -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP-script in MySQL-table
Hi all, I would like to enter ?php include (doc.php);? directly into MySQL-table. How do I escape? the above so that the script is executed? Is it possible? Web inventor Michael Cronstrom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic drop down
Are you talking about refreshing/dynamicly modifying the pull-down (client side, javascript), or refreshing the page (server side, php)?? You can set a pull down to submit the form onchange, (check out javascript sites for this FAQ) and the action of your form would be something like (untested): FORM action=?= $PHP_SELF.?.$QUERY_STRING ? method=post This will call the current page, with the current query string, which I thin is your question. Justin French - http://indent.com.au http://soundpimps.com - on 23/04/02 9:01 PM, Kunal Jhunjhunwala ([EMAIL PROTECTED]) wrote: Hey, I am trying to make a drop down list such that, when some one selects an option, it refreshs and displays the option on the same page. There are a couple of things already in the URL [ the query string ], which need to remain there. How would I do this easily? Regards, Kunal Jhunjhunwala Minds think with ideas, not information. No amount of data, bandwidth, or processing power can substitute for inspired thought. - Clifford Stoll -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4.1.2 problem with IE
I disagree with your assessment of the situation being related to the index.html. If I browse directly to http://gdpim.glencoe.com/login/login.php (using IE 6.0 on Windows) I get an error from IE (not from the webserver) saying 'The page cannot be displayed. It is the same error that I get if I enter the URL http://127.0.0.1 and I don't have a webserver running on my local machine. Also, the problem doesn't always show up. Only some times. There are times you can browse right to http://gdpim.glencoe.com/login/login.php and it works first time out. Sometimes you see the error pages and press refresh several times before you see the correctly built page. Thanks again for your assistance Dave Sugar [EMAIL PROTECTED] Richard Archer [EMAIL PROTECTED] wrote in message news:p05100315b8ea3acf218b@[210.49.237.250]... At 5:30 PM -0400 22/4/02, Dave Sugar wrote: The forward page is using the HTTP meta tag, as follows: meta HTTP-EQUIV=REFRESH CONTENT=0;URL=login/login.php I don't see any errors in the Apache logs regarding this (in error.log). I also don't see the page sent to the client (in server.log). Hi Dave, This implies Explorer is failing to interpret the meta refresh properly, and is not contacting the server to request the correct page. It seems to be working fine on the limited versions of IE I have here. Try using the full URL in that tag: meta HTTP-EQUIV=REFRESH CONTENT=0;URL= http://gdpim.glencoe.com/login/login.php; Another option (and this is how I always set these redirections up) is to set up an index.php file containing: ? header(Status: 404 Condition Intercepted); header(Location: http://gdpim.glencoe.com/login/login.php;); ? You will also need to add index.php to the DirectoryIndex line in httpd.conf: DirectoryIndex index.cgi index.pl index.html index.htm index.php I have posted the entire Apache Config file, but I think this overkill: Too much information is better than not enough :) ...R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Empty $_SESSION and $_POST ??
First thing I should say is, you only need to quote the relevant part of an email -- that way, everyone knows exactly what to read (rather than pages of old email threads) to answer the question. But don't worry about it. Now, on to your situation -- That clears up a lot. I sort of thought doing: $bozo = $_GET['bozo']; would be OK. It seems it's the ONLY way my script will allow the array to be put into the database (PostgreSQL). If I type into the INSERT command $bozo, $next_var, $next_next_var // it works $_GET['bozo'], $_GET['next_var'], etc // I get T_Variable undefined Well, it would be most helpful to see your actual INSERT statement, but I'm going to take a guess at what you're doing. You're probably doing it like this: $sql = INSERT INTO table (row1, row2, row3) VALUES ($_GET['bozo'], $_GET['dodo'], $_GET['next_var']); And this is why you're having a problem. As cool as the superglobals are, their biggest inconvenience is that you can't use them inside of quoted strings like you can with the more simple variable names. In other words, you used to be able to do $sql = INSERT INTO table (row1, row2, row3) VALUES ($bozo, $dodo, $next_var); And the variable names would automatically expand to their values inside the string. With superglobals, you need to actually break out of the string by using the dot to append variable names. So if you don't want to assign all of your superglobals to simpler $variablenames, you can do it this way: $sql = INSERT INTO table (row1, row2, row3) VALUES ( . $_GET['bozo'] . , . $_GET['dodo'] . , . $_GET['next_var']; Here, what I've done is created a string that is broken into separate concatenated bits with the dot (concatenation) operator. If you have a syntax-coloring text editor, it will be a BIG help because it will colorize the strings so that you can get a better feel for what you're doing. I strongly recommend that you get a hold of one, from what I understand there are free ones for Windows and I'm pretty sure that emacs and vim on Unix can do it. Another way to do it is to use the braces to single out your variable name, here is the same example done in this way: $sql = INSERT INTO table (row1, row2, row3) VALUES ({$_GET['bozo']}, {$_GET['dodo']}, {$_GET['next_var']}); By doing this you don't have to break out of the string and concatenate. I prefer to do the concatenation, but it's really a matter of choice -- you could even use sprintf() to do the same thing: $sql = sprintf(INSERT INTO table (row1, row2, row3) VALUES (%s, %s, %s), $_GET['bozo'], $_GET['dodo'], $_GET['next_var']); See, there's a lot of different ways to do it. In my opinion, it is only a minor inconvenience to have to work around this, and I far prefer to use the superglobals if only to help remind me as to which kind of variable I'm talking about (a GET var vs a POST var vs a SESSION var). In the application I'm developing I have a LOT of variables. ** /* This page is actually a confirmation page, I've tried to collect the info from page 1 ($bozo) and page 2 ($dodo) and print them to screen as in */ $bozo = $_GET['bozo']; $dodo = $_GET['dodo']; print $bozo $dodo; /* I've also tried $_SESSION['bozo'], $_GET['bozo'], left out the '$bozo = $_GET['bozo']' etc, etc, etc. -- I don't know what I'm doing here!! Help! ! */ ? What seems to be the problem here? The problem here is that $_SESSION['anything'] or $_GET['anything'] doesn't work. It refuses to print or pass anything. Why? I can't figure that out? I've tried a simple test, and yes the globals are off. But using the $bozo = $_GET['bozo']; approach, at least it writes to the database, but I cannot access the arrays at all??? And, I HAVE to write these for ALL the variables, else it doesn't get passed to the db. Sigh. So where am I messing up? I'm not sure that you are -- it shouldn't be refusing to print or pass anything. Test to make sure that your PHP binary is working correctly, with the following script: htmlheadtitletest/title/head body pMy name is: ?php if (isset($_GET['name']) !empty($_GET['name'])) { print strong . $_GET['name'] . /strong/p\n; } else { print form method=\get\ action=\ . $_SERVER['PHP_SELF'] . \ input type=\text\ name=\name\ //p pinput
[PHP] Cgi modules
I have php compiled as both a module and cgi on my server... Running php from the command line works just fine, no unexpected output.. However running it as cgi from the webserver is really wierd... The very first line #!/usr/bin/local/php ALWAYS shows up on the webpage... Its driving me nuts.. This line is supposed to be parsed out or what ever, although im not sure if php or apache does it... Normal perl cgis work fine and don't have this extra line.. The funny thing is even though something is clearly going wrong the servers work... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP-script in MySQL-table
Not sure if this is exactly what you are looking for, but you might want to take a look at the Eval function. (http://www.php.net/manual/en/function.eval.php ) /a Michael Cronström said: Hi all, I would like to enter ?php include (doc.php);? directly into MySQL-table. How do I escape? the above so that the script is executed? Is it possible? Web inventor Michael Cronstrom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Andreas Stehn http://www.stehn.com I do not read or respond to mail with HTML attachments. Statement concerning unsolicited e-mail according to Swedish law: http://www.stehn.com/email ACK and you shall receive. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] remove last character in a string
-Original Message- From: Evan Nemerson [mailto:[EMAIL PROTECTED]] Sent: 23 April 2002 04:54 Why get strlen involved??? $string = substr($string, 0, -1); Why get quotes involved??? $string = substr($string, 0, -1); Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: PHP 4.2.0 Release Announcement
Does anybody know if they completed the handling of the 'echo shortcut' to work with all 3 opening tag styles? (As of 4.0.x, I seem to recall that '?=' and '%=' were equivalent to '? echo', and '% echo' respectively, but '?php=' wasn't equivalent to '?php echo'. I also seem to recall some mention somewhere that it would be fixed in 4.2, though I could be misremembering.) - Theo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Better standards in PHP-coding
-Original Message- From: michael kimsal [mailto:[EMAIL PROTECTED]] Sent: 21 April 2002 04:17 Second, *HOW MANY* PHP statements can be followed by a { ? I can think of three if (foo) { function foo () { class foo { Maybe there's one more that I'm missing [...] Off the top of my head: for foreach while do switch ... and I'm bound to have missed at least one! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Page Refresh
I use a template page and then split out the middle of the page to do my PHP stuff depending on a variable I pass to it. I have a problem I hope someone can help me on. The template page has a meta refresh in the header set for 60 secs. One of the things this page does is insert data into a MySQL database. The problem is once it is finished it displays the same form used to enter the data in the MySql database for another record to be added if you wish...here comes the problem. After the first insert, the data form is redisplayed, but after the 60 secs and the refresh takes place it runs the last insert again. If the user just leaves that page up, every 60 secs it will insert another record every 60 secs. I was thinking there may be a mechanism to redirect to a different URL after the database insert, but I do not know how to do that. I want to keep the meta refresh because there is a lot of dynamic data displayed on the template page that changes. Which is the reason for the Meta Refresh to begin with... Christopher J. Crane Network Operations Manager IKON Office Solutions 860.659.6464
RE: [PHP] file download in IE
On Tue, 23 Apr 2002, .ben wrote: I think this is only an issue with an un-patched IE5.01, anything higher than that should work fine. In my experience, there're problems even with MSIE 6.x. Regards, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] remove last character in a string
Haha you wouldn't feel that way if you saw some of MY code... ;) On Monday 22 April 2002 20:57 pm, you wrote: Because I'm kinda stupid. :) tyler - Original Message - From: Evan Nemerson [EMAIL PROTECTED] To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, April 22, 2002 10:53 PM Subject: Re: [PHP] remove last character in a string Why get strlen involved??? $string = substr($string, 0, -1); -- He is richest who is content with the least, for content is the wealth of nature. Socrates -- Who speaks of liberty while the human mind is in chains? Francis Wright -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] extracting a html file name
Hello, Anybody have any suggestions on how i could get the test.html from the following: http://www.mydomain.com/member.php/randy/test.html Here is the part that I am having trouble with: the randy is not a directory it is a member name so it can change ie bill, car, jack, moneypower etc... example http://www.mydomain.com/member.php/moneypower/test.html I have experimented with the php variables that come in , but the only way I could figure out to get test.html out of there is If I captured the $PATH_INFO AND did a str_replace on all the html filenames on that site and did another one to get rid of the / . then I would have the member name and then i could do a string replace on the member name from the path info, which works , for now but as I get more files etc, it's gonna be a pain in the butt, there has to be a better way to do it. Any suggestions? Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The so-called improvment in PHP 4.2.0
On Tuesday, April 23, 2002, at 06:48 AM, Rouvas Stathis wrote: This change improves your security, so it'd be rational to be happy about it. No it doesn't. It just provides another excuse for lazy programming. Nothing will save a lazy programmer or one that doesn't understand basic principles. While I agree that it doesn't improve security much if the coder was already using $HTTP_SESSION_VARS (which he/she should have been doing), it definitely does not promote lazy programming. If anything, registering all the variables as global promotes lazy programming! Sure, it's convenient to be able to access a variable with this shorter method, but do you really want all of these different session variables, post variables, get variables, cookie variables, and server variables sharing the same global namespace/scope? (I use that last term loosely.) IMHO that is much lazier than using superglobals with register_globals off. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP editor for windows
HTMLEDITOR is very good. I use it and i catch beatifull results. - Original Message - From: .ben [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Monday, April 22, 2002 9:36 AM Subject: [PHP] PHP editor for windows Other than notepad, interdev, ultraedit, etc (which i currently use for editing), does anyone know of a good editor for PHP for Windows, ideally with syntax colouring, etc? Cheers, .ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: PHP 4.2.0 Release Announcement
No, this has not been implemented. I can't think of anything uglier and less sensical than ?php=2? Code should be readable and not misleading. -Rasmus On Tue, 23 Apr 2002, Brinkman, Theodore wrote: Does anybody know if they completed the handling of the 'echo shortcut' to work with all 3 opening tag styles? (As of 4.0.x, I seem to recall that '?=' and '%=' were equivalent to '? echo', and '% echo' respectively, but '?php=' wasn't equivalent to '?php echo'. I also seem to recall some mention somewhere that it would be fixed in 4.2, though I could be misremembering.) - Theo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic drop down
On Tuesday, April 23, 2002, at 07:01 AM, Kunal Jhunjhunwala wrote: I am trying to make a drop down list such that, when some one selects an option, it refreshs and displays the option on the same page. There are a couple of things already in the URL [ the query string ], which need to remain there. How would I do this easily? First, you need to use JavaScript (I think the onchange handler) to automatically submit the form when the user selects an option from the dropdown list. That's no big deal. But to maintain the querystring, you will need to do a bit of finagling -- but it's nothing hard. You could either use $_SERVER['QUERYSTRING'] and place the value of this variable into a hidden form field, or you could do a foreach ($_GET) and concatenate the results into a string and place that into a hidden form field. If you aren't sure what I'm talking about I can write up an example. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] extracting a html file name
On Tuesday 23 April 2002 6:59 pm, [EMAIL PROTECTED] wrote: ie bill, car, jack, moneypower etc... example http://www.mydomain.com/member.php/moneypower/test.html I have experimented with the php variables that come in , but the only way I could figure out to get test.html out of there is If I captured the $PATH_INFO AND did a str_replace on all the html filenames on that site and did another one to get rid of the / . then I would have the member name and then i could do a string replace on the member name from the path info, which works , for now but as I get more files etc, it's gonna be a pain in the butt, there has to be a better way to do it. Hi the function you need is explode. try $my_path = explode(/,$PATH_INFO); array_shift($my_path); so $my_path[0] will be moneypower using the above $my_path[1] will be test.html HTH matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Page Refresh
You could use a SESSION variable called for instance 'SUBMIT_TO_DB'. After submitting to the database, you simply set this variable 'SUBMIT_TO_DB' to 'NO'... The next time the page is reloaded, you won't have to submit one more time to the database, provided you check whether 'SUBMIT_TO_DB' is 'NO'. And opposite: if it is not set, you SHOULD do the submission to DB. My $0.02 Eivind -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP editor for windows
There is also one called 'phpbuilder'... Eivind -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do i upgrade from PHP 4.1.2 to 4.2.0?
What do I have to do to upgrade from PHP 4.1.2 to 4.2.0? Do I just overwrite all the old PHP files with the new ones or must I do something else? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] extracting a html file name
Matt, Thanks That worked perfectly! I cannot believe I did not think of explode, i have used it before :-) Thanks again, Randy - Original Message - From: Matt Williams [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Dave Sugar [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 10:02 AM Subject: Re: [PHP] extracting a html file name On Tuesday 23 April 2002 6:59 pm, [EMAIL PROTECTED] wrote: ie bill, car, jack, moneypower etc... example http://www.mydomain.com/member.php/moneypower/test.html I have experimented with the php variables that come in , but the only way I could figure out to get test.html out of there is If I captured the $PATH_INFO AND did a str_replace on all the html filenames on that site and did another one to get rid of the / . then I would have the member name and then i could do a string replace on the member name from the path info, which works , for now but as I get more files etc, it's gonna be a pain in the butt, there has to be a better way to do it. Hi the function you need is explode. try $my_path = explode(/,$PATH_INFO); array_shift($my_path); so $my_path[0] will be moneypower using the above $my_path[1] will be test.html HTH matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dynamic drop down
Do you want to submit every time the dropdown changes? If you just want the second dropdown to update and don't want a submit, let me know. I am doing this in one of my programs and I can send you some code if you think it would help. Ex of my program: We want to show populations. There's a state box and when you select a state then the county box fills up with counties for that state (along with an Entire State option). We have them set up using boxes that are 3 tall, I think (maybe 5). For some reason it didn't work as well when we did regular dropdowns, so this was our current workaround. We use onload in the body tag, onchange in the state box tag, and use a JS method to populate the second dropdown. Good luck! -Natalie -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 10:02 AM To: Kunal Jhunjhunwala Cc: php-list Subject: Re: [PHP] dynamic drop down On Tuesday, April 23, 2002, at 07:01 AM, Kunal Jhunjhunwala wrote: I am trying to make a drop down list such that, when some one selects an option, it refreshs and displays the option on the same page. There are a couple of things already in the URL [ the query string ], which need to remain there. How would I do this easily? First, you need to use JavaScript (I think the onchange handler) to automatically submit the form when the user selects an option from the dropdown list. That's no big deal. But to maintain the querystring, you will need to do a bit of finagling -- but it's nothing hard. You could either use $_SERVER['QUERYSTRING'] and place the value of this variable into a hidden form field, or you could do a foreach ($_GET) and concatenate the results into a string and place that into a hidden form field. If you aren't sure what I'm talking about I can write up an example. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do i upgrade from PHP 4.1.2 to 4.2.0?
Just do it like you're installing new. You don't have to remove the old one, just: ./configure --blah-blah make make install restart apache. Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com - Original Message - From: Sebastian A. [EMAIL PROTECTED] To: PHP General List (PHP.NET) [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 9:10 AM Subject: [PHP] How do i upgrade from PHP 4.1.2 to 4.2.0? What do I have to do to upgrade from PHP 4.1.2 to 4.2.0? Do I just overwrite all the old PHP files with the new ones or must I do something else? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How do i upgrade from PHP 4.1.2 to 4.2.0?
Are you using Windows? That's the one I can give you a tip about :-) Stop the server, overwrite all php files with the new ones, pick up the new php4ts.dll and copy it to your Windows, Windows\System and Windows\System32. Restart the server :-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Sebastian A. [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What do I have to do to upgrade from PHP 4.1.2 to 4.2.0? Do I just overwrite all the old PHP files with the new ones or must I do something else? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: extracting a html file name
not exactly sure if what you want is to extract the username or if its the html file at the end but here goes.. To extract the html file you could use basename() ex: $file = basename(http://www.mydomain.com/member.php/randy/test.html;); echo $file; // outputs test.html if you want the username you can either do what Matt Williams suggested or use substr and strrpos to extract it. [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, Anybody have any suggestions on how i could get the test.html from the following: http://www.mydomain.com/member.php/randy/test.html Here is the part that I am having trouble with: the randy is not a directory it is a member name so it can change ie bill, car, jack, moneypower etc... example http://www.mydomain.com/member.php/moneypower/test.html I have experimented with the php variables that come in , but the only way I could figure out to get test.html out of there is If I captured the $PATH_INFO AND did a str_replace on all the html filenames on that site and did another one to get rid of the / . then I would have the member name and then i could do a string replace on the member name from the path info, which works , for now but as I get more files etc, it's gonna be a pain in the butt, there has to be a better way to do it. Any suggestions? Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Add FTP user via PHP?
Is there a way to add an ftp user and assign them to a directory when the host server does not and will not load the ftp module? Shane McBride RDI Technologies www.rditech.net Office: 410-575-6326 Fax:410-575-6327 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The so-called improvment in PHP 4.2.0
On Tue, 23 Apr 2002, Rouvas Stathis wrote: Miguel Cruz wrote: On Mon, 22 Apr 2002, Leif K-Brooks wrote: I use $formvar for form processing, I don't use the arrays. This is how I was taught to do it. If my host upgrades to 4.2.0, my website is as good as gone! What am I supposed to do?! Fix them! This direction was first announced in 4Q1999; 2.5 years ought to be enough preparation time. No, it isn't! For anything that breaks old functionality, 'forever' is not enough time. It doesn't break old functionality. You just have to read the manual. Either leave your php.ini file untouched from your earlier installation (which is not a difficult undertaking), or override the global import feature on a site-by-site (or directory-by-directory) basis using your web server's configuration tools. This change improves your security, so it'd be rational to be happy about it. No it doesn't. It just provides another excuse for lazy programming. Nothing will save a lazy programmer or one that doesn't understand basic principles. I disagree. You cannot expect everyone to be perfect. The fact is that people make mistakes and go through a learning process, and anything that helps them through this is a benefit to all. Otherwise why have any security features at all? Firewalls encourage lazy programming! Locks and police encourage lazy domestic vigilance! And it's not lazy to assume a variable starts with value NULL, in a language with no storage declaration requirements and where the documentation says that variables start with value NULL. Just because C or Pascal require you to do something, doesn't mean that you are being lazy for not doing it elsewhere. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add FTP user via PHP?
Could you write the user info to a file and have a cron job parse the file and add them as a user? - Original Message - From: Shane McBride [EMAIL PROTECTED] To: Php-General [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 9:43 AM Subject: [PHP] Add FTP user via PHP? Is there a way to add an ftp user and assign them to a directory when the host server does not and will not load the ftp module? Shane McBride RDI Technologies www.rditech.net Office: 410-575-6326 Fax:410-575-6327 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Send mail and attachment with php - looking for PHP module
Hi, I'm looking for PHP module which allows to send mail and attachment both. Is there any one ? Thank You for any suggestions. Krzysztof -- Muzyka dla Twoich uszu... http://link.interia.pl/f15ac -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Send mail and attachment with php - looking for PHP module
function mail_attachment ($to, $subject, $message, $addr_from, $attachment, $filename) { /* This function sends an e-mail with a file attachment using the standard PHP mail function with parameters $to, $subject and $message. The $attachment parameter is a string with the attachment file content with filename $filename. */ $boundary = b.md5(uniqid(time())); $mime = From: $addr_from\n; $mime .= Reply-To: $addr_from\n; $mime .= X-Mailer: JOHN DOE\n; $mime .= X-Sender: $addr_from\n; $mime .= Content-type: multipart/mixed; ; $mime .= boundary = $boundary\r\n\r\n; $mime .= This is a MIME encoded message.\r\n\r\n; // First the regular message $mime .= --$boundary\r\n; $mime .= Content-type: text/plain\r\n; $mime .= Content-Transfer-Encoding: base64; $mime .= \r\n\r\n.chunk_split(base64_encode($message)).\r\n; // Now the attachment $mime .= --$boundary\r\n; $mime .= Content-type: text/plain\r\n; $mime .= Content-Transfer-Encoding: base64\r\n; $mime .= Content-Disposition: attachment; ; $mime .= filename = .chr(34).$filename.chr(34); $mime .= \r\n\r\n.chunk_split(base64_encode($attachment)).\n; mail ($to, $subject, , $mime); } Regards Rudolf Visagie Principal Software Developer Digital Healthcare Solutions -Original Message- From: Krzysztof Kocjan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 4:49 PM To: [EMAIL PROTECTED] Subject: [PHP] Send mail and attachment with php - looking for PHP module Hi, I'm looking for PHP module which allows to send mail and attachment both. Is there any one ? Thank You for any suggestions. Krzysztof -- Muzyka dla Twoich uszu... http://link.interia.pl/f15ac -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MSSQL help w/ auto_increment
Im having a problem wiht creating a db in MSSQL, Ive only used Mysql be for so I tryed the syntax just the same way. Im trying to execute this code: create table test ( news_id int not null auto_increment , title varchar(50) not null , ndate varchar(50) not null , headline varchar(150) not null , fullarticle text not null , lang varchar(50) not null , PRIMARY KEY(news_id)) But it gives me an error on the auto_increment, which I assume is wrong for MSSQL, Ive been searching the web for any results regarding to this problem of mine without any luck so I hope you can find it in your heart to help me if you can :) Thaks for your time http://www.atom.is/ Davíð Örn Jóhannssson Vefforritari Atómstöðin hf. Garðastræti 37 101 Reykjavík sími: 595-3643 fax: 595-3649 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] http://www.atom.is/ http://www.atom.is
Re: [PHP] MSSQL help w/ auto_increment
I believe the auto increment field has to be set as the primary key as well. - Original Message - From: David Orn Johannsson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 10:04 AM Subject: [PHP] MSSQL help w/ auto_increment I'm having a problem wiht creating a db in MSSQL, I've only used Mysql be for so I tryed the syntax just the same way. I'm trying to execute this code: create table test ( news_id int not null auto_increment , title varchar(50) not null , ndate varchar(50) not null , headline varchar(150) not null , fullarticle text not null , lang varchar(50) not null , PRIMARY KEY(news_id)) But it gives me an error on the auto_increment, which I assume is wrong for MSSQL, I've been searching the web for any results regarding to this problem of mine without any luck so I hope you can find it in your heart to help me if you can :) Thaks for your time http://www.atom.is/ Davíð Örn Jóhannssson Vefforritari Atómstöðin hf. Garðastræti 37 101 Reykjavík sími: 595-3643 fax: 595-3649 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] http://www.atom.is/ http://www.atom.is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Page Refresh
That is my goal to only use only file and I do use a lot of IF statements. I will try this. I have not used the Header() function. I will take a look at it. If you have an example, that would be great. -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 10:06 AM To: Crane, Christopher Subject: Re: [PHP] Page Refresh Importance: High i don't undertand why you have the meta refresh in there, but the porblem you have is simular to any one who clicks refresh on their browser... essentialy, what you want to do is after the DB insert, use a header() redirect to a blank form -- steps might look like: 1. form.php (blank) [click submit] 2. validate.php a) if not ok redirect to form.php (with entered data) b) if ok, insert into DB redirect to form.php (blank) In other words, form.php doesn't actually print any data to the screen, it just evaluates the entered data, and acts upon it. The value of this is that if the user never sees validate.php, they can't refresh it (or have a meta refresh), so the data can't be inserted more than once via a refresh. if they refresh the form.php, the DB will not be affected. If you're cleaver with if() statements and other control structures, you can actually achieve this effect with only one file (form.php)... but that's another story :) Have fun, Justin French Creative Director http://Indent.com.au on 23/04/02 11:47 PM, Crane, Christopher ([EMAIL PROTECTED]) wrote: I use a template page and then split out the middle of the page to do my PHP stuff depending on a variable I pass to it. I have a problem I hope someone can help me on. The template page has a meta refresh in the header set for 60 secs. One of the things this page does is insert data into a MySQL database. The problem is once it is finished it displays the same form used to enter the data in the MySql database for another record to be added if you wish...here comes the problem. After the first insert, the data form is redisplayed, but after the 60 secs and the refresh takes place it runs the last insert again. If the user just leaves that page up, every 60 secs it will insert another record every 60 secs. I was thinking there may be a mechanism to redirect to a different URL after the database insert, but I do not know how to do that. I want to keep the meta refresh because there is a lot of dynamic data displayed on the template page that changes. Which is the reason for the Meta Refresh to begin with... Christopher J. Crane Network Operations Manager IKON Office Solutions 860.659.6464 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MSSQL help w/ auto_increment
Unfortunately there is a lot of variation from one RDBMS' SQL implementation to another. Try something like this: create table test ( news_id int identity, title varchar(50), blah blah... miguel - Original Message - From: David Orn Johannsson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 10:04 AM Subject: [PHP] MSSQL help w/ auto_increment I'm having a problem wiht creating a db in MSSQL, I've only used Mysql be for so I tryed the syntax just the same way. I'm trying to execute this code: create table test ( news_id int not null auto_increment , title varchar(50) not null , ndate varchar(50) not null , headline varchar(150) not null , fullarticle text not null , lang varchar(50) not null , PRIMARY KEY(news_id)) But it gives me an error on the auto_increment, which I assume is wrong for MSSQL, I've been searching the web for any results regarding to this problem of mine without any luck so I hope you can find it in your heart to help me if you can :) Thaks for your time http://www.atom.is/ Davíð Örn Jóhannssson Vefforritari Atómstöðin hf. Garðastræti 37 101 Reykjavík sími: 595-3643 fax: 595-3649 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] http://www.atom.is/ http://www.atom.is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] List, Key, Value oh my.
I have a problem. I am fetching rows from a MySQL table called temp. Each row has four fields: Name, 1, 2 and 3 Then I do this function which will eventually generate records for a lookup table for any skills in the 1, 2 or 3 fields that equal the string YES associated with the Name (right now it just prints to the web browser while I debug it). function generateLookupTable() { // $query = SELECT * FROM temp; if ( !$result = mysql_query($query) ) { // print(pmysql_error() . br$query/p); } else { // // For each name returned, march through // each skill and insert a row into the // lookup_skill // where the skill value == YES while ( $row = mysql_fetch_array($result) ) { // print(p); // For test while ( list($key,$value) = each($row) ) { print(---\{$key,$value}---); // For test // if ( $key == Name ) { - print(Name is $value, Key = $key | ); } else { if ( $value == YES ) { print($key | ); } } print(br); } print(/p); // For test } } } I have marked an IF statement with the - string. As the while statement marches through the array $row returned from mysql_fetch_array the value of key is set first to 0 then Name then 1 then 2 then 3. Fine. However, the if statement highlighted above winds up being true when the $key == 0 and when $key == Name and I can't see why this would be so. Any possibilities folks? I am quickly working around this now so it is not slowing me down, however, this is just too unusual to not figure out. John ** John Huggins VANet [EMAIL PROTECTED] http://www.va.net/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] List, Key, Value oh my.
I forgot to show you some output from this thing... ---{0,BLOW, JOE}---Name is BLOW, JOE, Key = 0 | ---{Name,BLOW, JOE}---Name is BLOW, JOE, Key = Name | ---{1,YES}---1 | ---{2,}--- ---{3,YES}---3 | The way I see it, that first line should have not printed because $key is equal to 0 not Name. On Tue, 23 Apr 2002, John S. Huggins wrote: - -I have a problem. - -I am fetching rows from a MySQL table called temp. Each row has four -fields: Name, 1, 2 and 3 - -Then I do this function which will eventually generate records for a -lookup table for any skills in the 1, 2 or 3 fields that equal the string -YES associated with the Name (right now it just prints to the web -browser while I debug it). - -function generateLookupTable() { - // - $query = SELECT * FROM temp; - if ( !$result = mysql_query($query) ) { - // - print(pmysql_error() . br$query/p); - } else { - // - // For each name returned, march through - // each skill and insert a row into the - // lookup_skill - // where the skill value == YES - while ( $row = mysql_fetch_array($result) ) { - // - print(p); // For test - while ( list($key,$value) = each($row) ) { - print(---\{$key,$value}---); // For test - // - if ( $key == Name ) { - - print(Name is $value, Key = $key -| ); - } else { - if ( $value == YES ) { - print($key | ); - } - } - print(br); - } - print(/p); // For test - } - } -} - - - -I have marked an IF statement with the - string. As the -while statement marches through the array $row returned from -mysql_fetch_array the value of key is set first to 0 then Name then -1 then 2 then 3. Fine. However, the if statement highlighted above -winds up being true when the $key == 0 and when $key == Name and I -can't see why this would be so. - -Any possibilities folks? I am quickly working around this now so it is -not slowing me down, however, this is just too unusual to not figure out. - -John - - -** - -John Huggins -VANet - [EMAIL PROTECTED] -http://www.va.net/ - -** - - - --- -PHP General Mailing List (http://www.php.net/) -To unsubscribe, visit: http://www.php.net/unsub.php - ** John Huggins VANet [EMAIL PROTECTED] http://www.va.net/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Interesting Links, can be not PHP
The # is used to point to an anchor on a page. Usually, you need the anchor name after the hash symbol, i.e. http://www.example.com/#anchor. However, in this case, odds are it's a JavaScript thing. In some older browsers, like pre-Netscape 4.7, I believe, when you created a link that had an onClick event in it, you still had to provide a real link to make it work. By using the hash symbol on the same page as the one you're on, you don't have to reload the page, and the JavaScript still executes. At least, I seem to remember having to do that a few times... J Mantas Kriauciunas wrote: Hey PHP General List, Well i have seen some strange links last few months earlyer i didn't look at them because i didn't care... and now i am curious... how to understand link like this Http://www.foo.com/# and thats it... links ends and as it sayes for example it links to Our Works page on that website... how to understand that # ? can anybody expain? or give link to explanation ? :--: Have A Nice Day! Mantas Kriauciunas A.k.A mNTKz Contacts: [EMAIL PROTECTED] Http://mntkz-hata.visiems.lt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The so-called improvment in PHP 4.2.0
Erik Price wrote: On Tuesday, April 23, 2002, at 06:48 AM, Rouvas Stathis wrote: This change improves your security, so it'd be rational to be happy about it. No it doesn't. It just provides another excuse for lazy programming. Nothing will save a lazy programmer or one that doesn't understand basic principles. While I agree that it doesn't improve security much if the coder was already using $HTTP_SESSION_VARS (which he/she should have been doing), it definitely does not promote lazy programming. If anything, registering all the variables as global promotes lazy programming! Sure, it's convenient to be able to access a variable with this shorter method, but do you really want all of these different session variables, post variables, get variables, cookie variables, and server variables sharing the same global namespace/scope? (I use that last term loosely.) Preventing namespace pollution...now you convince me. I used the term lazy programming without explaining what I meant, hence the misunderstanding. I refer to lazy programming in the sense of not properly and thoroughly checking user input, or as I believe, any input from external to you code sources. If you don't do that I don't believe that anything will save you. Promoting superglobals as a security enhanchment, no I don't buy that. -Stathis. IMHO that is much lazier than using superglobals with register_globals off. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] List, Key, Value oh my.
Amazing things happen when you compare values of different types. The numerical value of Name is zero. Try using === to compare type as well as value. miguel On Tue, 23 Apr 2002, John S. Huggins wrote: I forgot to show you some output from this thing... ---{0,BLOW, JOE}---Name is BLOW, JOE, Key = 0 | ---{Name,BLOW, JOE}---Name is BLOW, JOE, Key = Name | ---{1,YES}---1 | ---{2,}--- ---{3,YES}---3 | The way I see it, that first line should have not printed because $key is equal to 0 not Name. On Tue, 23 Apr 2002, John S. Huggins wrote: - -I have a problem. - -I am fetching rows from a MySQL table called temp. Each row has four -fields: Name, 1, 2 and 3 - -Then I do this function which will eventually generate records for a -lookup table for any skills in the 1, 2 or 3 fields that equal the string -YES associated with the Name (right now it just prints to the web -browser while I debug it). - -function generateLookupTable() { -// -$query = SELECT * FROM temp; -if ( !$result = mysql_query($query) ) { -// -print(pmysql_error() . br$query/p); -} else { -// -// For each name returned, march through -// each skill and insert a row into the -// lookup_skill -// where the skill value == YES -while ( $row = mysql_fetch_array($result) ) { -// -print(p); // For test -while ( list($key,$value) = each($row) ) { -print(---\{$key,$value}---); // For test -// -if ( $key == Name ) { - -print(Name is $value, Key = $key -| ); -} else { -if ( $value == YES ) { -print($key | ); -} -} -print(br); -} -print(/p); // For test -} -} -} - - - -I have marked an IF statement with the - string. As the -while statement marches through the array $row returned from -mysql_fetch_array the value of key is set first to 0 then Name then -1 then 2 then 3. Fine. However, the if statement highlighted above -winds up being true when the $key == 0 and when $key == Name and I -can't see why this would be so. - -Any possibilities folks? I am quickly working around this now so it is -not slowing me down, however, this is just too unusual to not figure out. - -John - - -** - -John Huggins -VANet - [EMAIL PROTECTED] -http://www.va.net/ - -** - - - --- -PHP General Mailing List (http://www.php.net/) -To unsubscribe, visit: http://www.php.net/unsub.php - ** John Huggins VANet [EMAIL PROTECTED] http://www.va.net/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] transfering a file from one host to another
Is there a way to create a file to a remote host. IE: I have a php script on www.somedomain.com for example - and I want to fill out a form on this php script and make it create a file called index.html on say www.someotherdomain.com for example. I have admin and root access to BOTH domains. Is there a way I can popen or fopen a file using ftp username and password? The end result - I want to create index pages on the fly by filling out a form - which will in return create the page for my other web sites. So far, I have successfully created the index page. But to get it to the other site I am manually downloading the index page to my local computer, and uploading it to its new site - Not the most effective way to do things. Any ideas??? Thanks in advance Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] List, Key, Value oh my.
The Earth shook, Angles sang, there was much rejoicing. Behold Miguel is correct. === did the trick. It sure is nice to know I am not going nuts. Much thanks. John On Tue, 23 Apr 2002, Miguel Cruz wrote: -Amazing things happen when you compare values of different types. The -numerical value of Name is zero. Try using === to compare type as well -as value. - -miguel - -On Tue, 23 Apr 2002, John S. Huggins wrote: - I forgot to show you some output from this thing... - - ---{0,BLOW, JOE}---Name is BLOW, JOE, Key = 0 | - ---{Name,BLOW, JOE}---Name is BLOW, JOE, Key = Name | - ---{1,YES}---1 | - ---{2,}--- - ---{3,YES}---3 | - - The way I see it, that first line should have not printed because $key is - equal to 0 not Name. - - - On Tue, 23 Apr 2002, John S. Huggins wrote: - - - - -I have a problem. - - - -I am fetching rows from a MySQL table called temp. Each row has four - -fields: Name, 1, 2 and 3 - - - -Then I do this function which will eventually generate records for a - -lookup table for any skills in the 1, 2 or 3 fields that equal the string - -YES associated with the Name (right now it just prints to the web - -browser while I debug it). - - - -function generateLookupTable() { - - // - - $query = SELECT * FROM temp; - - if ( !$result = mysql_query($query) ) { - - // - - print(pmysql_error() . br$query/p); - - } else { - - // - - // For each name returned, march through - - // each skill and insert a row into the - - // lookup_skill - - // where the skill value == YES - - while ( $row = mysql_fetch_array($result) ) { - - // - - print(p); // For test - - while ( list($key,$value) = each($row) ) { - - print(---\{$key,$value}---); // For test - - // - - if ( $key == Name ) { - - - print(Name is $value, Key = $key - -| ); - - } else { - - if ( $value == YES ) { - - print($key | ); - - } - - } - - print(br); - - } - - print(/p); // For test - - } - - } - -} - - - - - - - -I have marked an IF statement with the - string. As the - -while statement marches through the array $row returned from - -mysql_fetch_array the value of key is set first to 0 then Name then - -1 then 2 then 3. Fine. However, the if statement highlighted above - -winds up being true when the $key == 0 and when $key == Name and I - -can't see why this would be so. - - - -Any possibilities folks? I am quickly working around this now so it is - -not slowing me down, however, this is just too unusual to not figure out. - - - -John - - - - - -** - - - -John Huggins - -VANet - - - [EMAIL PROTECTED] - -http://www.va.net/ - - - -** - - - - - - - --- - -PHP General Mailing List (http://www.php.net/) - -To unsubscribe, visit: http://www.php.net/unsub.php - - - - ** - - John Huggins - VANet - - [EMAIL PROTECTED] - http://www.va.net/ - - ** - - - - ** John Huggins VANet [EMAIL PROTECTED] http://www.va.net/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The so-called improvment in PHP 4.2.0
On Tuesday, April 23, 2002, at 11:46 AM, Rouvas Stathis wrote: Preventing namespace pollution...now you convince me. I used the term lazy programming without explaining what I meant, hence the misunderstanding. I refer to lazy programming in the sense of not properly and thoroughly checking user input, or as I believe, any input from external to you code sources. If you don't do that I don't believe that anything will save you. Promoting superglobals as a security enhanchment, no I don't buy that. Yes, two different interpretations of laziness. The coder must still be vigillant regarding user input, and check everything. But superglobals, imho do tend to reduce the sloppiness of the final code. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The so-called improvment in PHP 4.2.0
Miguel Cruz wrote: On Tue, 23 Apr 2002, Rouvas Stathis wrote: Miguel Cruz wrote: On Mon, 22 Apr 2002, Leif K-Brooks wrote: I use $formvar for form processing, I don't use the arrays. This is how I was taught to do it. If my host upgrades to 4.2.0, my website is as good as gone! What am I supposed to do?! Fix them! This direction was first announced in 4Q1999; 2.5 years ought to be enough preparation time. No, it isn't! For anything that breaks old functionality, 'forever' is not enough time. It doesn't break old functionality. You just have to read the manual. Either leave your php.ini file untouched from your earlier installation (which is not a difficult undertaking), or override the global import feature on a site-by-site (or directory-by-directory) basis using your web server's configuration tools. Yes, you could do that. But then again, what happens if you have to use a piece of code that someone else has written that did not take the new habbit into account? A number of interesting questions arise when you have to operate that code alogn with newer one. Oh well, I guess everything must change. After all, managing change is what we humans do, don't we:-) This change improves your security, so it'd be rational to be happy about it. No it doesn't. It just provides another excuse for lazy programming. Nothing will save a lazy programmer or one that doesn't understand basic principles. I disagree. You cannot expect everyone to be perfect. The fact is that people make mistakes and go through a learning process, and anything that helps them through this is a benefit to all. Otherwise why have any security features at all? Firewalls encourage lazy programming! Locks and police encourage lazy domestic vigilance! It's just that I don't see any security value in superglobals. If someone does not know enough, he/she will make the same mistake with or without superglobals (from security's point of view). As far as lazy programming, please refer to my previous post. -Stathis. And it's not lazy to assume a variable starts with value NULL, in a language with no storage declaration requirements and where the documentation says that variables start with value NULL. Just because C or Pascal require you to do something, doesn't mean that you are being lazy for not doing it elsewhere. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] If else question
Hi all, I am wondering. When you use an if else statement and a condition exists isn't the if part suppose to stop? Then if the condition doesn't exist it is suppose to do something else? I am wondering because I have a form that goes something like this. select such and such from the table if that condition 1 echo that it can't be found else echo the form But in this case even if the condition 1 it still echoes the form. I am not understanding this. Thanks for your time and help Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
On Tue, 23 Apr 2002, Jennifer Downey wrote: I am wondering. When you use an if else statement and a condition exists isn't the if part suppose to stop? Then if the condition doesn't exist it is suppose to do something else? I am wondering because I have a form that goes something like this. select such and such from the table if that condition 1 echo that it can't be found else echo the form But in this case even if the condition 1 it still echoes the form. I am not understanding this. If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1) echo can't be found; else { echo first line of form; echo second line of form; } miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] List, Key, Value oh my.
Wow, I didn't know Angles could sing...:-) Sorry, bad attempt at humor. -Original Message- From: John S. Huggins [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 11:53 AM To: Miguel Cruz Cc: [EMAIL PROTECTED] Subject: Re: [PHP] List, Key, Value oh my. The Earth shook, Angles sang, there was much rejoicing. Behold Miguel is correct. === did the trick. It sure is nice to know I am not going nuts. Much thanks. John On Tue, 23 Apr 2002, Miguel Cruz wrote: -Amazing things happen when you compare values of different types. The -numerical value of Name is zero. Try using === to compare type as well -as value. - -miguel - -On Tue, 23 Apr 2002, John S. Huggins wrote: - I forgot to show you some output from this thing... - - ---{0,BLOW, JOE}---Name is BLOW, JOE, Key = 0 | - ---{Name,BLOW, JOE}---Name is BLOW, JOE, Key = Name | - ---{1,YES}---1 | - ---{2,}--- - ---{3,YES}---3 | - - The way I see it, that first line should have not printed because $key is - equal to 0 not Name. - - - On Tue, 23 Apr 2002, John S. Huggins wrote: - - - - -I have a problem. - - - -I am fetching rows from a MySQL table called temp. Each row has four - -fields: Name, 1, 2 and 3 - - - -Then I do this function which will eventually generate records for a - -lookup table for any skills in the 1, 2 or 3 fields that equal the string - -YES associated with the Name (right now it just prints to the web - -browser while I debug it). - - - -function generateLookupTable() { - - // - - $query = SELECT * FROM temp; - - if ( !$result = mysql_query($query) ) { - - // - - print(pmysql_error() . br$query/p); - - } else { - - // - - // For each name returned, march through - - // each skill and insert a row into the - - // lookup_skill - - // where the skill value == YES - - while ( $row = mysql_fetch_array($result) ) { - - // - - print(p); // For test - - while ( list($key,$value) = each($row) ) { - - print(---\{$key,$value}---); // For test - - // - - if ( $key == Name ) { - - - print(Name is $value, Key = $key - -| ); - - } else { - - if ( $value == YES ) { - - print($key | ); - - } - - } - - print(br); - - } - - print(/p); // For test - - } - - } - -} - - - - - - - -I have marked an IF statement with the - string. As the - -while statement marches through the array $row returned from - -mysql_fetch_array the value of key is set first to 0 then Name then - -1 then 2 then 3. Fine. However, the if statement highlighted above - -winds up being true when the $key == 0 and when $key == Name and I - -can't see why this would be so. - - - -Any possibilities folks? I am quickly working around this now so it is - -not slowing me down, however, this is just too unusual to not figure out. - - - -John - - - - - -** - - - -John Huggins - -VANet - - - [EMAIL PROTECTED] - -http://www.va.net/ - - - -** - - - - - - - --- - -PHP General Mailing List (http://www.php.net/) - -To unsubscribe, visit: http://www.php.net/unsub.php - - - - ** - - John Huggins - VANet - - [EMAIL PROTECTED] - http://www.va.net/ - - ** - - - - ** John Huggins VANet [EMAIL PROTECTED] http://www.va.net/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1) echo can't be found; else { echo first line of form; echo second line of form; } This is what I have: if($quantity 1) { echo Sorry I can't seem to locate this item; } else { do this } So yes I have done exactly as you have stated and it still shows the form. Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] If else question
Does it show the message and the form or just the message? -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1) echo can't be found; else { echo first line of form; echo second line of form; } This is what I have: if($quantity 1) { echo Sorry I can't seem to locate this item; } else { do this } So yes I have done exactly as you have stated and it still shows the form. Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
It shows both. Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG... Does it show the message and the form or just the message? -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1) echo can't be found; else { echo first line of form; echo second line of form; } This is what I have: if($quantity 1) { echo Sorry I can't seem to locate this item; } else { do this } So yes I have done exactly as you have stated and it still shows the form. Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Browser cache
Hello: How could I disable the browser cache?, I have a script that generates an image and shows it via IMG SRC=myimage. The problem is if I change the image, the browser doesn't reflect the changes until I push refresh. I supose is sending a header, but which header? Best Regards. QaDRAM Studio, RAD Development for the WEB http://studio.qadram.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error connecting to mssql
Im trying to connect to a mssql server but i results a could not connect to server error. The server is Win2000 IIS running MSSQL 2000. PHP 4.1.2 Server API CGI mssql config: mssql MSSQL Support enabled Active Persistent Links 0 Active Links 0 Library version 7.0 Directive Local Value Master Value mssql.allow_persistent On On mssql.batchsize 0 0 mssql.compatability_mode Off Off mssql.connect_timeout 5 5 mssql.datetimeconvert On On mssql.max_links Unlimited Unlimited mssql.max_persistent Unlimited Unlimited mssql.min_error_severity 10 10 mssql.min_message_severity 10 10 mssql.textlimit Server default Server default mssql.textsize Server default Server default mssql.timeout 60 60 http://www.atom.is/ Davíð Örn Jóhannssson Vefforritari Atómstöðin hf. Garðastræti 37 101 Reykjavík sími: 595-3643 fax: 595-3649 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] http://www.atom.is/ http://www.atom.is
Re: [PHP] Browser cache
http://www.php.net/manual/en/function.header.php RT... M :) On Tue, 23 Apr 2002, José León Serna wrote: Hello: How could I disable the browser cache?, I have a script that generates an image and shows it via IMG SRC=myimage. The problem is if I change the image, the browser doesn't reflect the changes until I push refresh. I supose is sending a header, but which header? Best Regards. QaDRAM Studio, RAD Development for the WEB http://studio.qadram.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser cache
José León Serna [EMAIL PROTECTED] wrote: Hello: How could I disable the browser cache?, I have a script that generates an image and shows it via IMG SRC=myimage. The problem is if I change the image, the browser doesn't reflect the changes until I push refresh. I supose is sending a header, but which header? Headers aren't the best way since some browsers do a great job of ignoring them (or at least appearing to). The best way I've found to make sure the content is retrieved from the server is to add ?n to the URL replacing randomnumber with a random number (I usually use the return value from time()). HTH, Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser cache
PLEASE TAKE THIS OUT OF MY THREAD. I am trying to get an answer to my question. Not yours. Thank you Jennifer Stuart Dallas [EMAIL PROTECTED] wrote in message 000d01c1eae5$96243450$de01420a@stuart">news:000d01c1eae5$96243450$de01420a@stuart... José León Serna [EMAIL PROTECTED] wrote: Hello: How could I disable the browser cache?, I have a script that generates an image and shows it via IMG SRC=myimage. The problem is if I change the image, the browser doesn't reflect the changes until I push refresh. I supose is sending a header, but which header? Headers aren't the best way since some browsers do a great job of ignoring them (or at least appearing to). The best way I've found to make sure the content is retrieved from the server is to add ?n to the URL replacing randomnumber with a random number (I usually use the return value from time()). HTH, Stuart --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] If else question
My officemate and I talked about this and the only thing he could come up with was a possible problem with your parser. Are you using a beta version or something unusual? I don't know if you have a way to know this - the programmers didn't set up PHP where I work, but I know our web server is apache and it's on a unix box. I've never run into this problem before. Have you had it happen in other programs? Have you ever used this code in another program? If it's consistently incorrect then it may be a problem with your parser. That's not really my area of expertise, but it's something you could look into if no one else has any better ideas :-) -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question It shows both. Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG... Does it show the message and the form or just the message? -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1) echo can't be found; else { echo first line of form; echo second line of form; } This is what I have: if($quantity 1) { echo Sorry I can't seem to locate this item; } else { do this } So yes I have done exactly as you have stated and it still shows the form. Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] authentication
I have one directory that is protected with an .htaccess file on my server where I store all member content. What I want to do is have a page where members can log in, and after they have entered there user name and password I what the php script to authenticate them against the .htaccess file. If they are authenticated I would like to keep track of that as one of there session variables, so that they do not have to re-authenticate when they try to access content in the protected directory. Essentially what I am trying to do is give them access to the .htaccess protected based from a submit form. Instead of requiring that they get the standard user name and password pop up window that one gets when you try to access a directory that is password protected on Apache.
[PHP] problem compiling Apche 2.0.35 and PHP 4.2.0
OS : Redhat 7.1 apache compile option : --prefix=/path --enable-module=so php compile option : --with-apxs2=/path/bin/apxs --enable-force-cgi-redirect --with-pear --enable-ftp --enable-track-vars --with-esoob --with-gd error on php make : /bin/sh /root/php-4.2.0/libtool --silent --mode=compile gcc -I. -I/root/php-4.2.0/ext/mysql/libmysql -I/root/php-4.2.0/main -I/root /php-4.2.0 - I/usr/local/apache/include -I/root/php-4.2.0/Zend -I/root/php-4.2.0/ext/mysq l/libmysql -I/usr/local/easysoft/oob/client/include -I/root/php- 4.2.0/ext/xml/expat -D_REENTRANT -I/root/php-4.2.0/TSRM -DTHREAD=1 -g -O2 - pthread -DZTS -prefer-pic -c thr_mutex.c In file included from /usr/include/math.h:82, from /root/php-4.2.0/main/php_config.h:1902, from my_config.h:5, from global.h:33, from thr_mutex.c:6: /usr/include/bits/mathcalls.h:176: Internal error: Segmentation fault. Please submit a full bug report. See URL:http://bugzilla.redhat.com/bugzilla/ for instructions. make[4]: *** [thr_mutex.lo] Error 1 make[4]: Leaving directory `/root/php-4.2.0/ext/mysql/libmysql' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/root/php-4.2.0/ext/mysql/libmysql' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/root/php-4.2.0/ext/mysql' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/root/php-4.2.0/ext' make: *** [all-recursive] Error 1 any thoughts/fixes would be appreciated. --- Michael Geier CDM Sports, Inc., Systems Administration email: [EMAIL PROTECTED] phone: 314.991.1511 x 6505 pager: 314.318.9414 || [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
I just looked at my hosting service thinkg it may have been because they just upgraded to 4.1 php. so I dumped my database and loaded it to my machine at home and find that it does the same thing. I have 4.06 php on win me my hosting service is 4.1 php on redhat linux so I'm thinking that is not the case. I have used this code through out my site and this is the only part it does this on and I am not understanding why. Jennifer Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG... My officemate and I talked about this and the only thing he could come up with was a possible problem with your parser. Are you using a beta version or something unusual? I don't know if you have a way to know this - the programmers didn't set up PHP where I work, but I know our web server is apache and it's on a unix box. I've never run into this problem before. Have you had it happen in other programs? Have you ever used this code in another program? If it's consistently incorrect then it may be a problem with your parser. That's not really my area of expertise, but it's something you could look into if no one else has any better ideas :-) -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question It shows both. Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG... Does it show the message and the form or just the message? -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1) echo can't be found; else { echo first line of form; echo second line of form; } This is what I have: if($quantity 1) { echo Sorry I can't seem to locate this item; } else { do this } So yes I have done exactly as you have stated and it still shows the form. Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
Is this a nested if? (inside another if statement?) - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 1:05 PM Subject: Re: [PHP] If else question I just looked at my hosting service thinkg it may have been because they just upgraded to 4.1 php. so I dumped my database and loaded it to my machine at home and find that it does the same thing. I have 4.06 php on win me my hosting service is 4.1 php on redhat linux so I'm thinking that is not the case. I have used this code through out my site and this is the only part it does this on and I am not understanding why. Jennifer Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG... My officemate and I talked about this and the only thing he could come up with was a possible problem with your parser. Are you using a beta version or something unusual? I don't know if you have a way to know this - the programmers didn't set up PHP where I work, but I know our web server is apache and it's on a unix box. I've never run into this problem before. Have you had it happen in other programs? Have you ever used this code in another program? If it's consistently incorrect then it may be a problem with your parser. That's not really my area of expertise, but it's something you could look into if no one else has any better ideas :-) -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question It shows both. Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG... Does it show the message and the form or just the message? -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1) echo can't be found; else { echo first line of form; echo second line of form; } This is what I have: if($quantity 1) { echo Sorry I can't seem to locate this item; } else { do this } So yes I have done exactly as you have stated and it still shows the form. Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
No this is the first if statement but there are nested if's after that. I'd post the code but everyone yells at me about my coding style. If you promise not to yell I will post it. Jennifer -Bd- [EMAIL PROTECTED] wrote in message 001d01c1eae9$d58f4360$[EMAIL PROTECTED]">news:001d01c1eae9$d58f4360$[EMAIL PROTECTED]... Is this a nested if? (inside another if statement?) - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 1:05 PM Subject: Re: [PHP] If else question I just looked at my hosting service thinkg it may have been because they just upgraded to 4.1 php. so I dumped my database and loaded it to my machine at home and find that it does the same thing. I have 4.06 php on win me my hosting service is 4.1 php on redhat linux so I'm thinking that is not the case. I have used this code through out my site and this is the only part it does this on and I am not understanding why. Jennifer Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG... My officemate and I talked about this and the only thing he could come up with was a possible problem with your parser. Are you using a beta version or something unusual? I don't know if you have a way to know this - the programmers didn't set up PHP where I work, but I know our web server is apache and it's on a unix box. I've never run into this problem before. Have you had it happen in other programs? Have you ever used this code in another program? If it's consistently incorrect then it may be a problem with your parser. That's not really my area of expertise, but it's something you could look into if no one else has any better ideas :-) -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question It shows both. Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG... Does it show the message and the form or just the message? -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1) echo can't be found; else { echo first line of form; echo second line of form; } This is what I have: if($quantity 1) { echo Sorry I can't seem to locate this item; } else { do this } So yes I have done exactly as you have stated and it still shows the form. Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Browser cache
?php header(Cache-Control: no-cache); ? -Original Message- From: José León Serna [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 9:31 AM To: [EMAIL PROTECTED] Subject: [PHP] Browser cache Hello: How could I disable the browser cache?, I have a script that generates an image and shows it via IMG SRC=myimage. The problem is if I change the image, the browser doesn't reflect the changes until I push refresh. I supose is sending a header, but which header? Best Regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] If else question
OK...this has dragged on... Jennifer, show us your ACTUAL code, including database access statements. We can't help you if you expect us to read your mind... - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 12:17 PM Subject: Re: [PHP] If else question No this is the first if statement but there are nested if's after that. I'd post the code but everyone yells at me about my coding style. If you promise not to yell I will post it. Jennifer -Bd- [EMAIL PROTECTED] wrote in message 001d01c1eae9$d58f4360$[EMAIL PROTECTED]">news:001d01c1eae9$d58f4360$[EMAIL PROTECTED]... Is this a nested if? (inside another if statement?) - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 1:05 PM Subject: Re: [PHP] If else question I just looked at my hosting service thinkg it may have been because they just upgraded to 4.1 php. so I dumped my database and loaded it to my machine at home and find that it does the same thing. I have 4.06 php on win me my hosting service is 4.1 php on redhat linux so I'm thinking that is not the case. I have used this code through out my site and this is the only part it does this on and I am not understanding why. Jennifer Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG... My officemate and I talked about this and the only thing he could come up with was a possible problem with your parser. Are you using a beta version or something unusual? I don't know if you have a way to know this - the programmers didn't set up PHP where I work, but I know our web server is apache and it's on a unix box. I've never run into this problem before. Have you had it happen in other programs? Have you ever used this code in another program? If it's consistently incorrect then it may be a problem with your parser. That's not really my area of expertise, but it's something you could look into if no one else has any better ideas :-) -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question It shows both. Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG... Does it show the message and the form or just the message? -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1) echo can't be found; else { echo first line of form; echo second line of form; } This is what I have: if($quantity 1) { echo Sorry I can't seem to locate this item; } else { do this } So yes I have done exactly as you have stated and it still shows the form. Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] authentication
There are several ways to do that, But in your case, I believe the best would be having a page somewhere and include the protected files. Alternativelly look into the Chapter 17. of PHP Documentation: HTTP authentication with PHP http://it2.php.net/manual/en/features.http-auth.php Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins I have one directory that is protected with an .htaccess file on my server where I store all member content. What I want to do is have a page where members can log in, and after they have entered there user name and password I what the php script to authenticate them against the .htaccess file. If they are authenticated I would like to keep track of that as one of there session variables, so that they do not have to re-authenticate when they try to access content in the protected directory. Essentially what I am trying to do is give them access to the .htaccess protected based from a submit form. Instead of requiring that they get the standard user name and password pop up window that one gets when you try to access a directory that is password protected on Apache. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question and PHP DOMXML and Apache
Have the new DOM XML functions been included in the latest version of PHP (4.2) when I try to use one of the new functions, such as domxml_open_file() I get an error message saying I am calling and undefined function. Has anyone successfully used these new functions with PHP 4.2? My second question is about apache. How do I do a clean shutdown of apache? When I shut I down through the console, the next time I start it up I am told something about an unclean shutdown... Thanks.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] If else question
Look also at the examples in docs: -- header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);// Date in the past header(Last-Modified: . gmdate(D, d M Y H:i:s) . GMT); // always modified header(Cache-Control: no-store, no-cache, must-revalidate); // HTTP/1.1 header(Cache-Control: post-check=0, pre-check=0, false); header(Pragma: no-cache); // HTTP/1.0 -- php.net/header Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -Original Message- From: Richard Emery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 7:41 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Fw: [PHP] If else question OK...this has dragged on... Jennifer, show us your ACTUAL code, including database access statements. We can't help you if you expect us to read your mind... - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 12:17 PM Subject: Re: [PHP] If else question No this is the first if statement but there are nested if's after that. I'd post the code but everyone yells at me about my coding style. If you promise not to yell I will post it. Jennifer -Bd- [EMAIL PROTECTED] wrote in message 001d01c1eae9$d58f4360$[EMAIL PROTECTED]">news:001d01c1eae9$d58f4360$[EMAIL PROTECTED]... Is this a nested if? (inside another if statement?) - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 1:05 PM Subject: Re: [PHP] If else question I just looked at my hosting service thinkg it may have been because they just upgraded to 4.1 php. so I dumped my database and loaded it to my machine at home and find that it does the same thing. I have 4.06 php on win me my hosting service is 4.1 php on redhat linux so I'm thinking that is not the case. I have used this code through out my site and this is the only part it does this on and I am not understanding why. Jennifer Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG... My officemate and I talked about this and the only thing he could come up with was a possible problem with your parser. Are you using a beta version or something unusual? I don't know if you have a way to know this - the programmers didn't set up PHP where I work, but I know our web server is apache and it's on a unix box. I've never run into this problem before. Have you had it happen in other programs? Have you ever used this code in another program? If it's consistently incorrect then it may be a problem with your parser. That's not really my area of expertise, but it's something you could look into if no one else has any better ideas :-) -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question It shows both. Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG... Does it show the message and the form or just the message? -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1) echo can't be found; else { echo first line of form; echo second line of form; } This is what I have: if($quantity 1) { echo Sorry I can't seem to locate this item; } else { do this } So yes I have done exactly as you have stated and it still shows the form. Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
RE: [PHP] If else question
Post it, Jennifer, post it - we promise not to yell (ignore the yelling people - they never sleep enough, that is why...) Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 7:18 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question No this is the first if statement but there are nested if's after that. I'd post the code but everyone yells at me about my coding style. If you promise not to yell I will post it. Jennifer -Bd- [EMAIL PROTECTED] wrote in message 001d01c1eae9$d58f4360$[EMAIL PROTECTED]">news:001d01c1eae9$d58f4360$[EMAIL PROTECTED]... Is this a nested if? (inside another if statement?) - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 1:05 PM Subject: Re: [PHP] If else question I just looked at my hosting service thinkg it may have been because they just upgraded to 4.1 php. so I dumped my database and loaded it to my machine at home and find that it does the same thing. I have 4.06 php on win me my hosting service is 4.1 php on redhat linux so I'm thinking that is not the case. I have used this code through out my site and this is the only part it does this on and I am not understanding why. Jennifer Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG... My officemate and I talked about this and the only thing he could come up with was a possible problem with your parser. Are you using a beta version or something unusual? I don't know if you have a way to know this - the programmers didn't set up PHP where I work, but I know our web server is apache and it's on a unix box. I've never run into this problem before. Have you had it happen in other programs? Have you ever used this code in another program? If it's consistently incorrect then it may be a problem with your parser. That's not really my area of expertise, but it's something you could look into if no one else has any better ideas :-) -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question It shows both. Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG... Does it show the message and the form or just the message? -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1) echo can't be found; else { echo first line of form; echo second line of form; } This is what I have: if($quantity 1) { echo Sorry I can't seem to locate this item; } else { do this } So yes I have done exactly as you have stated and it still shows the form. Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
RE: [PHP] Browser Cache
Sorry, that was regarding the browser cache. Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -Original Message- From: Maxim Maletsky (PHPBeginner.com) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 7:44 PM To: 'Richard Emery'; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] If else question Look also at the examples in docs: -- header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);// Date in the past header(Last-Modified: . gmdate(D, d M Y H:i:s) . GMT); // always modified header(Cache-Control: no-store, no-cache, must-revalidate); // HTTP/1.1 header(Cache-Control: post-check=0, pre-check=0, false); header(Pragma: no-cache); // HTTP/1.0 -- php.net/header Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -Original Message- From: Richard Emery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 7:41 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Fw: [PHP] If else question OK...this has dragged on... Jennifer, show us your ACTUAL code, including database access statements. We can't help you if you expect us to read your mind... - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 12:17 PM Subject: Re: [PHP] If else question No this is the first if statement but there are nested if's after that. I'd post the code but everyone yells at me about my coding style. If you promise not to yell I will post it. Jennifer -Bd- [EMAIL PROTECTED] wrote in message 001d01c1eae9$d58f4360$[EMAIL PROTECTED]">news:001d01c1eae9$d58f4360$[EMAIL PROTECTED]... Is this a nested if? (inside another if statement?) - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 1:05 PM Subject: Re: [PHP] If else question I just looked at my hosting service thinkg it may have been because they just upgraded to 4.1 php. so I dumped my database and loaded it to my machine at home and find that it does the same thing. I have 4.06 php on win me my hosting service is 4.1 php on redhat linux so I'm thinking that is not the case. I have used this code through out my site and this is the only part it does this on and I am not understanding why. Jennifer Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG... My officemate and I talked about this and the only thing he could come up with was a possible problem with your parser. Are you using a beta version or something unusual? I don't know if you have a way to know this - the programmers didn't set up PHP where I work, but I know our web server is apache and it's on a unix box. I've never run into this problem before. Have you had it happen in other programs? Have you ever used this code in another program? If it's consistently incorrect then it may be a problem with your parser. That's not really my area of expertise, but it's something you could look into if no one else has any better ideas :-) -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question It shows both. Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG... Does it show the message and the form or just the message? -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1) echo can't be found; else { echo first line of form; echo second line of form; } This is what I have: if($quantity 1) { echo Sorry I can't seem to locate this item; } else { do this } So yes I have done exactly as you have stated and it still shows the form. Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List
RE: [PHP] If else question
Have you checked the obvious, that the condition of the if statement is actually being met? I mean are you sure that $var is returning greater then 1? -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 11:18 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question No this is the first if statement but there are nested if's after that. I'd post the code but everyone yells at me about my coding style. If you promise not to yell I will post it. Jennifer -Bd- [EMAIL PROTECTED] wrote in message 001d01c1eae9$d58f4360$[EMAIL PROTECTED]">news:001d01c1eae9$d58f4360$[EMAIL PROTECTED]... Is this a nested if? (inside another if statement?) - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 1:05 PM Subject: Re: [PHP] If else question I just looked at my hosting service thinkg it may have been because they just upgraded to 4.1 php. so I dumped my database and loaded it to my machine at home and find that it does the same thing. I have 4.06 php on win me my hosting service is 4.1 php on redhat linux so I'm thinking that is not the case. I have used this code through out my site and this is the only part it does this on and I am not understanding why. Jennifer Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG... My officemate and I talked about this and the only thing he could come up with was a possible problem with your parser. Are you using a beta version or something unusual? I don't know if you have a way to know this - the programmers didn't set up PHP where I work, but I know our web server is apache and it's on a unix box. I've never run into this problem before. Have you had it happen in other programs? Have you ever used this code in another program? If it's consistently incorrect then it may be a problem with your parser. That's not really my area of expertise, but it's something you could look into if no one else has any better ideas :-) -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question It shows both. Natalie Leotta [EMAIL PROTECTED] wrote in message 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG... Does it show the message and the form or just the message? -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1) echo can't be found; else { echo first line of form; echo second line of form; } This is what I have: if($quantity 1) { echo Sorry I can't seem to locate this item; } else { do this } So yes I have done exactly as you have stated and it still shows the form. Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If else question
Ok you asked for it. Don't say I didn't warn you. session_start(); $query = SELECT name FROM {$config[prefix]}_users WHERE uid={$session[uid]}; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $user = $row['name']; $query = SELECT uid, id, iname, image, quantity, type FROM {$config[prefix]}_my_items WHERE uid={$session[uid]} AND id = '$id' ORDER BY id; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $uiid = $row['uid']; $iid = $row['id']; $image = $row['image']; $iname = $row['iname']; $quantity = $row['quantity']; $type = $row['type']; // this is the problem if statement. Please don't yell at me for my style. It is easy for me to read so I'm sorry if it's not for you. if($quantity 1) { echo Sorry I can't seem to locate this item; } else { session_register(uiid); session_register(iid); session_register(image); session_register(iname); session_register(quantity); session_register(type); if($iid == $id) { $display_block .=CENTERimg src=$image border=0brfont size = 2$inameBR$quantityBR$typeBR/font/CENTER; echo $display_blockBRBR; if($type == food) //if the item food is present then set an option and include in the form later { $thisoption=OPTION VALUE=\feed\Feed my pet\n/OPTION; } else { //if book or weapon is present then set a blank $thisoption=; } } } } } //check if form has been submitted if($submit) { } else { //if the form has not been submitted run the following echo FORM ACTION='$PHP_SELF' METHOD='post'; echo SELECT NAME='sort' SIZE='1' ; echo $thisoption; echo OPTION VALUE='shop'Put in my shop/OPTION; echo OPTION VALUE='locker'Put into my Footlocker/OPTION; echo OPTION VALUE='discard'Discard this item/OPTION; echo OPTION VALUE='donate'Donate this item/OPTION; echo /SELECT; echo INPUT TYPE='submit' VALUE='Submit' NAME='submit'; echo /FORM; } Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ASP to PHP
Just try it on. I heard some good reviews about it. And, if the site is not too complex, try estimating the time it would take you to re-create the functionality and compare it to the time you think you would take for debugging. I once had to do this and have choosen rewriting the code ourselves. Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -Original Message- From: .ben [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 2:00 PM To: PHP Subject: RE: [PHP] ASP to PHP I am in the process of porting an ASP site to PHP and am really chuffed with how easy it is so far. I am slightly worried that doing a straight conversion may not be the best idea, but I plan to go through the site again when i'm done, and optimise for PHP where possible. .b -Original Message- From: Cal Evans [mailto:[EMAIL PROTECTED]] Sent: 23 April 2002 12:53 To: Chuck PUP Payne; [EMAIL PROTECTED] Subject: RE: [PHP] ASP to PHP Having moved a moderately sized website last year from ASP to PHP I can say from experience that if you can re-write it, the move will go smoother and you will have fewer lines of code. I ended up with about 1/2 as many lines of code to maintain after the port was done. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 6:38 AM To: [EMAIL PROTECTED] Subject: [PHP] ASP to PHP I got a strange request from a client. He wants to be able to take his ASP pages and move them over to PHP so that he can run them on apache on his linux server. I saw a tool yesterday ASP2PHP, but I am wanting to know does it work, how much is lost, is it easy to use? Is there another way to change ASP file to PHP with out a lot of re-writes? Chuck Payne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] If else question
OK, here's what I've done from your code. Check the line I mentioned. ? session_start(); $query = SELECT name FROM {$config[prefix]}_users WHERE uid={$session[uid]}; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $user = $row['name']; $query = SELECT uid, id, iname, image, quantity, type FROM {$config[prefix]}_my_items WHERE uid={$session[uid]} AND id = '$id' ORDER BY id; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $uiid = $row['uid']; $iid = $row['id']; $image = $row['image']; $iname = $row['iname']; $quantity = $row['quantity']; $type = $row['type']; // this is the problem if statement. Please don't yell at me for my style. It is easy for me to read so I'm sorry if it's not for you. if($quantity 1) { echo Sorry I can't seem to locate this item; } else { session_register(uiid); session_register(iid); session_register(image); session_register(iname); session_register(quantity); session_register(type); if($iid == $id) { $display_block .=CENTERimg src=$image border=0brfont size =2$inameBR$quantityBR$typeBR/font/CENTER; echo $display_blockBRBR; if($type == food) { //if the item food is present then set an option and include in the form later $thisoption=OPTION VALUE=\feed\Feed my pet\n/OPTION; } else { //if book or weapon is present then set a blank $thisoption=; } } } } // ! } // WHERE IS THIS COMING FROM // //check if form has been submitted if($submit) { // better be if(!$submit) } else { //if the form has not been submitted run the following echo FORM ACTION='$PHP_SELF' METHOD='post'; echo SELECT NAME='sort' SIZE='1' ; echo $thisoption; echo OPTION VALUE='shop'Put in my shop/OPTION; echo OPTION VALUE='locker'Put into my Footlocker/OPTION; echo OPTION VALUE='discard'Discard this item/OPTION; echo OPTION VALUE='donate'Donate this item/OPTION; echo /SELECT; echo INPUT TYPE='submit' VALUE='Submit' NAME='submit'; echo /FORM; } ? - Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 7:48 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question Ok you asked for it. Don't say I didn't warn you. session_start(); $query = SELECT name FROM {$config[prefix]}_users WHERE uid={$session[uid]}; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $user = $row['name']; $query = SELECT uid, id, iname, image, quantity, type FROM {$config[prefix]}_my_items WHERE uid={$session[uid]} AND id = '$id' ORDER BY id; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $uiid = $row['uid']; $iid = $row['id']; $image = $row['image']; $iname = $row['iname']; $quantity = $row['quantity']; $type = $row['type']; // this is the problem if statement. Please don't yell at me for my style. It is easy for me to read so I'm sorry if it's not for you. if($quantity 1) { echo Sorry I can't seem to locate this item; } else { session_register(uiid); session_register(iid); session_register(image); session_register(iname); session_register(quantity); session_register(type); if($iid == $id) { $display_block .=CENTERimg src=$image border=0brfont size = 2$inameBR$quantityBR$typeBR/font/CENTER; echo $display_blockBRBR; if($type == food) //if the item food is present then set an option and include in the form later { $thisoption=OPTION VALUE=\feed\Feed my pet\n/OPTION; } else { //if book or weapon is present then set a blank $thisoption=; } } } } } //check if form has been submitted if($submit) { } else { //if the form has not been submitted run the following echo FORM ACTION='$PHP_SELF' METHOD='post'; echo SELECT NAME='sort' SIZE='1' ; echo $thisoption; echo OPTION VALUE='shop'Put in my shop/OPTION; echo OPTION VALUE='locker'Put into my Footlocker/OPTION; echo OPTION VALUE='discard'Discard this item/OPTION; echo OPTION VALUE='donate'Donate this item/OPTION; echo /SELECT; echo INPUT TYPE='submit' VALUE='Submit' NAME='submit'; echo /FORM; } Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system