Re: [PHP] Loop, array, life....

2002-04-03 Thread Christopher William Wesley
You only want to retrieve the news from your table once. So, pull pull this code: > $container[] = $message; > while (list($news, $date) = mysql_fetch_row($newsfetch)) { > $container[] = '' . $news . ''; > $container[] = ''; > } > $container[] = ''; outside of (before) this loop:

Re: [PHP] Regular Expression Challenge

2002-03-25 Thread Christopher William Wesley
You won't be able to do that with a regexp alone. Recursively matching isn't possible. You'll need a little help from some additional code. \n" . $matches[2] . "\n" ); while( list( $key, $val ) = each( $times ) ){ print( trim( ${val} ) . "\n" ); } ?> That seems

Re: [PHP] Retaining data across multiple sites

2002-02-20 Thread Christopher William Wesley
day. Like I said before, this is just how the Internet is evolving. As you're doing, the functionality being provided has to be judged against the practicality of its implementation. g.luck, ~Chris > ----- Original Message - > From: "Christopher William W

Re: [PHP] Retaining data across multiple sites

2002-02-20 Thread Christopher William Wesley
On Wed, 20 Feb 2002, Ben Sinclair wrote: > I want to retain some data across my sites, which have different domain names. > I can't use cookies because they rely on the domain name, and I'd rather not One way I handle this ... it's a work-around, so it's not all that pretty: In the doc root on

Re: [PHP] explode? (table field to a variable of same name)

