Re: [PHP] Evaluate PHP var in stored sql statement?
Don't quite understand why this works, but it does: /* Escape quotes in sql_query so our header_id gets evaluated */ eval("\$myrow[2] = \"$myrow[2]\";"); What's the deal with the leading backslash in ' eval("\$myrow[2] '? Does eval() tell php to evaluate the string as php code; i.e. text without quotes? Thanks for the help... --Noah - Original Message - From: "Maxim Maletsky" <[EMAIL PROTECTED]> To: "CF High" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, January 24, 2003 9:59 AM Subject: Re: [PHP] Evaluate PHP var in stored sql statement? > > use eval() > > www.php.net/eval > > > -- > Maxim Maletsky > [EMAIL PROTECTED] > > > > "CF High" <[EMAIL PROTECTED]> wrote... : > > > Hey all. > > > > I need to find out how to get PHP to evaluate a PHP variable stored in our > > MySql database. > > > > Currently the variable is being read as a string; i.e. select * from table > > where column = $myrow[0] -- instead of evaluating $myrow[0] as a variable. > > > > > > The SQL statement is retrieved in the first call to dbConnect (see code > > below) > > > > > > > > dbConnect("SELECT header_id, header, sql_query FROM cat_headers WHERE > > section_id = $_REQUEST[section_id] order by header"); > > > > $set = $result; /* Give initial result set a unique name */ > > > > while ($myrow = mysql_fetch_row($set)) { > > > > echo(Display the header title here); > > > > > > dbConnect($myrow[2]); /* $myrow[2] is the sql_query gotten > > from the first dbConnect() call */ > > > > $set1 = $result;/* Give next result set a unique name */ > > > > while ($myrow = mysql_fetch_row($set1)) { > > > > echo(Display category rows here); > > > > } > > > > } > > > > -- > > Any leads/suggestions much appreciated.. > > > > --Noah > > > > > > > > -- > > 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] Evaluate PHP var in stored sql statement?
Thanks for your help Maxim. I've got quite a bit to learn. PHP is far more challenging than Cold Fusion. --Noah - Original Message - From: "Maxim Maletsky" <[EMAIL PROTECTED]> To: "Noah" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, January 24, 2003 11:02 AM Subject: Re: [PHP] Evaluate PHP var in stored sql statement? > > eval takes the string and executes PHP in that string. So, > > eval("\$myrow[2] = \"$myrow[2]\";"); > > is equivalent to: > > $myrow[2] = "$myrow[2]"; > > I'd reccomend you using single quotes and then escape only backslashes > and single quotes within a string > > -- > Maxim Maletsky > [EMAIL PROTECTED] > > > > "Noah" <[EMAIL PROTECTED]> wrote... : > > > Don't quite understand why this works, but it does: > > > > /* Escape quotes in sql_query so our header_id gets evaluated */ > > eval("\$myrow[2] = \"$myrow[2]\";"); > > > > What's the deal with the leading backslash in ' eval("\$myrow[2] '? > > > > Does eval() tell php to evaluate the string as php code; i.e. text without > > quotes? > > > > Thanks for the help... > > > > --Noah > > > > > > - Original Message - > > From: "Maxim Maletsky" <[EMAIL PROTECTED]> > > To: "CF High" <[EMAIL PROTECTED]> > > Cc: <[EMAIL PROTECTED]> > > Sent: Friday, January 24, 2003 9:59 AM > > Subject: Re: [PHP] Evaluate PHP var in stored sql statement? > > > > > > > > > > use eval() > > > > > > www.php.net/eval > > > > > > > > > -- > > > Maxim Maletsky > > > [EMAIL PROTECTED] > > > > > > > > > > > > "CF High" <[EMAIL PROTECTED]> wrote... : > > > > > > > Hey all. > > > > > > > > I need to find out how to get PHP to evaluate a PHP variable stored in > > our > > > > MySql database. > > > > > > > > Currently the variable is being read as a string; i.e. select * from > > table > > > > where column = $myrow[0] -- instead of evaluating $myrow[0] as a > > variable. > > > > > > > > > > > > The SQL statement is retrieved in the first call to dbConnect (see code > > > > below) > > > > > > > > > > > > > > > > dbConnect("SELECT header_id, header, sql_query FROM cat_headers WHERE > > > > section_id = $_REQUEST[section_id] order by header"); > > > > > > > > $set = $result; /* Give initial result set a unique name */ > > > > > > > > while ($myrow = mysql_fetch_row($set)) { > > > > > > > > echo(Display the header title here); > > > > > > > > > > > > dbConnect($myrow[2]); /* $myrow[2] is the sql_query > > gotten > > > > from the first dbConnect() call */ > > > > > > > > $set1 = $result;/* Give next result set a unique name > > */ > > > > > > > > while ($myrow = mysql_fetch_row($set1)) { > > > > > > > > echo(Display category rows here); > > > > > > > > } > > > > > > > > } > > > > > > > > -- > > > > Any leads/suggestions much appreciated.. > > > > > > > > --Noah > > > > > > > > > > > > > > > > -- > > > > 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] Switch statement || How to output html without using echo() or print()
That does the trick, although I'm not exactly sure why. Shouldn't the html between the and statements be executed regardless of whether or not case 1 matches the switch variable? In Cold Fusion anything outside of cf code here is ignored by the CF language processor; thus the html here would display the html for each case. In any case thanks for workaround -- I would have echoed out all the html otherwise.. --Noah - Original Message - From: "Johannes Schlueter" <[EMAIL PROTECTED]> To: "CF High" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, January 25, 2003 8:38 AM Subject: Re: [PHP] Switch statement || How to output html without using echo() or print() > On Saturday 25 January 2003 20:38, CF High wrote: > > > Each operation has @ 50 lines of html -- do I have to echo or print all > > this html!? > > Try something like >switch ($foo) { > case 1: > ?> > Hello >break; > } > ?> > > johannes > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Switch statement || How to output html without using echo() or print()
Hey John. While your suggestion certainly will work, I'd prefer not to have an excessive number of include files to keep track of. Johannes' suggestion does the trick: "Try something like Hello " - Original Message - From: "John W. Holmes" <[EMAIL PROTECTED]> To: "'CF High'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, January 25, 2003 8:42 AM Subject: RE: [PHP] Switch statement || How to output html without using echo() or print() > > I've got a simple switch statement that carries out one of several > > operations based on the switch statement variable value. > > > > Each operation has @ 50 lines of html -- do I have to echo or print > all > > this > > html!? > > You could put your HTML into a separate file and just include() it > wherever you want it displayed... > > ---John W. Holmes... > > PHP Architect - A monthly magazine for PHP Professionals. Get your copy > today. http://www.phparch.com/ > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Evaluate PHP var in stored sql statement?
Hm.. Guess I'll find out as I go deeper into PHP.... --Noah - Original Message - From: "Maxim Maletsky" <[EMAIL PROTECTED]> To: "Noah" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, January 25, 2003 9:47 AM Subject: Re: [PHP] Evaluate PHP var in stored sql statement? > no, much less instead > > --- > Maxim Maletsky > [EMAIL PROTECTED] > > > On Sat, 25 Jan 2003 09:18:47 -0800 "Noah" <[EMAIL PROTECTED]> wrote: > > > Thanks for your help Maxim. > > > > I've got quite a bit to learn. PHP is far more challenging than Cold > > Fusion. > > > > --Noah > > > > - Original Message - > > From: "Maxim Maletsky" <[EMAIL PROTECTED]> > > To: "Noah" <[EMAIL PROTECTED]> > > Cc: <[EMAIL PROTECTED]> > > Sent: Friday, January 24, 2003 11:02 AM > > Subject: Re: [PHP] Evaluate PHP var in stored sql statement? > > > > > > > > > > eval takes the string and executes PHP in that string. So, > > > > > > eval("\$myrow[2] = \"$myrow[2]\";"); > > > > > > is equivalent to: > > > > > > $myrow[2] = "$myrow[2]"; > > > > > > I'd reccomend you using single quotes and then escape only backslashes > > > and single quotes within a string > > > > > > -- > > > Maxim Maletsky > > > [EMAIL PROTECTED] > > > > > > > > > > > > "Noah" <[EMAIL PROTECTED]> wrote... : > > > > > > > Don't quite understand why this works, but it does: > > > > > > > > /* Escape quotes in sql_query so our header_id gets evaluated */ > > > > eval("\$myrow[2] = \"$myrow[2]\";"); > > > > > > > > What's the deal with the leading backslash in ' eval("\$myrow[2] '? > > > > > > > > Does eval() tell php to evaluate the string as php code; i.e. text > > without > > > > quotes? > > > > > > > > Thanks for the help... > > > > > > > > --Noah > > > > > > > > > > > > - Original Message - > > > > From: "Maxim Maletsky" <[EMAIL PROTECTED]> > > > > To: "CF High" <[EMAIL PROTECTED]> > > > > Cc: <[EMAIL PROTECTED]> > > > > Sent: Friday, January 24, 2003 9:59 AM > > > > Subject: Re: [PHP] Evaluate PHP var in stored sql statement? > > > > > > > > > > > > > > > > > > use eval() > > > > > > > > > > www.php.net/eval > > > > > > > > > > > > > > > -- > > > > > Maxim Maletsky > > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > "CF High" <[EMAIL PROTECTED]> wrote... : > > > > > > > > > > > Hey all. > > > > > > > > > > > > I need to find out how to get PHP to evaluate a PHP variable stored > > in > > > > our > > > > > > MySql database. > > > > > > > > > > > > Currently the variable is being read as a string; i.e. select * from > > > > table > > > > > > where column = $myrow[0] -- instead of evaluating $myrow[0] as a > > > > variable. > > > > > > > > > > > > > > > > > > The SQL statement is retrieved in the first call to dbConnect (see > > code > > > > > > below) > > > > > > > > > > > > > > > > > > > > > > > > dbConnect("SELECT header_id, header, sql_query FROM cat_headers > > WHERE > > > > > > section_id = $_REQUEST[section_id] order by header"); > > > > > > > > > > > > $set = $result; /* Give initial result set a unique name */ > > > > > > > > > > > > while ($myrow = mysql_fetch_row($set)) { > > > > > > > > > > > > echo(Display the header title here); > > > > > > > > > > > > > > > > > > dbConnect($myrow[2]); /* $myrow[2] is the sql_query > > > > gotten > > > > > > from the first dbConnect() call */ > > > > > > > > > > > > $set1 = $result;/* Give next result set a unique > > name > > > > */ > > > > > > > > > > > > while ($myrow = mysql_fetch_row($set1)) { > > > > > > > > > > > > echo(Display category rows here); > > > > > > > > > > > > } > > > > > > > > > > > > } > > > > > > > > > > > > -- > > > > > > Any leads/suggestions much appreciated.. > > > > > > > > > > > > --Noah > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > 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] Form Variables not getting passed || Apache, MySql, Win 2k Setup
Yup. Restarted Apache. PHP's still not evaluating the passed form vars whether register globals is set to On or Off.... --Noah - Original Message - From: "Ernest E Vogelsinger" <[EMAIL PROTECTED]> To: "CF High" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, January 29, 2003 2:23 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup > At 01:36 30.01.2003, CF High said: > [snip] > >However, setting register_globals on or off makes no difference. The > >variables are still not getting evaluated > [snip] > > I _BET_ it's register_globals. > Did you restart the webserver in case PHP is loaded as a module? > > Anyway: it's a lot safer having register_globals set to "off" (see > http://www.php.net/manual/en/security.registerglobals.php#security.registerg > lobals for a discussion on security issues). > > For example, assuming that a certain cookie value is available, with > register_globals on this value may be forged by passing the value as part > of the url. A lot of different possibilities arise. > > > -- >>O Ernest E. Vogelsinger >(\)ICQ #13394035 > ^ http://www.vogelsinger.at/ > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
I don't want to use $_REQUEST['my_passed_variable'] at all. Right now when I do an sql insert on my local machine I have to use the following syntax: INSERT into tablename (field name list) VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) I just want to use $var1, $var2, $var3 --Noah - Original Message - From: "Philip Olson" <[EMAIL PROTECTED]> To: "CF High" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, January 29, 2003 2:23 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup > > One too many $'s in your code, use: > > $_REQUEST['my_passed_variable'] > > This is how all arrays work, autoglobals are the same. > See also: > > http://www.php.net/variables.external > http://www.php.net/variables.predefined > > Regards, > Philip > > On Wed, 29 Jan 2003, CF High wrote: > > > Hey all. > > > > This driving me nuts: > > > > I've got Apache, MySql, and Windows 2000 running on my local machine. > > In order to get passed php variables evaluated, whether via a url query > > string, or through a form post, I have to use this syntax: > > > > $_REQUEST[$my_passed_variable] > > > > I have no such problem with our hosting company servers; i.e. I can access > > query_string and form posted variables as $my_passed_variable. > > > > What is going on here? Is there something in php.ini that needs to be > > adjusted? > > > > Any help whatsoever here is much appreciated, > > > > --Noah > > > > -- > > > > > > > > > > -- > > 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] Form Variables not getting passed || Apache, MySql, Win 2k Setup
Sure. In the code below, class_type is passed in the query_string (e.g. index.php?section_id=12&page_type=class_submit&class_type=apartments) Also, below sql values are sent via a post. Code Snippet *** switch($_REQUEST['class_type']) { case 'apartments'; dbConnect("INSERT into c_apart_data (submit_date, apart_type_id, location, bedrooms, rent, heat, lease, deposit, pets, phone, email, blurb) Values('$submit_date', '$apart_type_id', '$location', '$bedrooms', '$rent', '$heat', '$lease', '$deposit', '$pets', '$phone', '$email', '$blurb')"); break; more code.... ** Let me know if you need more info, --Noah - Original Message - From: Leif K-Brooks To: Noah Cc: [EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 2:19 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup Mind giving a code snippet? Noah wrote: Thanks for the pleasant acronym, Leif. However, setting register_globals on or off makes no difference. The variables are still not getting evaluated BTW works fine on my laptop (Apache, MySql, Linux) --Noah - Original Message - From: "Leif K-Brooks" mailto:<[EMAIL PROTECTED] To: "CF High" mailto:<[EMAIL PROTECTED]; mailto:<[EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 1:38 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup RTFM! Your problem is register_globals. CF High wrote: Hey all. This driving me nuts: I've got Apache, MySql, and Windows 2000 running on my local machine. In order to get passed php variables evaluated, whether via a url query string, or through a form post, I have to use this syntax: $_REQUEST[$my_passed_variable] I have no such problem with our hosting company servers; i.e. I can access query_string and form posted variables as $my_passed_variable. What is going on here? Is there something in php.ini that needs to be adjusted? Any help whatsoever here is much appreciated, --Noah -- -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
Checked out the php.ini file. register_globals is set to On -- there is no semicolon or other character that would cause a problem. This might be a problem with the Apache, Win2k combination -- I don't know.. --Noah - Original Message - From: "Ernest E Vogelsinger" <[EMAIL PROTECTED]> To: "Noah" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, January 29, 2003 2:55 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup > At 02:48 30.01.2003, Noah said: > [snip] > >Yup. Restarted Apache. > > > >PHP's still not evaluating the passed form vars whether register globals is > >set to On or Off > [snip] > > Just thinking the unthinkable... > > Most of the time, default settings are commented out in php.ini, like this: > ; register_globals = Off > > I fell into this trap sometimes by overseeing the semicolon and simply > changing the value with no effect whatsoever. Would you mind to take a look? > > If this isn't the case here I don't have a clue as to what's going on... > > Did you mention the version? Possibly there's a special build here that > never allows to register globals? (config gurus chime in here please) > > > -- >>O Ernest E. Vogelsinger >(\)ICQ #13394035 > ^ http://www.vogelsinger.at/ > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
H. Sounds like "resorting" to extract($REQUEST) might have a downside? Otherwise, I'll use it for now. Thanks, --Noah - Original Message - From: "Ernest E Vogelsinger" <[EMAIL PROTECTED]> To: "Noah" <[EMAIL PROTECTED]> Cc: "Philip Olson" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, January 29, 2003 2:58 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup > At 02:55 30.01.2003, Noah said: > [snip] > >I don't want to use $_REQUEST['my_passed_variable'] at all. > > > >Right now when I do an sql insert on my local machine I have to use the > >following syntax: > > > >INSERT into tablename (field name list) > >VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) > > > >I just want to use $var1, $var2, $var3 > [snip] > > You can always resort to > extract($_REQUEST); > > > -- >>O Ernest E. Vogelsinger >(\)ICQ #13394035 > ^ http://www.vogelsinger.at/ > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need to set default parameter || How to do in PHP?
Nice Phil. A little more typing than the CF version, but the more I delve into PHP, the more I realize its power and flexibility. Thanks for the speedy reply... --Noah - Original Message - From: "Philip Olson" <[EMAIL PROTECTED]> To: "CF High" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, February 01, 2003 1:05 PM Subject: Re: [PHP] Need to set default parameter || How to do in PHP? > On Sat, 1 Feb 2003, CF High wrote: > > > Hey all. > > > > In cold fusion I was able to define a default value with the > "test" default = "myValue"> tag > > > > When I passed the variable "test" via a form or query string, it would over > > ride the parameter value. > > > > How can I do this in PHP? I looked in PHP manual for param, default, etc., > > but could find no equivalent. > > > > Any ideas? > > if (!isset($_REQUEST['rvar']) || inappropriate($_REQUEST['rvar'])) { > $rvar = 'default'; > } else { > $rvar = $_REQUEST['rvar']; > } > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Single vs. Multiple DBs || Which way to go?
Hey John. Thanks for the candid reply -- basket weaving ;--) Re: scoring, yes, you're right, queries are sport dependent; i.e. if you're in the basketball section, basketball queries are run... At this point in my development experience, creating an all sport scoring table is stretching it a bit. Based on a hockey report I created a few months ago, I understand how to create functional, albeit crude, single sport interfaces. Given the limited time frame I'm working with, using the single sport model is preferred -- because I've yet to learn the alternatives! In any case, the multi-db model is out of the picture for now. I'll just have to alias the table names and do the best I can to organize the table structure in a sensible manner. If you have any brainstorms about how to work with a multi-sport interface in a single db, let me know. I'm not looking forward to sifting through a 100 tables.. Thanks, --Noah - Original Message - From: "John W. Holmes" <[EMAIL PROTECTED]> To: "'CF High'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, February 08, 2003 7:32 AM Subject: RE: [PHP] Single vs. Multiple DBs || Which way to go? > > I'm attempting to organize a sport report site into working order. > > > > We've got approximately 100 tables, and I'm unsure whether to break > the > > info > > up by sport (i.e. baseball, basketball, hockey, etc.) or to lump all > the > > tables in one db and prefix tables by their sport name (e.g. > bk_scoring = > > basketball scoring table). > > How about just a "scoring" table that has a column on whether it's > Basketball, Hockey, Basket-Weaving, etc? How similar are the scoring > tables between sports? If the tables for each sport are the same, then > keep them in one database and just have identifiers in the table that > say what sport it's for. Do you normally run queries that combine > sports? Or is it something like if a user is in the "basketball" area, > then all of the queries will pull basketball related data? > > > On the surface, it would seem easier to use multiple dbs, but then > again, > > common tables, such as schools and coach_info would have to be > duplicated > > in > > each db. > > That's not a good idea... > > ---John W. Holmes... > > PHP Architect - A monthly magazine for PHP Professionals. Get your copy > today. http://www.phparch.com/ > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Alternating Row Colors in PHP........
Thanks olinux. Just what I was looking for -- I'll check it out..... -Noah - Original Message - From: "olinux" <[EMAIL PROTECTED]> To: "CF High" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, February 08, 2003 12:45 PM Subject: Re: [PHP] Alternating Row Colors in PHP > Pop this in your loop > > $bgcolor = ($i++ % 2) ? '#FF' : '#EE'; > > echo ""; > > olinux > > > --- CF High <[EMAIL PROTECTED]> wrote: > > Hey all. > > > > I'm coming from Cold Fusion to PHP; in CF I could > > alternate rows with the > > following: > > > > > > > > Any ideas how to do this in PHP? > > > > Thanks for clues, > > > > --Noah > > > > -- > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > __ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Output yyyymmdd formatted date || 20030131 to FridayJanuary 31, 2003
Hey Michael. The dates are stored in a MySql db. I checked out the MySql DATE_FORMAT function -- pretty cool. However, pardon my ignorance here, how can I do date comparisons? For example, if I want to retrieve records from the db where the date is between say, 2003-02-01 and 2003-02-07, will MySql be able to compare the strings? I stored my dates as integer fields to do such a comparison, but it looks like I need to graduate to MySql date time functions.. --Noah - Original Message - From: "Michael Geier" <[EMAIL PROTECTED]> To: "CF High" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, February 08, 2003 1:31 PM Subject: Re: [PHP] Output mmdd formatted date || 20030131 to FridayJanuary 31, 2003 > the real question here is are you "storing" your dates in a file or database. > > If in a database (say MySQL), you can use the native DATE_FORMAT function of > MySQL to pull the date out in the proper format. > > Otherwise, have a look at http://www.php.net/date > > Quoting CF High <[EMAIL PROTECTED]>: > > > Sorry for the frequent simple posts... > > > > I've been storing my dates in mmdd format (apparently this is a bad > > idea). > > > > In any case, I need to display this date format as [day name month name day > > #, year] e.g. Friday January 31, 2003. > > > > Any ideas? > > > > Thanks for any leads, > > > > --Noah > > > > -- > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > === > Michael Geier > CDM Sports, Inc. Systems Administration >email: [EMAIL PROTECTED] >phone: 314.692.3540 > > --- > This email sent using CDM Sports Webmail v3.1 > [ http://webmail.cdmsports.com ] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Output yyyymmdd formatted date || 20030131 to FridayJanuary 31, 2003
Right. I've switched the date column from type INT to type DATE in our MySql db. The problem I've had with retrieving records in a certain date range with: SELECT * FROM table WHERE yourdate BETWEEN 20030201 AND 20030207 is getting the latter part of the expression; i.e. in this case 20030207 to be seven days "older" than the first part. This is where I need to use MySql's DATE_ADD, and other date manipulation functions.. Lots to learn; little time to do it. Thanks for feedback, John. --Noah - Original Message - From: "John W. Holmes" <[EMAIL PROTECTED]> To: "'Noah'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, February 08, 2003 3:31 PM Subject: RE: [PHP] Output mmdd formatted date || 20030131 to FridayJanuary 31, 2003 > > The dates are stored in a MySql db. > > > > I checked out the MySql DATE_FORMAT function -- pretty cool. > > > > However, pardon my ignorance here, how can I do date comparisons? > > > > For example, if I want to retrieve records from the db where the date > is > > between say, 2003-02-01 and 2003-02-07, will MySql be able to compare > the > > strings? > > > > I stored my dates as integer fields to do such a comparison, but it > looks > > like I need to graduate to MySql date time functions.. > > If you've done it correctly and stored your dates in a MySQL DATE, > DATETIME, or TIMESTAMP column, then you can do something like this: > > SELECT * FROM table WHERE yourdate BETWEEN 20030201 AND 20030207 > > If you're storing them in an INT column, then change it over to one of > the above. > > Go back to the manual and read about date_sub() and date_add() in MySQL > for further date manipulation... > > ---John W. Holmes... > > PHP Architect - A monthly magazine for PHP Professionals. Get your copy > today. http://www.phparch.com/ > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why does this happen?
Hey Ernest. This looks like the solution I'll need to make my CF interface work in PHP. I'll check it out. Thanks! --Noah - Original Message - From: "Ernest E Vogelsinger" <[EMAIL PROTECTED]> To: "CF High" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, February 09, 2003 6:39 AM Subject: Re: [PHP] Why does this happen? > At 04:52 09.02.2003, CF High said: > [snip] > >In this test form when I submit and insert into my db, only the last select > >field get entered; i.e. in this case the day value of 25. > > > > > > > >Year > > > >2002 > > > > > >Month > > > >12 > > > > > >Day > > > >25 > > > > > > > > > > > > > >Why does this happen? In Cold Fusion I'm able to refer to the three selects > >as #date# and it returns 20021225 as expected. > [snip] > > I don't know much about CF, but in plain HTML as you show here you have 3 > different form input (select) fields sharing the same name. Thus the > browser will transmit only one of the three input (select) fields upon > submit (it is undefined which field will be sent, but most browsers will > transmit the last value). > > Maybe CF fiddles around with the element names, PHP doesn't. You could e.g. > format the 3 elements to transmit an array, something like this: > > > Year > > 2002 > > Month > > 12 > > Day > > 25 > > > > > In your receiving script you would have an associative array named "date" > in the $_REQUEST structure: > > $date_received = $_REQUEST['date']; > $year = $date_received['Y']; > $month = $date_received['M']; > $day = $date_received['D']; > > HTH, > > > -- >>O Ernest E. Vogelsinger >(\)ICQ #13394035 > ^ http://www.vogelsinger.at/ > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why does this happen?
H... So in the receiving page I'll need to string together date_year[i], date_month[i] and date_day[i] in order to get the full date for each scheduled game. Which is what CF apparently "glues together" for the developer on the fly. I'll try out both this method and the array method suggested by OP (I need practice working with arrays in PHP anyway). Thanks for the informative reply, --Noah - Original Message - From: "Ford, Mike [LSS]" <[EMAIL PROTECTED]> To: "'CF High'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, February 10, 2003 5:28 AM Subject: RE: [PHP] Why does this happen? > > -Original Message- > > From: CF High [mailto:[EMAIL PROTECTED]] > > Sent: 09 February 2003 20:52 > > > > Here's the deal: > > > > Let's say I have a form that requests the season schedule of > > a baseball > > team, and the team in question has twenty scheduled games all > > on different > > days. > > > > Each form row will have three select elements for the date; > > i.e. date(x) for > > the year, date(x+1) for the month, and date(x+2) for the day, > > or however > > I'll need to make each date select element unique. > > > > Then, in the insert page, I'll need to loop through each date > > element by > > groups of three and create an array for each date set. > > If I'm reading this right, you need to do something like this on your form > page: > > > for ($i=1; $i<=20; $i++): > ?> > > ... > > > ... > > ... > endfor; > ?> > > > and then your receiving page will have arrays called $_POST['date_year'], > $_POST['date_month'], etc (or the equivalent globals if you've chosen the > insecure register_globals On route). > > 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
Re: [PHP] Sitewide Header & Footer Includes || Trouble with Relative Paths..........
Hey John. Do you ever sleep? You've got a zillion posts in this news group.. To answer your question, it's not that I'm afraid of absolute paths, it's that I don't properly understand how to implement them. I understand why the path references are not working when I move beyond the root level directory, but getting the file reference to work beyond the root is the tricky part for me. For example, with $_CONF['path'] = '/home/me/www/program'; set in my global_vars.inc how will I reference my image files? As $path.image_file_name? Could you provide an image file reference code snippet? Let me know. Thanks, --Noah - Original Message - From: "John W. Holmes" <[EMAIL PROTECTED]> To: "'CF High'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, February 22, 2003 10:31 AM Subject: RE: [PHP] Sitewide Header & Footer Includes || Trouble with Relative Paths.. > > How can I create a global header and footer include to my site pages > where > > I > > don't rely on absolute paths to include and image files? > > > > I'm having trouble including my header and footer .inc's within a > > multi-level directory structure -- the relative paths to images (and > to > > includes within includes) are not currently accessed within the > current > > directory structure. > > > > I'm assuming I'll need to prepend all image and include files with a > path > > variable that I set within each page, or something along those lines? > > When you call file.php, all includes and any nested includes are > relative to the directory that file.php is in. That means if you include > a file called subdir/file2.php and it attempts to include something, > it's going to start looking for it in the same directory as file.php. No > way around that. > > What's your fear of absolute paths? I always set two variables, the > absolute path of my files and the web address. > > $_CONF['path'] = '/home/me/www/program'; > $_CONF['html'] = 'http://www.domain.com/program'; > > for example. Then do all of your paths based off of those. > > If you don't want to do that, then you can probably play around with > $_SERVER['PHP_SELF'] and basename() and the like to do what you want. > > ---John W. Holmes... > > PHP Architect - A monthly magazine for PHP Professionals. Get your copy > today. http://www.phparch.com/ > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sitewide Header & Footer Includes || Trouble with Relative Paths..........
Don't have access to php.ini -- we're in a shared hosting environment... I can make it work with $my_include_path = $DOCUMENT_ROOT . "includes/file.inc"; Then I just prepend include files with $my_include_path. A little more work, but better than chucking all my files in the root directory as I've been doing.. The .htaccess idea is another option, but it looks like apache.org doesn't view setting the include path in .htaccess as particularly efficient (something about apache crawling from top to bottom through the directory tree to find the default include directory) -- I don't know, the $DOCUMENT_ROOT method does the trick for now Feel free to chime in anyone who has a better solution, --Noah - Original Message - From: "Robert Cummings" <[EMAIL PROTECTED]> To: "CF High" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, February 22, 2003 1:22 PM Subject: Re: [PHP] Sitewide Header & Footer Includes || Trouble with Relative Paths.. > I don't know if it helps... but you should take a look at the ini_set() > function. Perhaps you can set the appropriate stuff using that. > > Cheers, > Rob. > > > CF High wrote: > > > > Hey Tom. > > > > Thanks for the idea; however, since we're not hosting the site on our own > > server, we don't have permissions for altering the php.ini file.. > > > > -- > .-. > | Worlds of Carnage - http://www.wocmud.org | > :-: > | Come visit a world of myth and legend where | > | fantastical creatures come to life and the | > | stuff of nightmares grasp for your soul.| > `-' > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sitewide Header & Footer Includes || Trouble with Relative Paths..........
Thanks again John for the informative reply. Now I follow what you're doing. Get some sleep ;--) --Noah - Original Message - From: "John W. Holmes" <[EMAIL PROTECTED]> To: "'Noah'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, February 22, 2003 1:56 PM Subject: RE: [PHP] Sitewide Header & Footer Includes || Trouble with Relative Paths.. > > Hey John. > > > > Do you ever sleep? You've got a zillion posts in this news > > group.. > > Sleep is for the weak... > > > To answer your question, it's not that I'm afraid of absolute paths, > it's > > that I don't properly understand how to implement them. > > > > I understand why the path references are not working when I move > beyond > > the > > root level directory, but getting the file reference to work beyond > the > > root > > is the tricky part for me. > > > > For example, with $_CONF['path'] = '/home/me/www/program'; set in my > > global_vars.inc how will I reference my image files? As > > $path.image_file_name? > > > > Could you provide an image file reference code snippet? > > For images, you'll need a "web path", that's where $_CONF['html'] comes > in. > > Okay, say my program is installed in /home/user/john/www/subdir/ and I > call it from the web with http://www.mydomain.com/subdir. I define two > variables: > > $_CONF['path'] = '/home/user/john/www/subdir'; file://filesystem path > $_CONF['html'] = 'http://www.mydomain.com/subdir'; file://web path > > Now, to include a file, you'd use: > > include($_CONF['path'].'/include.php'); > > to include from another subdirectory: > > include($_CONF['path'].'/directory/functions.php'); > > Now, say I'm within functions.php and want to include a file that's > somewhere else. You're providing an absolute path, so it's not a big > deal. > > Include($_CONF['path'].'/anotherdir/classes.php'); > > Now, to include an image tag in your HTML, you'd use: > > > > Or, if all of your images are always in the same directory, you can > define a > > $_CONF['images'] = 'http://www.mydomain.com/images'; > > and use > > > > Hope that helps. The other suggestions are good, too, but I wouldn't use > those method. That's just me, though. > > ---John Holmes... > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Output Numerical Month as String?
Cool. I'll check it out. Thanks! --Noah - Original Message - From: "Dennis Cole" <[EMAIL PROTECTED]> To: "CF High" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, February 14, 2001 12:21 PM Subject: RE: [PHP] Output Numerical Month as String? > [code] > > date ("F", mktime(0,0,0,6,1,2000)); > > [\code] > > Replace 6 with the month number and your on your way > -Original Message- > From: CF High [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 25, 2003 5:54 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Output Numerical Month as String? > > > Hey all. > > Easy question here (can't find the answer in php manual) > > In Cold Fusion I'm able to format a given numerical month value, say the > third month, as #MonthAsString(3)# and it returns "March" > > What's the equivalent in PHP? > > Thanks for any ideas.. > > --Noah > > -- > > > > > -- > 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] Populate var with function output string?
You da man, Leif. That did the trick. Didn't try the output buffering idea. I need to look into that area. Thanks for illuminating things a bit.... --Noah - Original Message - From: "Leif K-Brooks" <[EMAIL PROTECTED]> To: "CF High" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, March 03, 2003 5:01 PM Subject: Re: [PHP] Populate var with function output string? > Try adding each output string to a variable, then returning it, like: > > function return_string(count) { > $return = ''; > for ($x = 0; $x < $count; $x++) { > > $return.= " Row $x"; > > } > return $return; > > } > > If you can't do that for some reason, try using output buffering. > www.php.net/ob-start > > CF High wrote: > > >Hey all. > > > >Is it possible to populate a var with an output string generated by a > >function? So: > > > >*** > >function write_string(count) { > > > >for ($x = 0; $x < $count; $x++) { > > > > echo " Row $x"; > > > >} > > > >} > > > >$my_string = write_string(5); > > > >echo $my_string; > >*** > > > >I need $count option elements stored in $my_string. How to make this happen. > > > >Thanks for any ideas, > > > >--Noah > > > > > >-- > > > > > > > > > > > > > > -- > The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Yarrrrgggghhhhh || Simplest php question in existence........
You're on a roll. Any performance issues re: using fetch_row vs. fetch_array? Thanks again, --Noah - Original Message - From: "Leif K-Brooks" <[EMAIL PROTECTED]> To: "CF High" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, March 03, 2003 7:04 PM Subject: Re: [PHP] Yah || Simplest php question in existence > Use mysql_fetch_array instead of mysql_fetch_row. > > CF High wrote: > > >Hey all. > > > >Basic question here: > > > >How can I refer to a query result set as $result['field_name'] rather than > >$result[0]? > > > >So, I'm looking for -- just can't seem to > >get the right syntax. > > > >-- clueless > > > > > > > >-- > > > > > > > > > > > > > > -- > The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] md5 encrypt problem
Exactly right, John. Sorry to clutter the forum -- it was a varchar(30)! Thanks, --Noah - Original Message - From: "John W. Holmes" <[EMAIL PROTECTED]> To: "'CF High'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, March 11, 2003 4:06 AM Subject: RE: [PHP] md5 encrypt problem > > Having a wee bit o' trouble with a simple md5 script: > > > > for ($x=1 ; $x <62 ; $x++) { > > > > $mypass = "sports" . $x; > > $mypass = md5($mypass); > > > > dbConnect("UPDATE user_login SET password = '$mypass' WHERE > > school_id > > = $x"); > > > > } > > > > For some reason, when I attempt to login with my md5'd user supplied > > password I get no match. Bizarre, haven't had this problem > > before... > > Is the 'password' column in your database a CHAR or VARCHAR column with > a length of 32? If it is, then show the code where you validate someone > logging in. > > ---John W. Holmes... > > PHP Architect - A monthly magazine for PHP Professionals. Get your copy > today. http://www.phparch.com/ > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Performance and Function Calls
Thanks Jason. I was hoping that was what was happening. Happy php'ing --Noah - Original Message - From: "Jason Sheets" <[EMAIL PROTECTED]> To: "Don Read" <[EMAIL PROTECTED]> Cc: "CF High" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, March 15, 2003 8:46 PM Subject: RE: [PHP] Performance and Function Calls > Storing the results of a function in a variable and referencing the > variable will almost always be faster, this should be no surprise > because instead of executing the function PHP just has to return the > variable's value. > > In #1 since you only call the function once the function is only > executed once, in a loop it is executed once for each loop iteration. > > Jason > > On Sat, 2003-03-15 at 21:25, Don Read wrote: > > On 15-Mar-2003 CF High wrote: > > > Hey all. > > > > > > Quick question: > > > > > > If I have a function that, say, prints out the months in a year, and I > > > call > > > that function within a 10 cycle loop, which of the following is faster: > > > > > > 1) Have function months() return months as a string; set var > > > string_months = months() outside of the loop; then echo string_months > > > within > > > the loop > > > > > > -- OR > > > > > > 2) Just call months() for each iteration through the loop > > > > > > I'm not sure how PHP interprets option number 1. > > > > > > Guidance for the clueless much appreciated... > > > > > > > Easy enuff to test: > > > > > > > function getmicrotime(){ > > list($usec, $sec) = explode(" ",microtime()); > > return ((float)$usec + (float)$sec); > > } > > > > $time_start = getmicrotime(); > > for ($m=1; $m <11; $m++) { > > echo date('F', strtotime("2003-$m-1")), ''; > > } > > echo 'A: ', getmicrotime() - $time_start , ''; > > > > $time_start = getmicrotime(); > > for ($m=1; $m <11; $m++) { > > $str[]=date('F', strtotime("2003-$m-1")); > > } > > echo implode('',$str); > > echo 'B: ', getmicrotime() - $time_start , ''; > > > > unset($str); > > $time_start = getmicrotime(); > > for ($m=1; $m <11; $m++) { > > $str[]=date('F', strtotime("2003-$m-1")); > > } > > > > while (list(,$v)= each($str)) { > > echo $v, ''; > > } > > echo 'C: ', getmicrotime() - $time_start , ''; > > > > ?> > > > > On my machine I get numbers like: > > A: 0.000907063484192 > > B: 0.000651001930237 > > C: 0.000686049461365 > > > > The function call within the loop is slower (contrary to what I > > expected), the real question is how much effort do you want to expend to > > save 2-3 micro-seconds? > > > > Regards, > > -- > > Don Read [EMAIL PROTECTED] > > -- It's always darkest before the dawn. So if you are going to > >steal the neighbor's newspaper, that's the time to do it. > -- > Jason Sheets <[EMAIL PROTECTED]> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Performance and Function Calls
Thanks for the informative response, Don. While a few microseconds saved isn't much, the example I gave was not the "real_world" situation we're actually dealing with. We're looping through a roster list of players (e.g. a soccer team) with a minimum of twenty players on a team. When filling out the roster, each player field has a set of drop downs ranging from state and country of origin to height and weight and jersey #. By setting the drop downs (which are generated by functions) to variables before looping through the number of players on a team, I think we'll save a fair amount of time, not to mention having to make changes in one place; not throughout the page Alright enough blathering. Thanks again for your help, --Noah - Original Message - From: "Don Read" <[EMAIL PROTECTED]> To: "CF High" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, March 15, 2003 8:25 PM Subject: RE: [PHP] Performance and Function Calls > > On 15-Mar-2003 CF High wrote: > > Hey all. > > > > Quick question: > > > > If I have a function that, say, prints out the months in a year, and I > > call > > that function within a 10 cycle loop, which of the following is faster: > > > > 1) Have function months() return months as a string; set var > > string_months = months() outside of the loop; then echo string_months > > within > > the loop > > > > -- OR > > > > 2) Just call months() for each iteration through the loop > > > > I'm not sure how PHP interprets option number 1. > > > > Guidance for the clueless much appreciated... > > > > Easy enuff to test: > > > function getmicrotime(){ > list($usec, $sec) = explode(" ",microtime()); > return ((float)$usec + (float)$sec); > } > > $time_start = getmicrotime(); > for ($m=1; $m <11; $m++) { > echo date('F', strtotime("2003-$m-1")), ''; > } > echo 'A: ', getmicrotime() - $time_start , ''; > > $time_start = getmicrotime(); > for ($m=1; $m <11; $m++) { > $str[]=date('F', strtotime("2003-$m-1")); > } > echo implode('',$str); > echo 'B: ', getmicrotime() - $time_start , ''; > > unset($str); > $time_start = getmicrotime(); > for ($m=1; $m <11; $m++) { > $str[]=date('F', strtotime("2003-$m-1")); > } > > while (list(,$v)= each($str)) { > echo $v, ''; > } > echo 'C: ', getmicrotime() - $time_start , ''; > > ?> > > On my machine I get numbers like: > A: 0.000907063484192 > B: 0.000651001930237 > C: 0.000686049461365 > > The function call within the loop is slower (contrary to what I > expected), the real question is how much effort do you want to expend to > save 2-3 micro-seconds? > > Regards, > -- > Don Read [EMAIL PROTECTED] > -- It's always darkest before the dawn. So if you are going to >steal the neighbor's newspaper, that's the time to do it. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strip_tags() Quandry....
Hey John; Hey Carl. I've heard this debate before; i.e. regular expressions vs. PHP string formatting functions. The problem I'm dealing with will require, I believe, a combination of preg_replace(), str_replace(), strstr(), and str_pos(). To my limited knowledge, there is no way to remove white space with PHP string functions; when I use strip_tags on a block of html text, whitespace results; thus the need for preg_replace(). The rest can most likely be taken care of with PHP string functions, although I'm running into a few headaches with user errors; i.e. when a coach types up his/her team roster and mistakenly adds extra spaces between fields (e.g. player height = 6' 2" instead of 6' 2"), or roster fields do not match up with our roster table fields (e.g. one team roster has a field for player's favorite professional athlete) -- in these cases it may be that I'll need to use regular expressions to crawl through roster string data looking for word boundaries and the like. I'm new to regular expressions to say the least -- just took the dive in yesterday; much to learn... If either of you feel like elaborating on the pros and cons of regular expressions vs. PHP string functions, let me know. --Noah - Original Message - From: "CPT John W. Holmes" <[EMAIL PROTECTED]> To: "Carl Furst" <[EMAIL PROTECTED]>; "Noah" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, May 29, 2003 10:18 AM Subject: Re: [PHP] strip_tags() Quandry > Yes, no problem! Glad it worked out. you may wish to actually study the > perlre man page on perl.com. This goes into the most details and talks about > how PERL actually EXTENDS shell regular expressions significantly and > excellent resource that I have used many many times. > > I figure since PHP regexps are perl compatible, might as well go to the > source, no? > > My other suggestion is that if you are taking this HTML and putting into a > database, especially MySQL you should scrub for pipes, nulls and slashes, > hackers can exploit user input to open a tty or shell or even access user > files like /etc/passwd and mess wid ya here are a few regexps that do > that While I agree that regexp are powerful and useful, the examples you gave are better suited to using str_replace(), trim(), or nl2br() calls rather than a regular expression. Also, about the "warning" for inserting data into a database... try not to scare people to much. If you have column = '$value' or column = "$value" in your query, as long as you've run addslashes on $value to escape single quotes in the first case and double quotes in the second, there's no vulnerabilities. If you have column = $column then you BETTER make sure that $column is a number and only a number. When you put unquoted (unquoted within the actual SQL, not PHP) values into your SQL, that's when you open yourself up to vulnerabilities if you're not validating that the value is only a number. > For pipes: > preg_replace('/\|/g','',$html_string); > For nulls: > Preg_replace('/\0/g','',$html_string); > For slashes > preg_replace('/\//g','',$html_string); # to be clearer, you can use s!\/! > g; just so you can see where the regexp begins and ends. str_replace('|','',$html_string); etc... > Some other useful ones for data like the stuff you're doing: > Spaces at the beginning: > /^\s/ > spaces at the end: > /\s$/ trim() > tags into \n > preg_replace('!\!', "\n", $string); nl2br(); ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strip_tags() Quandry....
Exactly, Carl. The HTML team data I'm dealing with comes in myriad formats -- nothing is uniform as each school presents their team data differently, not to mention potential inconsistencies (e.g. users mistakenly entering multiple spaces between fields and the like) within each format. For the most part I intend to rely on regular expressions for this job, although I'm a little wary -- regexp syntax is tres bizarre ;--) Thanks for the clues; ultraedit.com has a great regexp tutorial Enjoy the spring/summer, --Noah - Original Message - From: "Carl Furst" <[EMAIL PROTECTED]> To: "Noah" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, May 30, 2003 7:44 AM Subject: RE: [PHP] strip_tags() Quandry As you can guess, I'm more a fan of the regular expressions myself being primarily a PERL head. However, PHP string functions are useful and convenient (like trim() for example), and they don't require you to know the in's and out's of regexps which can look like gobbledygook, be very confusing, and sometimes very difficult to use if you don't really know how they work. If you can get them to work, they are very powerful. However getting them to work can require some serious tweaking. I think the main thing when deciding which to use is how much control you want over what is done to your string. Using a PHP function can lead to precarious results sometimes if you don't know exactly what they do (nl2br(), for example, you have to be sure that ALL of your 's are to occur right before a "\n", this isn't always the case). They also don't afford as much flexibility in some cases as regular expressions do (str_replace for replacing multiple spaces, for example). If it's something simple that you know a PHP function can take of, use it. If not, use regexps. They may take a bit more tweaking, but in the long run are much more flexible and a lot more powerful. Carl. -Original Message- From: Noah [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 11:03 PM To: CPT John W. Holmes; Carl Furst Cc: [EMAIL PROTECTED] Subject: Re: [PHP] strip_tags() Quandry Hey John; Hey Carl. I've heard this debate before; i.e. regular expressions vs. PHP string formatting functions. The problem I'm dealing with will require, I believe, a combination of preg_replace(), str_replace(), strstr(), and str_pos(). To my limited knowledge, there is no way to remove white space with PHP string functions; when I use strip_tags on a block of html text, whitespace results; thus the need for preg_replace(). The rest can most likely be taken care of with PHP string functions, although I'm running into a few headaches with user errors; i.e. when a coach types up his/her team roster and mistakenly adds extra spaces between fields (e.g. player height = 6' 2" instead of 6' 2"), or roster fields do not match up with our roster table fields (e.g. one team roster has a field for player's favorite professional athlete) -- in these cases it may be that I'll need to use regular expressions to crawl through roster string data looking for word boundaries and the like. I'm new to regular expressions to say the least -- just took the dive in yesterday; much to learn... If either of you feel like elaborating on the pros and cons of regular expressions vs. PHP string functions, let me know. --Noah - Original Message - From: "CPT John W. Holmes" <[EMAIL PROTECTED]> To: "Carl Furst" <[EMAIL PROTECTED]>; "Noah" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, May 29, 2003 10:18 AM Subject: Re: [PHP] strip_tags() Quandry > Yes, no problem! Glad it worked out. you may wish to actually study the > perlre man page on perl.com. This goes into the most details and talks about > how PERL actually EXTENDS shell regular expressions significantly and > excellent resource that I have used many many times. > > I figure since PHP regexps are perl compatible, might as well go to the > source, no? > > My other suggestion is that if you are taking this HTML and putting into a > database, especially MySQL you should scrub for pipes, nulls and slashes, > hackers can exploit user input to open a tty or shell or even access user > files like /etc/passwd and mess wid ya here are a few regexps that do > that While I agree that regexp are powerful and useful, the examples you gave are better suited to using str_replace(), trim(), or nl2br() calls rather than a regular expression. Also, about the "warning" for inserting data into a database... try not to scare people to much. If you have column = '$value' or column = "$value" in your query, as long as you've run addslashes on $value to escape single quotes in the fir
[PHP] ticks wont execute file on one server, but will on another
is there a reason why doing something like `rm test.test` would work on one server but not another? - noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Array of COM objects doesn't work in PHP but does in ASP?
Hey guys, OK I favor PHP so far above ASP however it doesnt seem like PHP can handle an array of COM Objects. Here's the scenario: Within the 'Deal' object contains an array of 'Bonds'. I want to access each bond by doing: $comDeal->Bonds->Item[$i]; ( btw Item is part of the com object to access each) However i get this error: Warning: PropGet() failed: Invalid number of parameters In ASP I can do: comDeal.Bonds.Item(i) and it works fine Any suggestions? Thanks! - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Startup: Unable to load dynamic library
Hi, I am running apache-2.2.4 and php5-5.2.1-2 and I am find some php related errors accumulating in /var/log/messages - look below. I've rebuilt php5 and apache2.2.4 and still the same issues. what else could be going on here. also 'apache restart' is fine but 'apache graceful' core dumps. any clues, Noah here they are: Feb 17 17:07:03 typhoon httpd: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613-debug/ftp.so' - Cannot open "/usr/local/lib/php/20060613-debug/ftp.so" in Unknown on line 0 Feb 17 17:07:03 typhoon httpd: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613-debug/ldap.so' - Cannot open "/usr/local/lib/php/20060613-debug/ldap.so" in Unknown on line 0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] httpd: PHP Notice: Undefined index: autoplay
Hi there, I just upgraded to apache2.2.0 and reinstalled php4-4.4.2_1 on a FreeBSD 4.11 machine. I am trying to make sure that my PHP is properly installed and configured. I am seeing the following PHP Notice about 10 entries a day in my /var/log/messages in regards to: --- snip -- httpd: PHP Notice: Undefined index: autoplay in /a/www/data/filname/garbled/radio.blog/index.php on line 9 --- snip --- I am not quite sure what to do to make sure things are operating properly. Might someone lend a hand here? cheers, Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] httpd: PHP Notice: Undefined index: autoplay
Hi there, I just upgraded to apache2.2.0 and reinstalled php4-4.4.2_1 on a FreeBSD 4.11 machine. I am trying to make sure that my PHP is properly installed and configured. I am seeing the following PHP Notice about 10 entries a day in my /var/log/messages in regards to: --- snip -- httpd: PHP Notice: Undefined index: autoplay in /a/www/data/filname/garbled/radio.blog/index.php on line 9 --- snip --- I am not quite sure what to do to make sure things are operating properly. Might someone lend a hand here? cheers, Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] httpd: PHP Notice: Undefined index: autoplay
Hi there, I just upgraded to apache2.2.0 and reinstalled php4-4.4.2_1 on a FreeBSD 4.11 machine. I am trying to make sure that my PHP is properly installed and configured. I am seeing the following PHP Notice about 10 entries a day in my /var/log/messages in regards to: --- snip -- httpd: PHP Notice: Undefined index: autoplay in /a/www/data/filname/garbled/radio.blog/index.php on line 9 --- snip --- I am not quite sure what to do to make sure things are operating properly. Might someone lend a hand here? cheers, Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] /usr/local/libexec/apache22/libphp4.so not installed
FreeBSD-4.11 After rebuilding php4-4.4.2_2 with Apache Module and apache-2.2.2 I no longer and finding that /usr/local/libexec/apache22/libphp4.so is getting installed. Any clues as to what I am doing wrong? I cant figure it out at the moment. --- snip --- # /usr/local/etc/rc.d/apache22.sh restart Performing sanity check on apache22 configuration: httpd: Syntax error on line 101 of /usr/local/etc/apache22/httpd.conf: Cannot load /usr/local/libexec/apache22/libphp4.so into server: Cannot open "/usr/local/libexec/apache22/libphp4.so" # grep php4 /usr/local/etc/apache/httpd.conf LoadModule php4_modulelibexec/apache22/libphp4.so # pkg_info | grep apache apache-2.2.2Version 2.2 of Apache web server with prefork MPM. # pkg_info | grep php php4-4.4.2_2PHP Scripting Language (Apache Module and CLI) php4-bz2-4.4.2_2The bz2 shared extension for php php4-ctype-4.4.2_2 The ctype shared extension for php php4-domxml-4.4.2_2 The domxml shared extension for php php4-ftp-4.4.2_2The ftp shared extension for php php4-gd-4.4.2_2 The gd shared extension for php php4-gettext-4.4.2_2 The gettext shared extension for php php4-iconv-4.4.2_2 The iconv shared extension for php php4-imap-4.4.2_2 The imap shared extension for php php4-ldap-4.4.2_2 The ldap shared extension for php php4-mbstring-4.4.2_2 The mbstring shared extension for php php4-mcal-4.4.2_2 The mcal shared extension for php php4-mcrypt-4.4.2_2 The mcrypt shared extension for php php4-mysql-4.4.2_2 The mysql shared extension for php php4-openssl-4.4.2_2 The openssl shared extension for php php4-pcre-4.4.2_2 The pcre shared extension for php php4-session-4.4.2_2 The session shared extension for php php4-xml-4.4.2_2The xml shared extension for php php4-xmlrpc-4.4.2_1 The xmlrpc shared extension for php php4-zlib-4.4.2_2 The zlib shared extension for php # ls /usr/local/libexec/apache22 httpd.exp mod_cache.somod_log_config.so mod_actions.so mod_cern_meta.somod_logio.so mod_alias.somod_cgi.so mod_mime.so mod_asis.so mod_charset_lite.so mod_mime_magic.so mod_auth_basic.so mod_dav.so mod_negotiation.so mod_auth_digest.so mod_dav_fs.so mod_rewrite.so mod_authn_anon.so mod_deflate.so mod_setenvif.so mod_authn_dbm.somod_dir.so mod_speling.so mod_authn_default.somod_disk_cache.so mod_ssl.so mod_authn_file.so mod_env.so mod_status.so mod_authz_dbm.somod_expires.so mod_unique_id.so mod_authz_default.somod_file_cache.so mod_userdir.so mod_authz_groupfile.so mod_filter.so mod_usertrack.so mod_authz_host.so mod_headers.so mod_version.so mod_authz_owner.so mod_imagemap.so mod_vhost_alias.so mod_authz_user.so mod_include.so mod_autoindex.somod_info.so -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] /usr/local/libexec/apache22/libphp4.so not installed
FreeBSD-4.11 After rebuilding php4-4.4.2_2 with Apache Module and apache-2.2.2 from /usr/ports - I no longer am finding that /usr/local/libexec/apache22/libphp4.so is getting installed. Any clues as to what I am doing wrong? I cant figure it out at the moment. --- snip --- # /usr/local/etc/rc.d/apache22.sh restart Performing sanity check on apache22 configuration: httpd: Syntax error on line 101 of /usr/local/etc/apache22/httpd.conf: Cannot load /usr/local/libexec/apache22/libphp4.so into server: Cannot open "/usr/local/libexec/apache22/libphp4.so" # grep php4 /usr/local/etc/apache/httpd.conf LoadModule php4_modulelibexec/apache22/libphp4.so # pkg_info | grep apache apache-2.2.2Version 2.2 of Apache web server with prefork MPM. # pkg_info | grep php php4-4.4.2_2PHP Scripting Language (Apache Module and CLI) php4-bz2-4.4.2_2The bz2 shared extension for php php4-ctype-4.4.2_2 The ctype shared extension for php php4-domxml-4.4.2_2 The domxml shared extension for php php4-ftp-4.4.2_2The ftp shared extension for php php4-gd-4.4.2_2 The gd shared extension for php php4-gettext-4.4.2_2 The gettext shared extension for php php4-iconv-4.4.2_2 The iconv shared extension for php php4-imap-4.4.2_2 The imap shared extension for php php4-ldap-4.4.2_2 The ldap shared extension for php php4-mbstring-4.4.2_2 The mbstring shared extension for php php4-mcal-4.4.2_2 The mcal shared extension for php php4-mcrypt-4.4.2_2 The mcrypt shared extension for php php4-mysql-4.4.2_2 The mysql shared extension for php php4-openssl-4.4.2_2 The openssl shared extension for php php4-pcre-4.4.2_2 The pcre shared extension for php php4-session-4.4.2_2 The session shared extension for php php4-xml-4.4.2_2The xml shared extension for php php4-xmlrpc-4.4.2_1 The xmlrpc shared extension for php php4-zlib-4.4.2_2 The zlib shared extension for php # ls /usr/local/libexec/apache22 httpd.exp mod_cache.somod_log_config.so mod_actions.so mod_cern_meta.somod_logio.so mod_alias.somod_cgi.so mod_mime.so mod_asis.so mod_charset_lite.so mod_mime_magic.so mod_auth_basic.so mod_dav.so mod_negotiation.so mod_auth_digest.so mod_dav_fs.so mod_rewrite.so mod_authn_anon.so mod_deflate.so mod_setenvif.so mod_authn_dbm.somod_dir.so mod_speling.so mod_authn_default.somod_disk_cache.so mod_ssl.so mod_authn_file.so mod_env.so mod_status.so mod_authz_dbm.somod_expires.so mod_unique_id.so mod_authz_default.somod_file_cache.so mod_userdir.so mod_authz_groupfile.so mod_filter.so mod_usertrack.so mod_authz_host.so mod_headers.so mod_version.so mod_authz_owner.so mod_imagemap.so mod_vhost_alias.so mod_authz_user.so mod_include.so mod_autoindex.somod_info.so -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /usr/local/libexec/apache22/libphp4.so not installed
On Mon, 22 May 2006 14:24:33 +1000, Chris wrote > Noah wrote: > > FreeBSD-4.11 > > > > After rebuilding php4-4.4.2_2 with Apache Module and apache-2.2.2 from > > /usr/ports - I no longer am finding that > > /usr/local/libexec/apache22/libphp4.so is getting installed. > > > > Any clues as to what I am doing wrong? I cant figure it out at the moment. > > The error makes perfect sense - there is no file. > > Apache2 has no idea what php is, so you need to re-compile php4 > against the new apache2. Hi there, Okay I am not really understanding you here. what are you suggesting I do here? I did the following 1) uninstalled php4 and apache2 2) rebuilt and installed apache2 fresh from /usr/ports 3) then rebuilt and installed php4 fresh from /usr/ports with apache module created. 4) still the same error: # /usr/local/etc/rc.d/apache22.sh restart Performing sanity check on apache22 configuration: httpd: Syntax error on line 101 of /usr/local/etc/apache22/httpd.conf: Cannot load /usr/local/libexec/apache22/libphp4.so into server: Cannot open "/usr/local/libexec/apache22/libphp4.so" 5) Also php4 and apache2.2 was working something just broke since the last usr ports upgrade. I need steps for what exactly to do next because I dont know what else to try. cheers, Noah > > You can't just copy the existing one because things would be quite > different internally between apache1 and apache2. > > -- > Postgresql & php tutorials > http://www.designmagick.com/ > > -- > 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] a recommended FREE PHP shopping cart
Hello can any one recommended a FREE PHP /MYSQL shopping cart,,that they have set up themselves?? thanks so much -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I am receiving the same posting TWICE
Help! I am receiving the same posting TWICE how do I configure things to just get one copy of postings?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Warning: Could not execute mail delivery program
PHP Warning: Could not execute mail delivery program in /htdocs/... Any suggestions on how to fix this? - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Warning: Could not execute mail delivery program
So do you think it has to be a server issue and not a code issue? My site's traffic load has increased significantly in the last week or so and that's kind of when it started happening. Could there be a resource problem? Is there any way to find out more on why it's not running? - Noah "Noah Spitzer-Williams" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > PHP Warning: Could not execute mail delivery program in /htdocs/... > > Any suggestions on how to fix this? > > - Noah > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Warning: Could not execute mail delivery program
Here are my safemode parameters: ; Safe Mode safe_mode = Off safe_mode_exec_dir = safe_mode_allowed_env_vars = PHP_ ; Setting certain environment variables ; may be a potential security breach. ; This directive contains a comma-delimited ; list of prefixes. In Safe Mode, the ; user may only alter environment ; variables whose names begin with the ; prefixes supplied here. ; By default, users will only be able ; to set environment variables that begin ; with PHP_ (e.g. PHP_FOO=BAR). ; Note: If this directive is empty, PHP ; will let the user modify ANY environment ; variable! safe_mode_protected_env_vars = LD_LIBRARY_PATH - Noah "Ā”Ć" <[EMAIL PROTECTED]> wrote in message 42EOfJ$[EMAIL PROTECTED]">news:42EOfJ$[EMAIL PROTECTED]... > ==> [EMAIL PROTECTED] (Noah Spitzer-Williams) ªº¤Ä³¹¤¤“£¨ì: > > PHP Warning: Could not execute mail delivery program in /htdocs/... > > Any suggestions on how to fix this? > > - Noah > > check your php.ini file. > > if should be safe_mode = Off > > -- > [m[1;32m* Origin: LastLoveSongBBS (lls.twbbs.org) From: localhost.localdomai [m -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to prevent failure email from being sent?
Hey guys, My service sends out emails every few days to members who wish to have stats sent to them. The problem is once an email becomes inactive, I the webmaster gets a failure email sent to me. This is starting to add up and I can get upwards of 20 of these a day. It just seems likea waste of space and bandwidth... is there anyway I can prevent this? If i delete the webmaster email key in php.ini will my emails not have a reply address? Thanks! - Noah [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Restart process from code?
Is there a way to restart a process (actually the process to handle ASP pages) from code? - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Restart process from code?
But I would like to restart the process as in it's currently running and I want to end it and then start it again... - Noah - Original Message - From: "John Holmes" <[EMAIL PROTECTED]> To: "'Noah Spitzer-Williams'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, July 17, 2002 2:18 PM Subject: RE: [PHP] Restart process from code? > You can use exec(), as long as the user PHP is running as has permission > to execute the program... > > ---John Holmes... > > > -Original Message- > > From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, July 17, 2002 1:20 PM > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > > Subject: [PHP] Restart process from code? > > > > Is there a way to restart a process (actually the process to handle > ASP > > pages) from code? > > > > - Noah > > > > > > > > -- > > 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] Restart process from code?
How do I end the process using exec? Is there an equivalent to NET STOP? - Noah - Original Message - From: "John Holmes" <[EMAIL PROTECTED]> To: "'Noah Spitzer-Williams'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, July 17, 2002 2:28 PM Subject: RE: [PHP] Restart process from code? > So? Use exec(). Use it twice if you have to. If you can run a command on > the command line, then you can run it through exec. Only difference is > if the user PHP is running as can run the command. > > ---John Holmes... > > > -Original Message- > > From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, July 17, 2002 2:10 PM > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; php- > > [EMAIL PROTECTED] > > Subject: Re: [PHP] Restart process from code? > > > > But I would like to restart the process as in it's currently > running > > and > > I want to end it and then start it again... > > > > > > - Noah > > > > - Original Message - > > From: "John Holmes" <[EMAIL PROTECTED]> > > To: "'Noah Spitzer-Williams'" <[EMAIL PROTECTED]>; > > <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > Sent: Wednesday, July 17, 2002 2:18 PM > > Subject: RE: [PHP] Restart process from code? > > > > > > > You can use exec(), as long as the user PHP is running as has > permission > > > to execute the program... > > > > > > ---John Holmes... > > > > > > > -Original Message- > > > > From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]] > > > > Sent: Wednesday, July 17, 2002 1:20 PM > > > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > > > > Subject: [PHP] Restart process from code? > > > > > > > > Is there a way to restart a process (actually the process to > handle > > > ASP > > > > pages) from code? > > > > > > > > - Noah > > > > > > > > > > > > > > > > -- > > > > 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] Question about phpinfo() and XML
phpinfo reports that XML is 'active' but i thought xml was a client side language? what does it have to do with the server? thanks! - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] does chdir() change include_path on the fly? HELP
my problem is i have an include file in a parent directory which includes other files. i want these other files to be in the same directory as this parent directory file..(hope your gettin me here...). the prob is the parent directory file looks for its include files in the current directory. example: current path is: www.blah.com/blahdir a file in blahdir called blah1.php includes blah2.php which is located in www.blah.com blah2.php includes blah3.php and blah4.php which are also located in www.blah.com the problem is blah2.php looks for blah3.php and blah4.php in www.blah.com/blahdir will chdir() fix this? or is there another way? Thanks!! - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] get last directory of a full path? (parent directory)
whats the easiest way to go from "/dir1/dir2/dir3/hello.php" to "dir3/" ? dirname will cut off hello.php but i want to cut dir1 and dir2 as well Thanks! - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] cookie paths are really confusing me...please help!
ok here's what i get from php.net: SetCookie()'s behavior is dependant on where it is called within the web document tree. For example, setting a cookie from a php script in a directory makes that cookie available only to other scripts in that directory and its subdirectories. However, setting a cookie of the same name from a script in the directory's parent directory will override all cookies of that name in the parent directory's subdirectories. scenario: im browsing a file in lets call directory 'test'. this file is including a file in the parent directory. this included file is setting a cookie. the problem is when i goto directory 'test2' and use this same included file in the parent directory, it cant find the cookie. how should be setting this cookie?? - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Deleting all cookies so matter where they were set
Is there a way to remove all cookies so matter what path they were set as long as it was from me (ex. in my parent directory). i need this because i was screwing around with setting cookies in different paths but now i cant get rid of one. Thanks! - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] get content type from fopening url?
is there a way so that if someone submits a web url (hopefully its a picture), i can check to make sure its a valid picture? i think its something like fopen(), but i dont know far i could get thanks! - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] is it safe to stripslashes() on all form variables?
would there be any problems caused if i used the stripslashes() function on all posted variables from a form to eliminate sql query errors? - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] is it safe to stripslashes() on all form variables?
Jesus that's pretty scary! So how should i go about doing this? ""Yasuo Ohgaki"" <[EMAIL PROTECTED]> wrote in message 9bflce$9p5$[EMAIL PROTECTED]">news:9bflce$9p5$[EMAIL PROTECTED]... > If you strip slashes, it will make a security hole. > > For example, > > SELECT * FROM tablename WHERE name = '$name'; > what if $name is > \'garbage\';DROP TABLE tablename;SELECT \'something > > After stripslashes($name) > SELECT * FROM table WHERE name = 'garbage';DROP TABLE tablename;SELECT > 'something'; > > Regards, > -- > Yasuo Ohgaki > > > ""Noah Spitzer-Williams"" <[EMAIL PROTECTED]> wrote in message > 9bf7ec$m1m$[EMAIL PROTECTED]">news:9bf7ec$m1m$[EMAIL PROTECTED]... > > would there be any problems caused if i used the stripslashes() function on > > all posted variables from a form to eliminate sql query errors? > > > > - Noah > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] how to scale down image using ImageMagick?
I have a bunch of pictures all in ranging filesizes and dimensions. I want to resize the ones that over 175 pixels wide to a 175 pixel wide picture however i want the height to scale down (ie. i dont want a really thin picture, i just want it to be what it would be if it were resized). i have this but i cant figure out how to just scale down the width: c:\progra~1\imagem~1\mogrify.exe -geometry 175x30! picture.jpeg the '!' forces those sizes to be used but obvoiusly i dont want the height to be 30. i want it to be whatever it should be so the picture doesnt look flattened. Thanks! - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to scale down image using ImageMagick?
morgan, this is starting to work! the 175x175 does resize it to a width of 175 while retaining the aspect ratio. however when i tried using the less than sign, the windows nt command prompt is treating it as saving the output to a file: c:\progra~1\imagem~1\mogrify.exe -geometry 175x175> picture.jpeg imagemagick replies with : missing image file name. this is because the > sign is telling windows to save the output to a file. i tried putting a 1 after the > sign and it made a blank file with filename of '1'. how can i get around this? i couldnt figure out how to use -identify, it was not in the docs Thanks so much! - Noah "Morgan Curley" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... according to the docs use -geometry 175x175> picture.jpeg man mogrify: -geometry x{+-}{+-}{%}{!}{<}{>} preferred width and height of the image. See X(1) for details about the geometry specification. By default, the width and height are maximum values. That is, the image is expanded or contracted to fit the width and height value while maintaining the aspect ratio of the image. Append an exclamation point to the geometry to force the image size to exactly the size you specify. For example, if you specify 640x480! the image width is set to 640 pixels and height to 480. If only one factor is speciĀ fied, both the width and height assume the value. To specify a percentage width or height instead, append %. The image size is multiplied by the width and height percentages to obtain the final image dimensions. To increase the size of an image, use a value greater than 100 (e.g. 125%). To decrease an image's size, use a percentage less than 100. Use > to change the dimensions of the image only if its size exceeds the geometry specification. < resizes the image only if its dimensions is less than the geometry specification. For example, if you specify 640x480> and the image size is 512x512, the image size does not change. However, if the image is 1024x1024, it is resized to 640x480. it looks like mogrify bases its resizing on the first value that is diff than the one supplied i.e. if your image is 200x50 it will scale it to 175x? but if it is 50x200 it will scale it to ?x175 if it is important you not resize based on height use identify to get the geometry first. morgan At 04:27 PM 4/18/2001, Noah Spitzer-Williams wrote: >I have a bunch of pictures all in ranging filesizes and dimensions. I want >to resize the ones that over 175 pixels wide to a 175 pixel wide picture >however i want the height to scale down (ie. i dont want a really thin >picture, i just want it to be what it would be if it were resized). i have >this but i cant figure out how to just scale down the width: > >c:\progra~1\imagem~1\mogrify.exe -geometry 175x30! picture.jpeg > >the '!' forces those sizes to be used but obvoiusly i dont want the height >to be 30. i want it to be whatever it should be so the picture doesnt look >flattened. > >Thanks! - Noah > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to scale down image using ImageMagick?
Is there a way to install the GD library on windows nt systems? i can't get this thing to not scale it if its smaller than a certain width ""Steve Werby"" <[EMAIL PROTECTED]> wrote in message 00ae01c0c848$8a802bb0$6501a8c0@workstation7">news:00ae01c0c848$8a802bb0$6501a8c0@workstation7... > "Noah Spitzer-Williams" <[EMAIL PROTECTED]> wrote: > > I have a bunch of pictures all in ranging filesizes and dimensions. I want > > to resize the ones that over 175 pixels wide to a 175 pixel wide picture > > however i want the height to scale down (ie. i dont want a really thin > > picture, i just want it to be what it would be if it were resized). i have > > this but i cant figure out how to just scale down the width: > > > > c:\progra~1\imagem~1\mogrify.exe -geometry 175x30! picture.jpeg > > > > the '!' forces those sizes to be used but obvoiusly i dont want the height > > to be 30. i want it to be whatever it should be so the picture doesnt look > > flattened. > > I believe imagemagick has an option where you can specify a single dimension > (x or y) and it will set that dimension accordingly and automatically scale > the other dimension. This should be covered in the manual pages or --help > output of the program. > > > -- > -- > Steve Werby > President, Befriend Internet Services LLC > http://www.befriend.com/ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to scale down image using ImageMagick?
right my goal was to actually alter the file size for quicker downloads and less bandwidth. the solution was a combination of morgan's and joe's posts. thansk guys! - Noah "Morgan Curley" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > This is a neat bit of code to fill in image height and width info but it > does not affect the actual file size like resizing the image would > > morgan > > At 02:43 PM 4/19/2001, FredrikAT wrote: > >Hi! > > > >This is what I do: > > > > if (!empty($picture)) { > > $size = GetImageSize ("pics/$picture"); > > if ($size[0] >= '175') { > > $width = '175'; > > $height = $size[1] * ($width / $size[0]); > > } else { > > $width = $size[0]; > > $height = $size[1]; > > } > > } > > > >echo ""; > > > >Fredrik A. Takle > >Bergen, Norway > > > > > >""Joe Sheble (Wizaerd)"" <[EMAIL PROTECTED]> skrev i melding > >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > > > > I use ImageMagik all the time for thumbnail creations... this doesn't > > > resize the image, it creates a new image, a thumbnail... but the principle > > > is the same > > > > > > $cWidth = 175; > > > $picture_src = "fullSize/somepic.jpg"; > > > $thumb_dest = "fthumbNail/somepic.jpg"; > > > > > > $aImageInfo = getimagesize( $picture_src ); > > > > > > if( $aImageInfo[0] < $cWidth ) { > > > exec("convert -geometry $cWidth -colors 256 -colorspace > > > yuv $picture_src $thumb_dest" ); > > > } > > > > > > At 08:59 AM 4/19/01 -0400, Noah Spitzer-Williams wrote: > > > >Is there a way to install the GD library on windows nt systems? i can't > >get > > > >this thing to not scale it if its smaller than a certain width > > > > > > > >""Steve Werby"" <[EMAIL PROTECTED]> wrote in message > > > >00ae01c0c848$8a802bb0$6501a8c0@workstation7">news:00ae01c0c848$8a802bb0$6501a8c0@workstation7... > > > > > "Noah Spitzer-Williams" <[EMAIL PROTECTED]> wrote: > > > > > > I have a bunch of pictures all in ranging filesizes and dimensions. > >I > > > >want > > > > > > to resize the ones that over 175 pixels wide to a 175 pixel wide > >picture > > > > > > however i want the height to scale down (ie. i dont want a really > >thin > > > > > > picture, i just want it to be what it would be if it were resized). > >i > > > >have > > > > > > this but i cant figure out how to just scale down the width: > > > > > > > > > > > > c:\progra~1\imagem~1\mogrify.exe -geometry 175x30! picture.jpeg > > > > > > > > > > > > the '!' forces those sizes to be used but obvoiusly i dont want the > > > >height > > > > > > to be 30. i want it to be whatever it should be so the picture > >doesnt > > > >look > > > > > > flattened. > > > > > > > > > > I believe imagemagick has an option where you can specify a single > > > >dimension > > > > > (x or y) and it will set that dimension accordingly and automatically > > > >scale > > > > > the other dimension. This should be covered in the manual pages > >or --help > > > > > output of the program. > > > > > > > > > > > > > > > -- > > > > > -- > > > > > Steve Werby > > > > > President, Befriend Internet Services LLC > > > > > http://www.befriend.com/ > > > > > > > > > > > > > > > -- > > > > > PHP General Mailing List (http://www.php.net/) > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > To contact the list administrators, e-mail: > >[EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > >-- > > > >PHP General Mailing List (http://www.php.net/) > > > >To unsubscribe, e-mail: [EMAIL PROTECTED] > > > >For additional commands, e-mail: [EMAIL PROTECTED] > > > >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Starting PHP script with crontab
is there a service on the web that can do this for you? i once found a site that would accept a url and an interval and would retrieve that url (therefore running any code you had in there) on your interval - Noah "Anuradha Ratnaweera" <[EMAIL PROTECTED]> wrote in message Pine.LNX.4.21.0105021110320.342-10@presario">news:Pine.LNX.4.21.0105021110320.342-10@presario... > > If you are not careful, anyone will be able to run the script! > > Anuradha > > On Thu, 19 Apr 2001, Bertjan Schrader wrote: > > > I need tot start a PHP script at night with the crontab. I tried to do it > > with lynx (lynx http://www.domain.nl/test.php) as a commandline within the > > crontab. Lynx is starting but the PHP script is not working. Anyone an idea > > how to do it? > > > > OS: Redhat Linux 5.2 > > Apache > > PHP as a apache module > > > > thanks! > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] What's more effecient: var on every page or simple function?
Which of the two is more efficient: # start of file.php $myvar = 3; # end file.php #start of file.php function myvar() { return 3; } #end file.php the difference between the two is the first example would set the variable on every page regardless of whether it was used whereas with the function obviously it would be used only if it were called. what's better? (myvar is a constant #) - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Are constants more efficient than variables that never change?
I may have a variable that changes page to page, but once it loads up, it never needs to be changed on that page. So my question is should i just do: define("myvar", 3); OR: $myvar = 3; does defining it make that much of a difference (if i have several of these variables that could be defined instead). - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Are constants more efficient than variables that never change?
Ok, I'm only wondering this because I'm tryin to decrease the load time significantly because each page has to go through a lot of stuff before they're loaded and with the volume of hits it gets, i need anything to help out - Noah "CC Zona" <[EMAIL PROTECTED]> wrote in message 9dsm85$kgl$[EMAIL PROTECTED]">news:9dsm85$kgl$[EMAIL PROTECTED]... > In article <9dsknt$fb1$[EMAIL PROTECTED]>, > [EMAIL PROTECTED] ("Noah Spitzer-Williams") wrote: > > > So my question is should i just do: > > > > define("myvar", 3); > > > > OR: > > > > $myvar = 3; > > > > does defining it make that much of a difference (if i have several of these > > variables that could be defined instead). > > I'm not sure whether there's a significant difference in memory usage, but > IMO the difference in scoping rules is a significant consideration. > Constants carry over into functions local scope, while variables must be > explicitely passed or declared as global in order to become available in a > function's local scope. Which one you consider to be the "convenience" and > which you consider the "nuisance" is in the eye of the beholder , but > IMO either way it's a very handy/exploitable distinction which you can use > to speed up development/debugging time. > > -- > CC > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Edit A HREF links on the fly - see what i mean - important!
hey guys, i'm working on an exit page popup but i dont want the popup to load whenever i change pages in the site, only when the user exits the site totally. now i dont think there is some sort of javascript for thsi but i have figured out a way around. for every link do this: a href="blah" onclick="nopop=1">blahhttp://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Hello $variable, whats your name?
theres even $GLOBALS() ""Data Driven Design"" <[EMAIL PROTECTED]> wrote in message 001301c0b347$d96ca5c0$[EMAIL PROTECTED]">news:001301c0b347$d96ca5c0$[EMAIL PROTECTED]... > You can cycle through the $HTTP_POST_VARS or $HTTP_GET_VARS arrays depending > on whether you use 'post' or 'get' for the methos in you form > > while(list($key,$val)=each($HTTP_POST_VARS)) { > print "$key:$val\n"; > } > > > - Original Message - > From: JCampbell <[EMAIL PROTECTED]> > To: Main PHP List <[EMAIL PROTECTED]> > Sent: Tuesday, December 12, 2000 4:05 PM > Subject: [PHP] Hello $variable, whats your name? > > > > I would like to know if there is a way to determine the name of a > variable. > > > > Example: > > I have the variable $firstname, with a value of Jon > > > > I want to be able to > > > > echo name_of_variable : value_of_variable; > > > > So the user would see > > > > firstname : Jon > > > > I want to be able to do this without knowing what variables will be passed > > to the PHP script in advance. > > > > Any help is appreciated in advance. > > > > > > === > > And shepards we shall be > > For thee, my lord, for thee > > For thou hath descended forth from thy hands > > That our feats may swiftly carry out thy command > > We will flow a river forth unto thee > > And teaming with souls shall it ever be... > > === > > http://jcampbell.blacklightning.net > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] gd library on win2k?
how can i install the gd library for php on win2k using iis5? - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Php Files on Browser
are you using http://localhost? - Noah "Ted Shaw" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > G'day - > > Sorry for this stupid question but I'm a newby trying to install php on my > win98 computer and find that neither netscape nor IE 5.5 won't open php > files that are located on my c: drive but will access php files on the net. > There must be a simple explanation. > > Any help greatly appreciated... > > Ted Shaw > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] how to flip an image using GD?
how would i flip an image horizontally using the GD library in PHP? Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] how to hide dbconnect file if its in published directory?
Hey guys, I come for advice once again. Say i have a file dbconnect.inc which connects to my database. Now if this file is located in a directory accessible for to the web is there anyway that if someone types in that file i can detect it being accessed, instead of included, and redirect them elsewhere? Thanks guys! - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Include fails when "./" is in front of file name
This works: include("file.inc.php"); This doesn't: include("./file.inc.php"); I can't figure it out! PHPMyAdmin uses "./" so it's obviously not working. Here's my environment: Win2003 Server w/ IIS 6 PHP 5.2.5 setup as ISAPI All PHP and httpdoc directories have read, write, and execute permissions given to IIS_WPG, IIS_USER, and NETWORK SERVICE PHP.ini's include path is: include_path = ".;.\includes;.\pear" (I've also tried include_path = ".;./includes;./pear") phpinfo() works fine. Anyone have any ideas? Thanks! Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include fails when "./" is in front of file name
Casey -- nope. the include statement is being issues from the parent page. both files are in the same directory. Nitsan -- the problem is apps like phpMyAdmin are littered with include("./file.inc.php"); i'd have to replace all those to use full paths. it's not a good idea from a servicability statement anyways. thanks! On Sun, Apr 6, 2008 at 4:21 PM, Casey <[EMAIL PROTECTED]> wrote: > On Sun, Apr 6, 2008 at 2:17 PM, Noah Spitzer-Williams <[EMAIL PROTECTED]> > wrote: > > This works: > >include("file.inc.php"); > > > > This doesn't: > >include("./file.inc.php"); > > > > I can't figure it out! PHPMyAdmin uses "./" so it's obviously not > working. > > > > Here's my environment: > >Win2003 Server w/ IIS 6 > >PHP 5.2.5 setup as ISAPI > >All PHP and httpdoc directories have read, write, and execute > > permissions given to IIS_WPG, IIS_USER, and NETWORK SERVICE > >PHP.ini's include path is: include_path = ".;.\includes;.\pear" > (I've > > also tried include_path = ".;./includes;./pear") > >phpinfo() works fine. > > > > Anyone have any ideas? > > > > Thanks! > > > > Noah > > > > > > Is that include() statement being issued within an included PHP page? > > a.php > include('directory/b.php'); > ?> > > directory/b.php > include('./c.php'); // Does this refer to c.php or directory/c.php > ?> > > -- > -Casey >
Re: [PHP] Include fails when "./" is in front of file name
Here's the error I get: *Warning*: include(.\file.inc.php) [function.include<http://www.emsplannertest.com/function.include>]: failed to open stream: No such file or directory in * C:\Inetpub\httpdocs\test.php* on line *3* *Warning*: include() [function.include<http://www.emsplannertest.com/function.include>]: Failed opening '.\file.inc.php' for inclusion (include_path='.;.\includes;.\pear') in *C:\Inetpub\httpdocs\test.php* on line *3* This works fine on my old server which is running PHP 4.3.9. I honestly feel like I'm overlooking some stupid tiny thing. Are my permissions correct? Is it possible to debug this and look at the full path of file.inc.php that PHP is trying to load? Thanks! On Mon, Apr 7, 2008 at 7:36 AM, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Sun, Apr 6, 2008 at 5:17 PM, Noah Spitzer-Williams <[EMAIL PROTECTED]> > wrote: > > This works: > >include("file.inc.php"); > > > > This doesn't: > >include("./file.inc.php"); > >That's pretty vague, Noah. Is it unable to locate the file? > What's the error message you're receiving? > >Also, what happens if you create two simple files in the same > directory like so: > // file1.php > echo "Okay.\n"; > ?> > > // file2.php > include(dirname(__FILE__).'/file1.php'); > ?> > > -- > > Ask me about: > Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., > and shared hosting starting @ $2.50/mo. > Unmanaged, managed, and fully-managed! >
Re: [PHP] Include fails when "./" is in front of file name
I appreciate the help guys. I don't understand what's going on. Here's what I've tried since posting: Copied over the PHP binaries and php.ini from my old server to my new one. No luck. Copied over the phpMyAdmin from my old server to my new one. No luck. I've double-checked all permissions. Seriously, what else could there be?! I repeat: on old server, include('./file.inc.php') works FINE on new server, include('./file.inc.php') BREAKS I'm about to do a replace of "./" with "" but I know that's giving up! ""Daniel Brown"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Mon, Apr 7, 2008 at 1:05 PM, Lester Caine <[EMAIL PROTECTED]> wrote: People seem to be missing the point here. These are PUBLIC applications that are failing to work for Noah. He should not need to re-write PHPMyAdmin in order to get it to work? Next people will be saying that we should re-write PHP if it does not work for us. Oh, did I say that? Must not have been paying attention as I typed in words to that effect. Sorry. I'm giving steps to debug and recreate the issue, not to rewrite anyone else's code. You may have noticed where I mentioned cross-platform portability. -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] when using die(), how can i get the line number that errored?
here's my code: $res = mysql_query($badsqlstatement) or die(errtrapper()); inside errtrapper(), is there a way to find out what line this error occurred? thanks!! - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]