[PHP] regex pattern for extracting URLs

2009-10-23 Thread Brad Fuller
I'm looking for a regular expression to accomplish a specific task. I'm hoping someone who's really good at regex patterns can lend a quick hand. I need a regex pattern that will grab URLs out of HTML that have a certain link text. (i.e. the word Continue) This is what I have so far but it does

Re: [PHP] regex pattern for extracting URLs

2009-10-23 Thread Brad Fuller
On Fri, Oct 23, 2009 at 1:28 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On Fri, 2009-10-23 at 13:23 -0400, Brad Fuller wrote: I'm looking for a regular expression to accomplish a specific task. I'm hoping someone who's really good at regex patterns can lend a quick hand. I need

Re: [PHP] regex pattern for extracting URLs

2009-10-23 Thread Brad Fuller
On Fri, Oct 23, 2009 at 1:48 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On Fri, 2009-10-23 at 13:45 -0400, Brad Fuller wrote: On Fri, Oct 23, 2009 at 1:28 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On Fri, 2009-10-23 at 13:23 -0400, Brad Fuller wrote: I'm looking

Re: [PHP] regex pattern for extracting URLs

2009-10-23 Thread Brad Fuller
On Fri, Oct 23, 2009 at 1:54 PM, Israel Ekpo israele...@gmail.com wrote: On Fri, Oct 23, 2009 at 1:48 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Fri, 2009-10-23 at 13:45 -0400, Brad Fuller wrote: On Fri, Oct 23, 2009 at 1:28 PM, Ashley Sheridan

RE: [PHP] Parse domain from URL

2007-06-08 Thread Brad Fuller
Tijnema wrote: On 6/7/07, Brad Fuller [EMAIL PROTECTED] wrote: Robin Vickery wrote: In that case you can't do it just by parsing alone, you need to use DNS. ?php function get_domain ($hostname) { dns_get_record($hostname, DNS_A, $authns, $addt); return $authns[0]['host

RE: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Brad Fuller
Sukhwinder Singh wrote: Stut, thank you very much for explaining things and trying to help. The applet *does* POST to PHP. However, it has the option to upload to an FTP server the choice of using HTTP, HTTPS or FTP connections for your transfer (from the website). So it seems applet

RE: [PHP] Parse domain from URL

2007-06-07 Thread Brad Fuller
Robin Vickery wrote: In that case you can't do it just by parsing alone, you need to use DNS. ?php function get_domain ($hostname) { dns_get_record($hostname, DNS_A, $authns, $addt); return $authns[0]['host']; } print get_domain(www.google.com) . \n; print get_domain(google.com) .

[PHP] Parse domain from URL

2007-06-06 Thread Brad Fuller
Hey guys, I'm faced with an interesting problem, and wondering if there's an easy solution. I need to strip out a domain name from a URL, and ignore subdomains (like www) I can use parse_url to get the hostname. And my first thought was to take the last 2 segments of the hostname to get the

RE: [PHP] Parse domain from URL

2007-06-06 Thread Brad Fuller
Daniel Brown wrote: On 6/6/07, Brad Fuller [EMAIL PROTECTED] wrote: Hey guys, I'm faced with an interesting problem, and wondering if there's an easy solution. I need to strip out a domain name from a URL, and ignore subdomains (like www) I can use parse_url to get the hostname

RE: [PHP] escapeshellarg

2007-05-14 Thread Brad Fuller
Mohamed CHAARI wrote: Hi all, I have to execute an external command, with an argument (filename or directory name) given by user input (via a form), ie something like this: exec('ls $_POST[...]') what do you think about using escapeshellarg() function in this case ? can I rely on it

RE: [PHP] printing out this nested array

2007-05-14 Thread Brad Fuller
Don Don wrote: I am having a bit of a confusion printing the values of an array i have. When i print_r this array it contains the following: Array ( [ValueA] = ValueA [ValueB] = valueB [TestValue] = TestValue [Errors] = Array ( [0] = Array ( [ErrorId] = AD27JH [ErrorMsg] = OK ) ) ) I can

RE: [PHP] sorting via PHP or MySQL?