2002-02-19 Thread Christopher William Wesley
oi ... typo! see below. sorry :( ~Chris On Tue, 19 Feb 2002, Christopher William Wesley wrote: > This may not be what you want to do, but should give you some hints. > (This is my code which I use to simply dump any SQL table into an HTML > table I can view in a browse

Re: [PHP] explode? (table field to a variable of same name)

2002-02-19 Thread Christopher William Wesley
This may not be what you want to do, but should give you some hints. (This is my code which I use to simply dump any SQL table into an HTML table I can view in a browser ... for small tables, of course.) Using MySQL as an example: // assuming you ran a query and stored results in $mysql_result_s

Re: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-14 Thread Christopher William Wesley
Create a script to which you can pass a file namem and calls show_source() on the file name. http://www.php.net/manual/en/function.show-source.php Be very careful to check the input, such that the file name parameter which eventually gets passed to show_source() cannot be one which you do not wa

Re: [PHP] Filling Forms with $variables

2002-02-13 Thread Christopher William Wesley
On Wed, 13 Feb 2002, Steven Walker wrote: > > > > > > > In the browser, the name field is only filled with "Steven", and drops > off everything after the space. If I echo $name outside of the form it You need to put quotes around the value. value=""? g.luck, ~Chris

Re: [PHP] Fooling the client into thinking php script is .jpg

2002-02-10 Thread Christopher William Wesley
On Mon, 11 Feb 2002, Matt Moreton wrote: > I have a script that outputs an image. Using the gd library. But the ... > the image. Is it possible somehow to request the file as a .jpg? > www.host.com/displayimage.php Assuming you're using Apache, you can use a rewrite rule (with mod_rewrite). h

Re: [PHP] suppressing division by zero errors

2002-01-31 Thread Christopher William Wesley
You really need to do some error checking on the denominator. $num = 5; $den = 0; echo $den != 0 ? $num/$den : "0"; A number divided by zero isn't defined, so you have to circumvent the situation by making sure it never happens. ~Chris /"\

Re: [PHP] problems with mt_rand()

2002-01-31 Thread Christopher William Wesley
On Thu, 31 Jan 2002, Benjamin deRuyter wrote: > I need to generate a random number (range is not crucial) and I have been > trying to use mt_rand(). However, I am finding that is generates the same > value EVERY time. This is true whether I supple a range or not. For > example, the follow line

Re: [PHP] URL Parsing Help

2002-01-29 Thread Christopher William Wesley
$myPairs = explode( "/", $PATH_INFO ); while( list( $key, $val ) = each( $myPairs ) ){ if( !empty( $val ) ){ $myVar = explode( "=", $val ); ${$myVar[0]} = $myVar[1]; } } For you example URI, "index.php/option=contact/step=view" you would then have $

Re: [PHP] RTFM

2002-01-18 Thread Christopher William Wesley
On Sat, 19 Jan 2002, Shane Wright wrote: > Maybe this list should be split - kindof into a php-newbies and a > php-advanced ? So all the newbies can help all the newbies, and all the advanced people can help the advanced people? That wouldn't work out. All the newbies would subscribe to the ad

Re: [PHP] PHP Security - "view source code"

2002-01-16 Thread Christopher William Wesley
On Thu, 17 Jan 2002, [EMAIL PROTECTED] wrote: > I've seen a number of sites for example that didn't have the .inc extension >registered, > include() doesn't care about that, but if your includes are under the document root >of your > website (that happens a lot too, i don't know why ?) and you

Re: [PHP] Another question - not exactly what i was looking for

2002-01-15 Thread Christopher William Wesley
$where_conditions = array(); if( !empty( $lastname ) ){ $where_conditions[] = "lastname like '%${lastname}%'"; } if( !empty( $firstname ) ){ $where_conditions[] = "firstname like '%${firstname}%'"; } if( !empty( $age ) ){ $where_conditions[] = "age = ${age}"; } if( !empty(

Re: [PHP] PHP timesheets?

2002-01-07 Thread Christopher William Wesley
On Mon, 7 Jan 2002, Christian Calloway wrote: > Are there any PHP coded timesheet type web application? And if so, what > would we be suggested. Thanks, Take a look at these: http://freshmeat.net/search/?site=Freshmeat&q=timesheet+php§ion=projects ~Chris /"\

RE: [PHP] An idea for a PHP tool

2002-01-03 Thread Christopher William Wesley
On Fri, 4 Jan 2002, Jason Murray wrote: > I've seen bookmarks that pop up a javascript input window and then > use the input in the resulting URL. So, take the manual query via > javascript input and then append it to the www.php.net url. There are tips on the php site for making the quick-refer

RE: [PHP] Logo proposal

2001-12-11 Thread Christopher William Wesley
I think an animal mascot is a beat idea. Needlenose pliers. Enough said! ;) ~Chris /"\ \ / September 11, 2001 X We Are All New Yorkers

Re: [PHP] Objects and sessions

2001-11-26 Thread Christopher William Wesley
On Mon, 26 Nov 2001, Greg Sidelinger wrote: > Can someone tell me how to store a class in a session var. I want to There are several things you need to do. 1) include the class definition before you do anything 2) start the session shortly thereafter 3) register a session variable 4) create y

Re: [PHP] Classes

2001-11-25 Thread Christopher William Wesley
On Sun, 25 Nov 2001, Miles Thompson wrote: > Not such a useless explanation at all, in fact a damned good one. Tight & > concise, and you immediately related the functions to code examples, along > with an easy-to-visualize object, the chair. Sweet ... I'm glad you found it useful! TY > 1. Why

Re: [PHP] Classes

2001-11-25 Thread Christopher William Wesley
On Sun, 25 Nov 2001, Rudi Ahlers wrote: > Can anyone explain classes to me please? On many sites have I seen classes, There are people earning PHD's while explaining classes. I know your question originates from using PHP, and this is a PHP general mailing list ... but your question is just a ta

Re: [PHP] Segmented Code/HTML VS. ECHO??

2001-11-18 Thread Christopher William Wesley
I _hate_ echo'n out big batches of HTML, so I never do it. I prefer to include HTML, or have a class or function write HTML. However, printing in heredoc style is very handy ... more so than sliced bread. For example: The bear is ${name}. EOF; print( date() ); ?> PHP code, fo

Re: [PHP] relative paths

2001-11-17 Thread Christopher William Wesley
On Sat, 17 Nov 2001, Mitja Pagon wrote: > I want to know if there is a way to include(require) a file using a path > relative to web server root. I think you'll find the $DOCUMENT_ROOT environment variable handy :) ~Chris /"\

Re: [PHP] Question on variable variables

2001-11-16 Thread Christopher William Wesley
"//","$$1",$curline); > > So for the current line I am looking for something like I > want to replace that with the contents of $copyright. > > Can variable variables be used in regular expressions? > > Jeff > - Original Message - > From: "

Re: [PHP] Question on variable variables

2001-11-16 Thread Christopher William Wesley
On Fri, 16 Nov 2001, Jeff Lewis wrote: > What I need to do, however, is append a variable portion to a constant prefix. So I >have a set of variables that are named $MYdog, $MYcat etc. and I need to do > > $a = "dog" > ${"MY$a"} being the same as $MYdog > > Can this be done, and if so - how? I

Re: [PHP] for loop problem?

2001-11-12 Thread Christopher William Wesley
I just ran your code as you pasted earlier, and set up a mysql database with the table defined below ... and it inserted 223,110 passcodes into the table. PHP 4.0.99-3 (Identifies itself as 4.1.0RC1) MySQL 3.23.43-3 ~Chris /"\

Re: [PHP] Question....

2001-11-12 Thread Christopher William Wesley
try not setting the domain. ~Chris /"\ \ / September 11, 2001 X We Are All New Yorkers / \ rm -rf /bin/laden On Tue, 13 Nov 2

Re: [PHP] some questions on sessions (long)...

2001-11-12 Thread Christopher William Wesley
Your problem probably is including the miec.php from the .shtml document. Does the .shtml document send any output to the browser before including your .php script? If so, you're not going to be able to send any cookies from the .php script. Once any standard output makes it to the browser (inc

Re: [PHP] Getting uploaded filename & directory

2001-11-12 Thread Christopher William Wesley
If the path doesn't ride along in the _name variable (and I don't know of a case when it would), Nope. The value of the input element when the type = file isn't useable, except as an initial file name, so using JavaScript won't be helpful. I think the input element is implemented for type = file

Re: [PHP] Cookies, Sessions and Login Proceess

2001-11-12 Thread Christopher William Wesley
On Mon, 12 Nov 2001, Joe Van Meer wrote: > Thx Christopher for replying. Ok, let me see if I understand you > correctly... > > The user enters username and password on index.php, this is posted to > login.php. On login.php after I verify the user is who he/she says they are > I set a cookie calle

Re: [PHP] Cookies, Sessions and Login Proceess

2001-11-12 Thread Christopher William Wesley
Just do your authentication before you send any HTML (including any whitespace). I actually recommend not sending ANY HTML from your authentication script. Authenticate them, set your cookie, and redirect the visitor to an appropriate next page, based on whether or not they've successfully authe

Re: [PHP] HTTP_POST_VARS: Data there, but can't get to it

2001-11-10 Thread Christopher William Wesley
Name the form element without the brackets ... just "whatdo" instead of "whatdo[]". When $whatdo[] makes it to your formhandler, it's an array. (You _could_ access $whatdo[0] ... but that may or may not be more confusing.) ~Chris /"\

Re: [PHP] HTTP Headers

2001-11-09 Thread Christopher William Wesley
On Fri, 9 Nov 2001, Mike Harvey wrote: > Is it possible to redirect to an IP address but have the browser address bar > show an URL? Assuming that you meant "hostname" instead of "URL" since the browser address bar will always display a URL ... No. ~Chris /"\

Re: [PHP] HTTP_POST_VARS: Data there, but can't get to it