2007-05-10 Thread Brad Fuller
James Tu wrote: (I've cross posted at the MySQL list as well) Here's an example with a simple table: describe collection; +--+-+--+- +-++ Field| Type| Null | Key | Default

RE: [PHP] sqlite AND OR query ?

2007-05-09 Thread Brad Fuller
[EMAIL PROTECTED] wrote: Hello, I want to select two dates one being todays date and the other being -00-00 which just a date in the database when no proper date has been entered. Ive tried this but it does not work... $today = date('Y-m-d'); $result = sqlite_query($db, SELECT *

RE: [PHP] Disable Soap Client and Soap Server in php5

2007-05-09 Thread Brad Fuller
Don Don wrote: How can i disable soap client and server for php5, reason is that i've got NuSOAP (which i must use) and its classes clash with that of PHP5. My php configuration (when using phpinfo() displays soap client and server enabled for php5. I need to disable if ..amd looking into

RE: [PHP] cURL: multipart/form-data POST request with empty file part

2007-05-04 Thread Brad Fuller
Emmanuel Raulo-Kumagai wrote: Sent: Friday, May 04, 2007 8:44 AM To: php-general@lists.php.net Subject: [PHP] cURL: multipart/form-data POST request with empty file part Hello I'm writting a client in PHP for some CMS. I need to send an HTTP POST request with a multipart/form-data

RE: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Brad Fuller
Rahul S. Johari wrote: Ave, Here¹s the thing, I¹ve got an Array which has it¹s own set of Keys = Values. I¹m using foreach() to read the Keys = Values like this: function pr1($var) { foreach ($var as $k = $v) { echo ³$k = $v²; } I need to

RE: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Brad Fuller
Jim Moseby wrote: $sql = INSERT INTO table (f1, f2, f3, . implode(,, array_keys($pr1)) .) VALUES ('abc', '123', '456', . implode(,, array_values($pr1)) .); HTH, Brad Might not work if the array values need to be enclosed in quotes. I would build the query string in a

RE: [PHP] MySQL change-tracking

2007-05-02 Thread Brad Fuller
Richard Lynch wrote: I have this simple database and I'm going to have a handful of people editing it... I'd like to track each and every edit with username, and, ideally, provide myself an easy Undo if I decide [bleep] is an idiot and shouldn't have done that. Now, I'm not real

RE: [PHP] exec() and redirect output of program

2007-05-01 Thread Brad Fuller
Daniel Brown wrote: This way just lets it do it's own thing, with no output, and PHP won't hang. It'll continue from the CLI after the HTTP session is over. ? exec('php test.php /dev/null 21 '); ? On 5/1/07, Brad Fuller [EMAIL PROTECTED] wrote: I found this on PHP.net

RE: [PHP] exec() and redirect output of program

2007-05-01 Thread Brad Fuller
Brad Fuller wrote: Daniel Brown wrote: This way just lets it do it's own thing, with no output, and PHP won't hang. It'll continue from the CLI after the HTTP session is over. ? exec('php test.php /dev/null 21 '); ? On 5/1/07, Brad Fuller [EMAIL PROTECTED] wrote: I found

RE: [PHP] exec() and redirect output of program [SOLVED]

2007-05-01 Thread Brad Fuller
Tijnema ! wrote: On 5/1/07, Brad Fuller [EMAIL PROTECTED] wrote: Brad Fuller wrote: Daniel Brown wrote: This way just lets it do it's own thing, with no output, and PHP won't hang. It'll continue from the CLI after the HTTP session is over. ? exec('php test.php /dev/null 21

RE: [PHP] IP Geolocation Scripts

2007-03-29 Thread Brad Fuller
-Original Message- From: Daniel Brown [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2007 12:08 PM To: php-general@lists.php.net Subject: [PHP] IP Geolocation Scripts Does anyone have any recommendations for existing open source PHP scripts that use IP Geolocation? I was

RE: [PHP] link on user uploaded pic

2007-03-29 Thread Brad Fuller
-Original Message- From: Tana [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2007 1:02 PM To: php-general@lists.php.net Subject: [PHP] link on user uploaded pic Hi which is the best way to change this code img src=images/user_upload/akarmi.jpg to a

RE: [PHP] link on user uploaded pic

2007-03-29 Thread Brad Fuller
-Original Message- From: Brad Fuller [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2007 1:24 PM To: 'Tana'; php-general@lists.php.net Subject: RE: [PHP] link on user uploaded pic -Original Message- From: Tana [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29

RE: [PHP] Date/time format?

2007-03-28 Thread Brad Fuller
Jason wrote: Hi Everyone, First off, I'm using PHP 5.2.0 and apache 1.3.33 I am trying to figure out what format a string is in in a database. It's a timecard system that I have found on-line and I am attempting to figure out how to write a script that would give me everyones timecard

RE: [PHP] My own captcha from 2 years ago......

2007-03-26 Thread Brad Fuller
-Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Monday, March 26, 2007 8:49 AM To: php-general@lists.php.net Subject: RE: [PHP] My own captcha from 2 years ago.. At 10:02 PM -0400 3/25/07, Jake McHenry wrote: Like I said... Even if they have sound turned

RE: [PHP] My own captcha from 2 years ago......

2007-03-26 Thread Brad Fuller
From: tedd [mailto:[EMAIL PROTECTED] At 10:59 AM -0400 3/26/07, Brad Fuller wrote: echo 'img src=image.php'; This does not run or call image.php. This line of code sends this output to the browser. Brad: Yes, but the browser runs the code by trying to load an image. ... My

RE: [PHP] Add New Records Only!

2007-03-23 Thread Brad Fuller
Rahul wrote: Ave, It's definitely not live data, so that is not a problem at all. But I'm not sure I understand your method very well. I do understand getting data from both the existing DBF and the multiple mySQL tables into a temporary mySQL table. But if I do go ahead and do that, I

RE: [PHP] Amazon AWS + SimpleXML

2007-03-23 Thread Brad Fuller
-Original Message- From: Myron Turner [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 20, 2007 10:24 AM To: Brad Fuller Cc: php-general@lists.php.net Subject: Re: [PHP] Amazon AWS + SimpleXML Brad Fuller wrote: Hey guys, I'm having trouble trying to parse XML results from

RE: [PHP] Running PHP on a windows server-your views

2007-03-19 Thread Brad Fuller
Im assuming it will be running IIS. (shudder) The site is very important and any issues will hamper the functionality and accessibility of the site. LOL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Can't get PHP errors to display or log consistently

2007-03-19 Thread Brad Fuller
-Original Message- From: Chris W. Parker [mailto:[EMAIL PROTECTED] Sent: Monday, March 19, 2007 1:57 PM Cc: php-general@lists.php.net Subject: RE: [PHP] Can't get PHP errors to display or log consistently On Friday, March 16, 2007 4:04 PM Robert Cummings mailto:[EMAIL PROTECTED]

[PHP] Amazon AWS + SimpleXML

2007-03-19 Thread Brad Fuller
Hey guys, I'm having trouble trying to parse XML results from an Alexa Web information service from amazon.com, using SimpleXML. Here is an example response: ?xml version=1.0? aws:TrafficHistoryResponse xmlns:aws=http://alexa.amazonaws.com/doc/2005-10-05/;aws:Response

RE: [PHP] $_POST array order

2007-03-14 Thread Brad Fuller
-Original Message- From: Tim [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 12:58 PM To: 'PHP' Subject: [PHP] $_POST array order Hi, Quick question regarding $_POST array element order, first the situation: I am submitting a form with x first fields and the post

RE: [PHP] Extract url from string

2007-03-12 Thread Brad Fuller
-Original Message- From: Tijnema ! [mailto:[EMAIL PROTECTED] Sent: Monday, March 12, 2007 1:10 PM To: Brad Fuller Cc: php-general@lists.php.net Subject: Re: [PHP] Extract url from string On 3/12/07, Brad Fuller [EMAIL PROTECTED] wrote: Hey guys, I've been banging my head

RE: [PHP] php and javascript error

2007-03-07 Thread Brad Fuller
-Original Message- From: Ed Curtis [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 11:47 AM To: php-general@lists.php.net Subject: Re: [PHP] php and javascript error a href=# onclick=javascript:window.open('web_forward.php?address=? echo $web_url; ?agent=? echo $agent;

RE: [PHP] php and javascript error

2007-03-07 Thread Brad Fuller
-Original Message- From: Brad Fuller [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 12:02 PM To: 'Ed Curtis'; 'php-general@lists.php.net' Subject: RE: [PHP] php and javascript error -Original Message- From: Ed Curtis [mailto:[EMAIL PROTECTED] Sent: Wednesday

RE: [PHP] Launch a seperate process

2007-03-06 Thread Brad Fuller
tyvm, I will check it out right away! B -Original Message- From: fedt [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 06, 2007 5:17 PM To: Brad Fuller Cc: php-general@lists.php.net Subject: Re: [PHP] Launch a seperate process pcntl_ fork() and pcntl_ wait(), yo On 3/6/07

RE: [PHP] Getting Similar rows from db

2007-02-23 Thread Brad Fuller
-Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Friday, February 23, 2007 1:51 PM To: Wikus Möller; php-general@lists.php.net Subject: RE: [PHP] Getting Similar rows from db [snip] I need a script that selects all similar rows from a database. Like only the

RE: [PHP] Understanding session variables with input field and register_global

2007-02-20 Thread Brad Fuller
-Original Message- From: Otto Wyss [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 20, 2007 11:32 AM To: php-general@lists.php.net Subject: [PHP] Understanding session variables with input field and register_global I've an input field in a form input name=username type=text

RE: [PHP] Month

2007-02-19 Thread Brad Fuller
-Original Message- From: Dan Shirah [mailto:[EMAIL PROTECTED] Sent: Monday, February 19, 2007 1:27 PM To: php-general Subject: [PHP] Month Greetings, I have the following code which populates a dropdown box so a user can select a month. They see the month name and the SELECTED

RE: [PHP] Month

2007-02-19 Thread Brad Fuller
-Original Message- From: Dan Shirah [mailto:[EMAIL PROTECTED] Sent: Monday, February 19, 2007 1:44 PM To: Jay Blanchard Cc: php-general Subject: Re: [PHP] Month Okay, so sprintf(%02s, $m) means that the value of $m would be checked for the amount of digits returned. If less

RE: [PHP] Month

2007-02-19 Thread Brad Fuller
-Original Message- From: Dan Shirah [mailto:[EMAIL PROTECTED] Sent: Monday, February 19, 2007 2:08 PM To: Brad Fuller Cc: Jay Blanchard; php-general Subject: Re: [PHP] Month Okay, when I try the sprintf I get the following error when I try to save my form Incorrect syntax

RE: [PHP] WHERE problem

2007-02-19 Thread Brad Fuller
-Original Message- From: Mike Shanley [mailto:[EMAIL PROTECTED] Sent: Monday, February 19, 2007 3:50 PM Cc: php-general@lists.php.net Subject: Re: [PHP] WHERE problem Without the single-quotes, I still get nothing returned. Bruce Cowin wrote: Are you getting an error or just

RE: [PHP]Password and FTP Folder

2007-02-15 Thread Brad Fuller
-Original Message- From: Helder Lopes [mailto:[EMAIL PROTECTED] Sent: Thursday, February 15, 2007 5:32 AM To: php-general@lists.php.net Subject: [PHP]Password and FTP Folder Hi people hi have a problem i need a script for make a ftp folder that have a password for enter

RE: [PHP] Retrieve value of newly inserted row.

2007-02-15 Thread Brad Fuller
Complete statement. Any ideas? On 2/14/07, Jim Lucas [EMAIL PROTECTED] wrote: Brad Fuller wrote: From looking on the web (MSDN) I found the @@identity and the explanation of what it is, but MS's example is horrible and does not show a good context for using

RE: [PHP] plugging gmmktime value into gmdate yields incorrect date

2007-02-15 Thread Brad Fuller
-Original Message- From: Terra Frost [mailto:[EMAIL PROTECTED] Sent: Thursday, February 15, 2007 3:20 PM To: Peter Lauri Cc: php-general@lists.php.net Subject: Re: [PHP] plugging gmmktime value into gmdate yields incorrect date date('Z') on the server producing the incorrect

RE: [PHP] Session Problem

2007-02-15 Thread Brad Fuller
-Original Message- From: LoneWolf [mailto:[EMAIL PROTECTED] Sent: Thursday, February 15, 2007 4:35 PM To: php-general@lists.php.net Subject: [PHP] Session Problem I am having a problem where it appears that the session is not being saved properly. While on a page, I can start a

RE: [PHP] plugging gmmktime value into gmdate yields incorrect date

2007-02-15 Thread Brad Fuller
-Original Message- From: Brad Fuller [mailto:[EMAIL PROTECTED] Sent: Thursday, February 15, 2007 3:48 PM To: 'Terra Frost'; 'Peter Lauri' Cc: php-general@lists.php.net Subject: RE: [PHP] plugging gmmktime value into gmdate yields incorrect date -Original Message- From

RE: [PHP] Banner rotation with links

2007-02-14 Thread Brad Fuller
-Original Message- From: Németh Zoltán [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 14, 2007 11:37 AM To: Chris Carter Cc: php-general@lists.php.net Subject: Re: [PHP] Banner rotation with links 2007. 02. 14, szerda keltezéssel 08.29-kor Chris Carter ezt írta: How can I

RE: [PHP] Retrieve value of newly inserted row.

2007-02-14 Thread Brad Fuller
From looking on the web (MSDN) I found the @@identity and the explanation of what it is, but MS's example is horrible and does not show a good context for using this function. Could you elaborate more on its use? $q = mssql_query(INSERT INTO TableName(...) VALUES(...) SELECT

RE: [PHP] Getting mysql_query results into an array

2007-02-14 Thread Brad Fuller
How about scenario #3: I wish to output my data in (for example) three columns, as a phone book does. To make the example simple, assume 15 data points. I wish the output to look like 1 611 2 712 3 813 4 914 5 10

RE: [PHP] Redisplay file name on failed upload

2007-02-13 Thread Brad Fuller
Is it possible to assign form[ upldFile ] = C:\somepath\somefile or form[ upldFile ] = $_FILES['userfile']['name'] The value attribute of the input type=file... tag is not able to be altered or pre-populated for obvious security reasons. The script which does the validation is the same one

RE: [PHP] what do i need to disable

2007-02-08 Thread Brad Fuller
-Original Message- From: Don [mailto:[EMAIL PROTECTED] Sent: Thursday, February 08, 2007 3:28 PM To: php-general@lists.php.net Subject: RE: [PHP] what do i need to disable I asked this question awhile ago and never really visited the issue till now. The response I got showed me

RE: [PHP] base64-encoding in cookies?

2007-02-07 Thread Brad Fuller
-Original Message- From: Fletcher Mattox [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 07, 2007 2:49 PM To: php-general@lists.php.net Subject: Re: [PHP] base64-encoding in cookies? I wrote: A campus web server (not under my control) returns an authentication string in a

RE: [PHP] Javascript and $_POST

2007-02-07 Thread Brad Fuller
-Original Message- From: Dan Shirah [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 07, 2007 4:35 PM To: php-general Subject: [PHP] Javascript and $_POST I have a form that uses Javascript to validate form field entries, and if they are incorrect it returns an error to the

RE: [PHP] Conditional Select

2007-01-19 Thread Brad Fuller
-Original Message- From: Dan Shirah [mailto:[EMAIL PROTECTED] Sent: Friday, January 19, 2007 3:10 PM To: php-general@lists.php.net Subject: [PHP] Conditional Select I have a page that shows all outstanding tickets, what I'm trying to have it do is let users search by several

RE: [PHP] dynamic lists

2007-01-17 Thread Brad Fuller
-Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 17, 2007 4:05 PM To: Don; php-general@lists.php.net Subject: RE: [PHP] dynamic lists [snip] By dynamic drop list I mean the type where the options contained in the subsequent list depend

RE: [PHP] what mail program I'm using?

2007-01-12 Thread Brad Fuller
[EMAIL PROTECTED] wrote: hi, a moth ago we (company I work for) moved to new hosting company. we have dedicated sles10/php5/mysq5/apache2 based server. before, sending confirmation emails to clients using mail() functin was working fine. now, many of emails we send don't reach to receiver.

RE: [PHP] storing date in datetime column

2007-01-09 Thread Brad Fuller
[EMAIL PROTECTED] wrote: hi, $date = January 8 2007 11:23 pm; and have to store it on db in datetime column as -mm-dd HH:ii:ss. Is there any function that will translate $date in format I need to store it in DB? Right now I was thinking to do like this: $date_new = explode(' ',

RE: [PHP] Clearing POST variable on page refresh

2006-12-18 Thread Brad Fuller
-Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: Monday, December 18, 2006 3:39 AM To: Beauford Cc: PHP Subject: Re: [PHP] Clearing POST variable on page refresh Beauford wrote: Hi, I have a page with a form on it which posts to itself. The problem is

RE: [PHP] php redirection..

2006-12-14 Thread Brad Fuller
Better to do this on the client side with JS html head titleRedirect Test/title script language=JavaScript function redirect() { location.href='http://www.google.com/'; } /script /head body onLoad=setTimeout('redirect()', 3000); pYou will be redirected in 3 seconds.../p /body /html

RE: [PHP] php redirection..

2006-12-14 Thread Brad Fuller
-Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Thursday, December 14, 2006 12:08 PM To: 'Brad Fuller'; 'PHP General List' Subject: RE: [PHP] php redirection.. all these are solid posts... however, the original posting, was not to do a redirect on the page being

RE: [PHP] Having problem sending XML over HTTP

2006-12-14 Thread Brad Fuller
-Original Message- From: Nauman Akbar [mailto:[EMAIL PROTECTED] On Behalf Of Nauman Akbar Sent: Thursday, December 14, 2006 3:32 PM To: php-general@lists.php.net Subject: [PHP] Having problem sending XML over HTTP Hello! I picked up an example from Curl section on php.net.

RE: [PHP] Need help with RegEx

2006-12-11 Thread Brad Fuller
The example provided didn't work for me. It gave me the same string without anything modified. I am also looking for this solution to strip out text from some XML response I get from posting data to a remote server. I can do it using substring functions but I'd like something more compact and

RE: [PHP] Need help with RegEx

2006-12-11 Thread Brad Fuller
I got it. ?php $input = xmlJunkstatusHello, World!/status/xmlJunk; preg_match(#status(.*?)/status#s, $input, $matches); echo $matches[1]; ? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, December 11, 2006 10:59 AM To:

RE: [PHP] flash/php file uploader

2006-12-11 Thread Brad Fuller
-Original Message- Hi Sorry if this is considered off topic, but do you know of any code examples/libs with a flash/php file uploader with progress bar? I've googled for a while but the scripts I find won't work. I'm using Firefox 2 and Flash player 9 on an intel Mac if that

RE: [PHP] PHP5 Inheritance/method override problem

2006-12-06 Thread Brad Fuller
-Original Message- From: Richard Morris [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 06, 2006 10:22 AM To: php-general@lists.php.net Subject: [PHP] PHP5 Inheritance/method override problem Hi, I came across this problem and I was wondering if someone might be able to

RE: [PHP] Ensuring that variable contains a number

2006-12-06 Thread Brad Fuller
How can I ensure that a variable contains a postive integer number? I'm currently using this code: $number=(1-$number); $number=(1-$number); if ( $number1 ) { $number=1; } But I'm sure that there is a better way. What would that be? this will check that $input is a positive

RE: [PHP] Maybe an HTML prob?

2006-11-29 Thread Brad Fuller
if ($Permission = Yes) should be if ($Permission == Yes) It's one of those elusive little oversights we've all come across in our time. :) -B -Original Message- From: Frank Reichenbacher, Bio-Concepts, Inc. [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 29, 2006 1:53 PM To:

RE: [PHP] backing up a database

2006-11-28 Thread Brad Fuller
-Original Message- From: James Tu [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 1:21 PM To: PHP General List Subject: Re: [PHP] backing up a database Does one need to lock(?) MySQL before running mysqldump? Or will the mysqldump command wait for any pending operations

RE: [PHP] backing up a database

2006-11-22 Thread Brad Fuller
Here is a script that I found that has been working well for me. I set up a cron job to run this file every night just after midnight. It e-mails a gzipped sql dump file as an attachment to the specified e-mail address. Right now the database this is backing up is not very big. I'm not sure

RE: [PHP] Programmatic POST

2006-11-22 Thread Brad Fuller
-Original Message- From: Gabe [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 22, 2006 3:08 PM To: php-general@lists.php.net Subject: [PHP] Programmatic POST I'm looking to write a function that will receive the contents of a web form, do some data manipulation, then pass on

RE: [PHP] odd behavior of stripos() with === operator *LAST POST*

2006-11-17 Thread Brad Fuller
Logic dictates that if something evaluates to NOT FALSE it must be TRUE. In a situation where you are only dealing with boolean values, that above statement would be correct. In this case it is not. int stripos ( string haystack, string needle [, int offset] ) What you are missing

RE: [PHP] file_get_contents

2006-11-16 Thread Brad Fuller
Use curl or fopen() to make a request to that PHP page, instead of reading in the actual contents of the file. Example: ?php $url = 'http://blabla.com/player.php'; $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch,

RE: [PHP] file_get_contents

2006-11-16 Thread Brad Fuller
, 2006 11:12 AM To: Brad Fuller Cc: php-general@lists.php.net Subject: Re: [PHP] file_get_contents Brad Fuller wrote: Use curl or fopen() to make a request to that PHP page, instead of reading in the actual contents of the file. heh Brad wtf do you think thw following line does

RE: [PHP] Excel problem

2006-11-16 Thread Brad Fuller
?php $query = SELECT ; $result = mysql_query($query); header (Content-Type: application/octet-stream); header (Content-Disposition: attachment; filename=whatever.xls); echo Field1\tField2\r\n; // Column names while($row = mysql_fetch_array($result)) { echo $row['field1'] . \t .

RE: [PHP] Checking file existence

2006-11-15 Thread Brad Fuller
UntestedCode $img_array = array(); $i = 0; while(count($img_array) 5) { $hhmm = date(Hi, strtotime(-$i minutes)); $filename = file.$hhmm.jpg; if(file_exists(/path/to/$filename)) { $img_array[] = $filename; } $i++; }

RE: [PHP] Checking file existence

2006-11-15 Thread Brad Fuller
(Hi, strtotime(-$i minutes)); $filename = file.$hhmm.jpg; if(file_exists(/path/to/$year/$month/$day/$hour/$filename)) { $img_array[] = $filename; } $i++; } print_r($img_array); /MoreUntestedCode -Original Message- From: Brad Fuller

RE: [PHP] date() function

2006-11-14 Thread Brad Fuller
$prevminute = sprintf('%02s', date(i)-1); -Original Message- From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 1:17 PM To: PHP General List Subject: [PHP] date() function I noticed that if I do something like this: $prevminute =

RE: [PHP] path

2006-11-10 Thread Brad Fuller
-Original Message- From: Alain Roger [mailto:[EMAIL PROTECTED] Sent: Friday, November 10, 2006 1:48 PM To: PHP General List Subject: [PHP] path Hi, How can i get the path in which a PHP file is running ? for example, user clicking on a link opened page action.php file. this

RE: [PHP] Delivery failed

2006-11-08 Thread Brad Fuller
Did everyone on the list get this message? Dear user php-general@lists.php.net, We have found that your e-mail account was used to send a large amount of junk email messages during the last week. Obviously, your computer was infected by a recent virus and now contains a hidden proxy

RE: [PHP] Spam using email on website

2006-11-07 Thread Brad Fuller
-Original Message- From: Pieter du Toit [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 07, 2006 1:43 AM To: php-general@lists.php.net Subject: [PHP] Spam using email on website Hi guys I have a website that is being crawled or whatever and i have a submission form for an

RE: [PHP] Spam using email on website

2006-11-07 Thread Brad Fuller
-Original Message- From: Pieter du Toit [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 07, 2006 1:43 AM To: php-general@lists.php.net Subject: [PHP] Spam using email on website Hi guys I have a website that is being crawled or whatever and i have a submission form for an

RE: [PHP] PHP Template Trouble

2006-10-26 Thread Brad Fuller
Hi, I am trying to have 1 template site and have an unlimited number of websites using this template site to call there own information. The sites are exactly the same except for the database, each of the sites also needs there own URL, for example one of these urls may be

RE: [PHP] PHP Template Trouble

2006-10-26 Thread Brad Fuller
that would need to be posted through correctly, even if using frames on www.example1.com (using them to load www.solution.com) $_SERVER[HTTP_HOST] would still equal www.example1.com Thanks Kevin Brad Fuller wrote: Hi, I am trying to have 1 template site and have an unlimited number of websites

RE: [PHP] PHP Template Trouble

2006-10-26 Thread Brad Fuller
AM To: php-general@lists.php.net Subject: Re: [PHP] PHP Template Trouble Yes all the sites are located on a Windows 2003 Dedicated Server. Kevin Brad Fuller wrote: Kevin, Are all these sites hosted on the same box? -Brad -Original Message- From: Kevin [mailto:[EMAIL PROTECTED

RE: [PHP] PHP Template Trouble

2006-10-26 Thread Brad Fuller
. Kevin Brad Fuller wrote: Cool, then what you want to do is make all the domains point to the same directory, have your files index.php and config.php in that directory and it should work like magic. Then you end up with one copy of the files and how ever many sites you need

RE: [PHP] counting records in db

2006-10-26 Thread Brad Fuller
Would it be ok to use the same code to check if customer is loged in? $query = mysql_query( SELECT COUNT(Username) as NoOfRecords FROM customers WHERE Username = '$Username' AND Password = '$Password'); if (mysql_result($query, 0) == 0) {

RE: [PHP] Disable all caching

2006-10-10 Thread Brad Fuller
I have a php (ver 4.x) script that is being cached. I have placed: META HTTP-EQUIV=CACHE-CONTROL CONTENT=NO-CACHE but the page is still being cached. I'm not sure if its apache or the php. How can I disable all caching? is there something I can set in php.ini? (Mac OS X Server)

RE: [PHP] changing the global variables (_SERVER[HTTP_USER_AGENT])

2006-10-03 Thread Brad Fuller
You can use cURL to send a request and you can set the user agent to whatever you want. http://www.php.net/curl See function: curl_setopt and option: CURLOPT_USERAGENT -Brad -Original Message- From: Balaji A [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 03, 2006 2:05 PM To: [EMAIL

RE: [PHP] Strange error in PHP/MySQL

2006-10-02 Thread Brad Fuller
if (mysql_query($sqlInsertUser, $conn)) $messagesqlInsertUser = 'Success...'; else $messagesqlInsertUser = 'Error: ' . mysql_error(); $result = mysql_query($sqlInsertUser); I see this being executed twice. - mysql_query($sqlInsertUser); I believe that is your problem. Change the

RE: [PHP] Session issues

2006-09-15 Thread Brad Fuller
Is this only happening when the user clicks the back button in the browser? I recently had a similar problem with IE caching pages even when the header is set to (supposedly) prevent caching. Apparently there is a bug with IE which requires a specific workaround. The fields are pre-filled with

RE: [PHP] readdir

2006-09-15 Thread Brad Fuller
According to php.net, the readdir() function simply reads the contents of the directory in the order which they are stored by the filesystem. One way to force the order would be to loop through the contents of the directory and store the directory names into an array, and use the functions

RE: [PHP] security include from remote server

2006-09-14 Thread Brad Fuller
Miguel - If my solution is not viable, is there any other way of hosting my files someplace else, but still access the local database? Yes. Your remotely hosted code would call the database on your local server. Something like: ? $link = mysql_connect(foo.com, bar, PASSWORD); ? You