2001-11-09 Thread Christopher William Wesley
On Fri, 9 Nov 2001, Lara J. Fabans wrote: > The original form has a table where each row has a set of 3 radio > buttons name="whatdo[]" where $x is the row counter. Well, for a set of raido buttons, they should all have the same name. In your case, all 3 radio buttons should be named "whatdo"

Re: [PHP] Apache "Request" Ids?

2001-10-23 Thread Christopher William Wesley
On Tue, 23 Oct 2001, Brian White wrote: > process ID belongs to Apache. What I was wondering was there any kind > of ID that was attached to a particular CGI request that I could > access and use? Yes. Use the Apache module, mod_unique_id, and then in your environment, $UNIQUE_ID will be availa

Re: [PHP] Form Question

2001-10-21 Thread Christopher William Wesley
On Sun, 21 Oct 2001, Chip Landwehr wrote: > if ($T3==""){header ("Location: new_narrative.php?FilledName=No");} > > How do I change this to include a Post? You can put it back on as a query string (kinda dirty, but you can't POST it back). ~Chris /"\

Re: [PHP] Using Logical OR operator in IF statement???

2001-10-21 Thread Christopher William Wesley
nt and "hello-" fails with > the other part, but when I use them together with the OR operator, it > doesn't pick up either case, "-hello" or "hello-". > > I think I'm going to have to resort to evaluating the string with more than > just the one

Re: [PHP] delete html

2001-10-20 Thread Christopher William Wesley
use the strip_tags() function to remove HTML tags from strings. http://www.zend.com/manual/function.strip-tags.php ~Chris /"\ \ / September 11, 2001 X We Are All New York

Re: [PHP] Using Logical OR operator in IF statement???

2001-10-20 Thread Christopher William Wesley
I'm a bit confused by the logic used (your conditionals are looking for NOT -, but then the printed statement indicates you were looking for the -), but anywho ... try these on for size. if (substr($sString,-1,1)=="-") { print "You can't have a dash at the end of your string."; } if (substr($sSt

Re: [PHP] Re-send (Download the whole directory using PHP)

2001-10-20 Thread Christopher William Wesley
On Sun, 21 Oct 2001, Mark Lo wrote: > I have been asking this for so many times, and I never get a reply > for this !!! Please help me. I would like to know how to download the > whole directory using PHP. Can anyone supply me some sources code for this. I see a few reasons why you w

Re: [PHP] how to move one element of an array to the end of thearray

2001-10-19 Thread Christopher William Wesley
Splice the array at the point in your result array where "No make specified" is, for one element, then append it back onto the result array. Here ... $noMake = array_splice( $resultArray, array_search( "No make specified", $resultArray ), 1); // This should be one line, sorry :) $newResults = a

Re: [PHP] InterBase transaction ...

2001-10-18 Thread Christopher William Wesley
Just use one argument or the other ... not both. ibase_commit($myTrans); OR ibase_commit($myDB); g.luck, ~Chris /"\ \ / September 11, 2001 X We Are All

Re: [PHP] Stopping the browser from continuing to load

2001-10-18 Thread Christopher William Wesley
For a process that takes a long time, I usually break the user interaction & the processing apart. For instance, when the user makes a submission from the browser interface, the PHP takes the submitted data and stores it someplace on the file system or in a database. This being a quick operation

[PHP] mssql & freetds & php4 & linux

2001-10-05 Thread Christopher William Wesley
I'm running php 4.0.6.7rc2-3 with freetds 0.52-3 support on a debian linux server. This is a winning combination to work with MSSQL2000. However I'm running into some odd behavior when performing multiple queries on the same connection (link) identifier. I create a connection to the dbms and se

Re: [PHP] problem with getting data from NNTP server

2001-09-16 Thread Christopher William Wesley
On Sun, 16 Sep 2001, Luboslav Gabal ml. wrote: > I have script for getting header of article from NNTP server using sockets: > output have look so: > From: "Antonin Mohaupt" <[EMAIL PROTECTED]> > but it is only > From: "Antonin Mohaupt" > What's the problem ? I tried higher raise length of da

Re: [PHP] CheckBoxes and Arrays

2001-09-11 Thread Christopher William Wesley
On Tue, 11 Sep 2001, Ryan Stephens wrote: > Im trying to output a list of options, each with a checkbox named "ChkBox" ... Name each checkbox "ChkBox[]" ... the brackets are the key. When the form is submitted, you'll have an array called $ChkBox that will contain the data only from the checked

Re: [PHP] Carriage return.

2001-09-05 Thread Christopher William Wesley
On Wed, 5 Sep 2001, Johan Vikerskog (EMP) wrote: > My php script is generating a file that is saved in Unix format. > I automatically get the "^M" in the end of everyline. Is there a way > of saving this without getting the "^M" in the end of each line? The ^M you see is a DOS carriage return/li

Re: [PHP] an error "Maximum execution time of 30 seconds exceededin C:\...

2001-09-04 Thread Christopher William Wesley
On Wed, 5 Sep 2001, nyon wrote: > I got an error "Maximum execution time of 30 seconds exceeded in C:\... on line 224" >while > accessing a PHP page tie to a Mysql database. > > 3. How to I set it to 60 seconds ? This is the default PHP configuration. In your php.ini file, look for this line:

Re: [PHP] PHP on Solaris / Linux with MSSQL Server 7.0 or 2000 onWin2K

2001-09-04 Thread Christopher William Wesley
On Tue, 4 Sep 2001, Boaz Yahav wrote: > I'm currently using PHP 4 on Solaris on a front end server with MySQL on > Solaris as a db server. ... > I want to work with MSSQL Server 2000 instead of MySQL, does anyone have > experience with working with such > a combination? PHP4 on Solaris as front an

RE: [PHP] Side Comment (was: Newbie Question: Converting PHP3 files to PHP4?)

2001-09-03 Thread Christopher William Wesley
On Tue, 4 Sep 2001, Jason Murray wrote: > But then, the right tools make the job easy regardless of > platform. For sure! I don't bother with all that clicking ... now you [Unix folk] don't have to either :) #!/bin/sh for PHP3FILE in `find . -type f -name "*.php3" -print` do PHP4FILE=`e

RE: [PHP] Side Comment (was: Newbie Question: Converting PHP3 filesto PHP4?)

2001-09-03 Thread Christopher William Wesley
On Tue, 4 Sep 2001, Jason Murray wrote: > Nah, in Illegal Monopoly OS, its just as easy as Apache. Rather than the web server config, I was referring to renaming all the .php3 files to have .php extensions, and combing through all the files, finding all references to .php3 files, and changing th

Re: [PHP] Want mysql dump to be mailed to me....

2001-09-03 Thread Christopher William Wesley
On Tue, 4 Sep 2001, sagar wrote: > I have a remote server running my website. I've to make the backup of the mysql db > i'm using. i can use mysqldump for this. but i'm not sure where the file will be >created > on the server and also i want to make that file to .zip and then download it to my

Re: [PHP] Newbie Question: Converting PHP3 files to PHP4?

2001-09-03 Thread Christopher William Wesley
On Mon, 3 Sep 2001, Michelle Marcicki wrote: > I am NOT running the server. I am using a local ISP (excellent guy but not > really accessible on this long weekend), so I have no control over what the OOOH ... Nasty! If the admin can't add the .php3 extension for you, then you'll be stuck renami

Re: [PHP] Newbie Question: Converting PHP3 files to PHP4?

2001-09-03 Thread Christopher William Wesley
On Mon, 3 Sep 2001, Michelle Marcicki wrote: > website. It is using PHP3 and MySQL. We had to move it to a new server, that > as it turns out only supports PHP4. I have been looking through all the FAQs, Are you running an Apache web server? If so, add this line to your httpd.conf file and r

Re: [PHP] How to index HTML fields for Javascript and PHP at sametime?

2001-09-03 Thread Christopher William Wesley
On Mon, 3 Sep 2001, Miguel wrote: > I need to refer these fields like vector in PHP and Javascript mode. > When I write then I can see values > in PHP sccript, BUT can't see values in javascript mode, thats to say > document.form.myfield[index].value doesnt work. > On the other side, when I make

Re: [PHP] Am I right or wrong?

2001-09-03 Thread Christopher William Wesley
On Tue, 4 Sep 2001, Seb Frost wrote: > I have a folder of ~80kb images that are dynamically resized using PHP into > ~1.4kb thumbnails. Now for each one the PHP server sends an HTTP request > for the 80kb image, and this is being counted against my 10,000MB. > > Should it? Am I in the right in

Re: [PHP] If PHP4 existed in 1995 we would of taken over the worldby now

2001-09-03 Thread Christopher William Wesley
On Mon, 3 Sep 2001, Bob wrote: > look. What I am looking for is the cool factor. I know technology needs time > to improve but what's going to be cool in PHP5??? It's like a race that never > finishes and who is winning? ASP or PHP? PHP5 will still run on your Free OS, your CLI OS, your Pay

Re: [PHP] replacing a carriage return with an html break

2001-09-03 Thread Christopher William Wesley
On Mon, 3 Sep 2001 [EMAIL PROTECTED] wrote: > I am filling out a form , and submitting it to the next > page which just prints what I submitted, but it doesnt print any > returns, i used when i filled out the previous Try using nl2br() in the output script (page). http://php.net/nl2br

Re: [PHP] session_encode doesn't work....

2001-09-03 Thread Christopher William Wesley
On Mon, 3 Sep 2001, Dhaval Desai wrote: > session_encode($dhaval); ... > when I check out the c:\tmp\ directory and check out > the session data I can still read the same as > dhaval=trythisout and it's not encoded...is it coz the session_encode() returns a string for you to use in a PHP script

Re: [PHP] header,session stuff works on live fails on dev...?

2001-08-31 Thread Christopher William Wesley
On Fri, 31 Aug 2001, Nic Skitt wrote: > Warning: Cannot add header information - headers already sent by (output > started at c:\apache\apache\htdocs\client-secure.php:11) in > c:\apache\apache\htdocs\client-secure.php on line 18 > > Which would indicate that the line 11 is sending output to the

RE: [PHP] fpassthru (was: fgets)

2001-08-30 Thread Christopher William Wesley
On Thu, 30 Aug 2001, Joseph Bannon wrote: > The thing I want to avoid is using my server's bandwidth. Each member gets a > profile and can have a photo referenced from their homepage. I use to allow > people to upload photos, but I'm getting close to using my 60GB bandwith > limit. The people tha

Re: [PHP] fpassthru (was: fgets)

2001-08-30 Thread Christopher William Wesley
On Thu, 30 Aug 2001, Joseph Bannon wrote: > What exactly does fpassthru do? Does it download it to my server and then > shoot it to the browser?? (http://php.net/fpassthru) For the file pointer on which it operates, it reads the file pointer until EOF and sends the data to STDOUT. It is very m

Re: [PHP] fgets

2001-08-29 Thread Christopher William Wesley
On Wed, 29 Aug 2001, Joseph Bannon wrote: > I want to use fgets to get an image off the server and then print it. Kinda > like if you call the script picture.php, an image will appear. How do I do I do this, with fopen() and fpassthru() ... $im = fopen( "myImage.jpg", "r" ); if(

Re: [PHP] Re: Need help on putting variable into

2001-08-28 Thread Christopher William Wesley
On Tue, 28 Aug 2001, Hugh Danaher wrote: > I think at one time I tried using double quotes but didn't get good results. > If you have time to answer, why the backslash and what the hell is "foo"? Using the backslash escapes the double quote ... tells php to not use the double quote (as it does t