Re: [PHP] checking if URL's exist

2008-07-09 Thread Daniel Brown
On Wed, Jul 9, 2008 at 6:18 AM, <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a Directory table with hundreds of URL's to sites > and want to check periodically if all the URL's still exist. > Does anyone know of a utility to check this ? > Or a pointer to a piece of code ... > > TIA, Cor > -

Re: [PHP] checking if URL's exist

2008-07-09 Thread Maxim Antonov
You need $s= fsockopen('host.com',80); fwrite($s,"GET ".$URL." HTTP/1.1 \r\n"); fwrite($s,"Host: host.com \r\n\r\n"); and you must read first string - if url exists string begining with 200 or 304 if url not exists string begin - is 404 Børge Holen пишет: On Wednesday 09 July 2008 12:18:

Re: [PHP] checking if URL's exist

2008-07-09 Thread Børge Holen
On Wednesday 09 July 2008 12:18:27 [EMAIL PROTECTED] wrote: > Hi All, > > I have a Directory table with hundreds of URL's to sites > and want to check periodically if all the URL's still exist. > Does anyone know of a utility to check this ? > Or a pointer to a piece of code ... > > TIA, Cor ping

[PHP] checking if URL's exist

2008-07-09 Thread cr.vegelin
Hi All, I have a Directory table with hundreds of URL's to sites and want to check periodically if all the URL's still exist. Does anyone know of a utility to check this ? Or a pointer to a piece of code ... TIA, Cor

Re: [PHP] checking if extension loaded

2007-07-22 Thread Vanessa Vega
The GD library was installed by the administrator, so nowthe function already works.:-) ""Richard Lynch"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, July 18, 2007 4:37 am, Vanessa Vega wrote: >> I have a function that creates a thumb file(thumbnail) and and a

Re: [PHP] checking if extension loaded

2007-07-20 Thread Richard Lynch
On Wed, July 18, 2007 4:37 am, Vanessa Vega wrote: > I have a function that creates a thumb file(thumbnail) and and an > image > file(preview pic) in php. It starts with: > function ($picFile, $thumbFile, $imageFile) { > if (extension_loaded('gd') { > ..codes to create thumb and previe

[PHP] checking if extension loaded

2007-07-18 Thread Vanessa Vega
I have a function that creates a thumb file(thumbnail) and and an image file(preview pic) in php. It starts with: function ($picFile, $thumbFile, $imageFile) { if (extension_loaded('gd') { ..codes to create thumb and preview pic... else ..creating images failed } everytime i

Re: [PHP] checking if any values in one array are in another

2006-06-12 Thread Jochem Maas
Jay Blanchard wrote: > [snip] > Is there a single php function that will tell me if any values in one > array > are in another without looping through one of the arrays and doing > in_array? > [/snip] > > You have read http://www.php.net/array right? rtm? thats for wimps ;-) > http://www.php.ne

RE: [PHP] checking if any values in one array are in another

2006-06-12 Thread Jay Blanchard
[snip] Is there a single php function that will tell me if any values in one array are in another without looping through one of the arrays and doing in_array? [/snip] You have read http://www.php.net/array right? http://www.php.net/manual/en/function.array-intersect-assoc.php -- PHP General Mai

[PHP] checking if any values in one array are in another

2006-06-12 Thread blackwater dev
Is there a single php function that will tell me if any values in one array are in another without looping through one of the arrays and doing in_array? Thanks!

Re: [PHP] Checking if

2005-01-12 Thread Richard Lynch
Bruno B B Magalhães wrote: > how to determine if the last char of a string is a '/'... > > The problem, a webpage can be accessed by www.domain.com/page.php or > www.domain.com/page.php/ In addition to the two fine answers posted so far: if ($string[strlen($string)-1] == '/'){ echo "It ends in

Re: [PHP] Checking if

2005-01-12 Thread Bruno B B Magalhães
Richard, my solution right know is: if(substr($url,-1) != '/') { $url = $url.'/'; } Simple and fast... :) Regards, Bruno B B Magalhaes On Jan 12, 2005, at 3:37 PM, Richard Lynch wrote: Bruno B B Magalhães wrote: how to determine if the last char of a string is a '/'... The problem, a webpag

Re: [PHP] Checking if

2005-01-12 Thread Morten Rønseth
Bruno B B Magalhães wrote: Richard, my solution right know is: if(substr($url,-1) != '/') { $url = $url.'/'; } Simple and fast... :) $url = preg_replace ("|^(.*)/?$|", "\\1/", $url); Regards, Bruno B B Magalhaes On Jan 12, 2005, at 3:37 PM, Richard Lynch wrote: Bruno B B Magalhães wrote: how

Re: [PHP] Checking if

2005-01-11 Thread John Nichel
Bruno B B Magalhães wrote: Hi people, how to determine if the last char of a string is a '/'... The problem, a webpage can be accessed by www.domain.com/page.php or www.domain.com/page.php/ preg_match ( "/\/$/", $string ); -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] --

[PHP] Checking if

2005-01-11 Thread Bruno B B Magalhães
Hi people, how to determine if the last char of a string is a '/'... The problem, a webpage can be accessed by www.domain.com/page.php or www.domain.com/page.php/ Regards, Bruno B B Magalhães -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Checking if a website is up?

2004-03-30 Thread Curt Zirzow
* Thus wrote Henry Grech-Cini ([EMAIL PROTECTED]): > Hi All, > > I am trying to check if a website is up (reachable) and I have used the > standard code below: > >else >{ >fwrite ($socket, "HEAD ".$documentpath." HTTP/1.0\r\nHost: > $host\r\n\r\n"); >$http_

Re: [PHP] Checking if a website is up?

2004-03-30 Thread Chris Hayes
I am trying to check if a website is up (reachable) and I have used the standard code below: [...] $socket = @fsockopen( $host, $port, $errno, $errstr, 30 ); if (!$socket) fwrite ($socket, "HEAD ".$documentpath." HTTP/1.0\r\nHost: $host\r\n\r\n"); $http_response

[PHP] Checking if a website is up?

2004-03-30 Thread Henry Grech-Cini
Hi All, I am trying to check if a website is up (reachable) and I have used the standard code below: Unfortunately this works for most sites but Microsoft doesn't work most of the time even thought the site is definiately up! (Occassionally it does say it is reachable but only occassionaly and th

Re: [PHP] Checking if database has been setup

2004-02-07 Thread Don Read
On 07-Feb-2004 Ryan A wrote: > but how do i check if the database/tables have > been setup? > SHOW DATABASES LIKE 'mydb'; SHOW TABLES FROM mydb LIKE 'mytable'; Check if a table exists: SELECT 1 FROM mydb.mytable LIMIT 1; Regards, -- Don Read [EMAIL PR

Re: [PHP] Checking if database has been setup

2004-02-06 Thread Joshua D. Drake
> if its setup or not. I can handle the setup in steps (the "setup wizard") > but how do i check if the database/tables have > been setup? > It may be helpful to know which database as each database has there own way... > (and my apoligies for using "setup" so many times :-p ) > > Any advise,

[PHP] Checking if database has been setup

2004-02-06 Thread Ryan A
Hey, Sometime back i was checking out a script and it had a very useful little bit, in the scripts control panel there was a text link that said "click here to see if your database has been setup" when you click it, it will tell you if its setup or lauches the setup script to help you set it up. I

Re: [PHP] Checking if a host is online

2003-11-29 Thread [EMAIL PROTECTED]
This may be OT but have you looked at Netsaint (http://www.netsaint.org/ and http://www.netsaint.org/indexold.php), now called Nagios (http://www.nagios.org/) by the looks of it. Note: It's not written in PHP from what I remember. You may be able to get some ideas from it or even use it. I've use

Re: [PHP] Checking if a host is online

2003-11-29 Thread Jason Giangrande
On Sat, 2003-11-29 at 12:32, David T-G wrote: > 3) At the very least, cut your ping timeout down to the smallest > acceptable; in general, a full second is plenty of time to get nearly > anywhere on your continent (ain't it great? :-) and so your intranet > should be more than happy with that allow

Re: [PHP] Checking if a host is online

2003-11-29 Thread Duncan
Jason Giangrande said: > command (ping -c 1 $host), and while I could get that to work, since it > returns non-zero status if the host can not be contacted, it takes quite > a while to execute for even a few hosts at once. fping may help. Running a background job that just monitors ping status a

Re: [PHP] Checking if a host is online

2003-11-29 Thread David T-G
Jason -- ...and then Jason Giangrande said... % % I'm creating an application for an Intranet that, among other things, is % supposed to check to see if particular hosts are online, and if so, what % their IP address is. Anyone know how I can accomplish this? I tried ... % a while to execute fo

Re: [PHP] Checking if a host is online

2003-11-29 Thread Adam Maas
Adam Maas wrote: Jason Giangrande wrote: I'm creating an application for an Intranet that, among other things, is supposed to check to see if particular hosts are online, and if so, what their IP address is. Anyone know how I can accomplish this? I tried using exec("host $host"); (where $host i

Re: [PHP] Checking if a host is online

2003-11-29 Thread Jason Giangrande
On Sat, 2003-11-29 at 12:20, Adam Maas wrote: > why not try: > > passthru("ping $host"); > > Adam That still takes a little while to execute on multiple hosts, Plus I need to modify the output of the command to print just the IP address and discard the rest of the output. -- Jason Giangrande

Re: [PHP] Checking if a host is online

2003-11-29 Thread Adam Maas
Jason Giangrande wrote: I'm creating an application for an Intranet that, among other things, is supposed to check to see if particular hosts are online, and if so, what their IP address is. Anyone know how I can accomplish this? I tried using exec("host $host"); (where $host is the hostname) and

[PHP] Checking if a host is online

2003-11-29 Thread Jason Giangrande
I'm creating an application for an Intranet that, among other things, is supposed to check to see if particular hosts are online, and if so, what their IP address is. Anyone know how I can accomplish this? I tried using exec("host $host"); (where $host is the hostname) and while this gets the IP

Re: [PHP] CHECKING IF A SESSION IS ACTIVE OR NOT

2003-07-10 Thread John Hicks
There is no reliable way for the server (Apache, PHP, etc) to know when a user closes a session by closing his browser window. That's one reason why session-management sytems always employ a timeout on sessions. I don't know what the default timeout is for the PHP session-management system, bu

Re: [PHP] CHECKING IF A SESSION IS ACTIVE OR NOT

2003-07-10 Thread Marek Kilimajer
You don't realy need it. Session garbage colector removes old session files for you. Nagib Abi Fadel wrote: HI, I'm storing the sessions ids in a database table. I want to run a script that reads from the table every session id and check if this session is active or not. I know that session inf

[PHP] CHECKING IF A SESSION IS ACTIVE OR NOT

2003-07-10 Thread Nagib Abi Fadel
HI, I'm storing the sessions ids in a database table. I want to run a script that reads from the table every session id and check if this session is active or not. I know that session information is stored in a directory (/tmp by default) and removed from there when the session is closed. But if

Re: [PHP] Checking if an array key exists

2003-05-29 Thread CPT John W. Holmes
> I have a multi-dimensional array. Looks like this: > > $work_order_hdr = array ('whdr_id'=>'record_no', > 'whdr_order_no'=>'request_no', > 'whdr_site_id'=>'site_id', > 'whdr_user_id'=>'user_id', >

[PHP] Checking if an array key exists

2003-05-29 Thread James Kaufman
I have a multi-dimensional array. Looks like this: $work_order_hdr = array ('whdr_id'=>'record_no', 'whdr_order_no'=>'request_no', 'whdr_site_id'=>'site_id', 'whdr_user_id'=>'user_id', 'whdr_locatio

Re: [PHP] checking if module exists

2003-02-26 Thread Jun
thank you chris and marek.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] checking if module exists

2003-02-26 Thread Jun
n" <[EMAIL PROTECTED]> > To: <> > Sent: Wednesday, February 26, 2003 7:38 AM > Subject: [PHP] checking if module exists > > > I want my script to compress the output using gzip library. But before that, > I want to check if gzip library is enabled before calling

Re: [PHP] checking if module exists

2003-02-26 Thread Marek Kilimajer
function_exists() -- checks if a function exists Jun wrote: I want my script to compress the output using gzip library. But before that, I want to check if gzip library is enabled before calling the compression functions... How do I do that? jun -- PHP General Mailing List (http://www.php

Re: [PHP] checking if module exists

2003-02-26 Thread Chris Boget
> I want my script to compress the output using gzip library. But before that, > I want to check if gzip library is enabled before calling the compression > functions... How do I do that? You can try extension_loaded(); Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vi

Fw: [PHP] checking if module exists

2003-02-26 Thread Rick Emery
Write a test script and run it on the target server. If it crashes, it's not enabled. - Original Message - From: "Jun" <[EMAIL PROTECTED]> To: <> Sent: Wednesday, February 26, 2003 7:38 AM Subject: [PHP] checking if module exists I want my script to com

[PHP] checking if module exists

2003-02-26 Thread Jun
I want my script to compress the output using gzip library. But before that, I want to check if gzip library is enabled before calling the compression functions... How do I do that? jun -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] checking if a MySQL update worked

2002-09-30 Thread Justin French
If result is true, I take this to mean that the query could be executed. And I take MySQL affected rows to mean that N rows were affected AND the result was true: I haven't dug right down to make sure this method works for every problem, but so far, no problems found. Justin French on 01/1

Re: [PHP] checking if a MySQL update worked

2002-09-30 Thread Marek Kilimajer
mysql_error() will contain error text if "it didn't work" Henry wrote: >Hi All, > >mysql_affected_rows() returns zero if you update without changing the data >in a database record. How do you tell the difference betwix "it worked but >nothing changed" as opposed to "it didn't work"? > >TIA > >He

[PHP] checking if a MySQL update worked

2002-09-30 Thread Henry
Hi All, mysql_affected_rows() returns zero if you update without changing the data in a database record. How do you tell the difference betwix "it worked but nothing changed" as opposed to "it didn't work"? TIA Henry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: h

RE: [PHP] checking if an array is empty

2002-09-21 Thread electroteque
yeh wicked thanks -Original Message- From: Michael Sims [mailto:[EMAIL PROTECTED]] Sent: Sunday, September 22, 2002 11:48 AM To: [EMAIL PROTECTED] Cc: electroteque Subject: Re: [PHP] checking if an array is empty On Sun, 22 Sep 2002 11:09:16 +1000, you wrote: >thats the thing ,

Re: [PHP] checking if an array is empty

2002-09-21 Thread Michael Sims
On Sun, 22 Sep 2002 11:09:16 +1000, you wrote: >thats the thing , the word Array is what it returns even though there was no >input file. Oh, I see. Without seeing your code, the best recommendation I have is to loop through the array and remove the empty elements, then check to see if the arra

Re: [PHP] checking if an array is empty

2002-09-21 Thread electroteque
thats the thing , the word Array is what it returns even though there was no input file. "Michael Sims" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Sun, 22 Sep 2002 01:13:08 +1000, you wrote: >how can i check if an array is currently empty , for instance

Re: [PHP] checking if an array is empty

2002-09-21 Thread Michael Sims
On Sun, 22 Sep 2002 01:13:08 +1000, you wrote: >how can i check if an array is currently empty , for instance i have a file >input field with an array name for multiple images, i need to check if there >was no file uploaded in that field name and ignore it in the loop I find that empty() works w

Re: [PHP] checking if an array is empty

2002-09-21 Thread Sascha Cunz
There are many different states, in which an array would be empty. Can you post the output of a "var_dump($array);" in that special case you want to check? In general: 1. the variable may not have been set: if (!isset($myarray)) echo 'error'; 2. the variable is set, but ain't an array:

[PHP] checking if an array is empty

2002-09-21 Thread electroteque
how can i check if an array is currently empty , for instance i have a file input field with an array name for multiple images, i need to check if there was no file uploaded in that field name and ignore it in the loop -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: ht

[PHP] Checking if a link is valid

2002-04-02 Thread Christoph Starkmann
Hi there! This is a general networking problem, I guess... $fp = fsockopen ($tempUrl, $tempPort, &$errno, &$errstr, 30); // variables are fine, it works in most cases... if ($fp) { fputs ($fp, "GET / HTTP/1.0\r\n\r\n"); $code = fgets($fp,1024); $code = str_replac

[PHP] checking if a link is still "alive"

2002-03-21 Thread Christoph Starkmann
Hi there! I would like to implement a feature to a website I'm working at right now but don't know where to start (searching), so maybe one of you can give me a hint. The "Links" page is dynamically created out of a database. Now what I want is to have a function that checks (each time) if all

[PHP] Checking if session has been started

2001-09-22 Thread Alexander Skwar
Hi I need to run some code if a session has been started. However, to do this, I need to figure out IF the session has been started at all. How can I do this? Is checking for the count of elements in HTTP_SESSION_VARS the only reliable way of doing this? Like so? Thanks, Alexander Skwar -

Re: [PHP] checking if checkbox is checked

2001-07-06 Thread Michel 'ZioBudda' Morelli
On Wed, 4 Jul 2001, Richard Kurth wrote: I have no try, but.. > > > > > > change interest* in interest[] (without number in []). in the .php file use if (count($interest) > 0) { echo "ok"; } else echo "no one check"; bye -- Non capisco tutta questa eccitazione per il multitasking: i

Re: [PHP] checking if checkbox is checked

2001-07-04 Thread Steve Werby
"Richard Kurth" <[EMAIL PROTECTED]> wrote: > I have 5 checkbox's in a form that I what to make sure at least one of > the checkbox is checked. > > > > > > if ( $interest == 'basic' || $interest3 == 'Internet access' || ... $interest2 == 'platinum' ) { echo "At least one was checked."; }

[PHP] checking if checkbox is checked

2001-07-04 Thread Richard Kurth
I have 5 checkbox's in a form that I what to make sure at least one of the checkbox is checked. I am checking for blank field buy doing this below How can I check for at least one of the above check boxes is checked if ($name == "") { $name_err = " Please enter your

Re: [PHP] checking if e-mail address and syntax are valid

2001-05-06 Thread Manuel Lemos
Hello Carlos, On 24-Apr-01 17:12:53, you wrote: >I would like to know if anyone has or know any PHP code to verify if a form >entered e-mail address is valid? >I would like that things like 4$%^%$@@.com.br could not be sent. I only has >to verify the syntax of it, the existance I believe should

Re: [PHP] checking if e-mail address and syntax are valid

2001-04-25 Thread Dan Lowe
Problem with this is that many people use '+' in email addresses along with other strange characters (a friend of mine has an apostrophe in her address at General Electric). Bottom line, trying to catch all valid email addresses using a regex is a really ugly thing to try to do. The one shown he

Re: [PHP] checking if e-mail address and syntax are valid

2001-04-25 Thread Nikhil Goyal
I wrote a similar script of my own... Works fine for me function email_valid($email) { $pattern="^[0-9a-zA-Z_-]+(\.[0-9a-zA-Z_-]+)*@[0-9a-zA-Z_-]+(\.[0-9a-zA-Z_-]+ )+$"; return ereg($pattern, $email); } (returns false if email is not valid, true if it is) N "Martin Skjöldebrand" <[EMAIL PRO

Re: [PHP] checking if e-mail address and syntax are valid

2001-04-24 Thread Felix Kronlage
On Tue, Apr 24, 2001 at 02:33:18PM -0700, Szii wrote: > Checking to see if it's "syntactically correct" is trivial. Validating the > domain is rather simple as well (check the retcode on a whois lookup.) Which is not as trivial as it sounds, since whois does not really have "return-codes". Yo

Re: [PHP] checking if e-mail address and syntax are valid

2001-04-24 Thread Plutarck
xcept the > existance/validity > of the domain - not the user. > > 'Luck > > -Szii > > > - Original Message - > From: "christopher hamilton" <[EMAIL PROTECTED]> > To: "Martin Skjoldebrand" <[EMAIL PROTECTED]>; > <[E

Re: [PHP] checking if e-mail address and syntax are valid

2001-04-24 Thread Szii
e existance/validity of the domain - not the user. 'Luck -Szii - Original Message - From: "christopher hamilton" <[EMAIL PROTECTED]> To: "Martin Skjoldebrand" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, April 24, 2001 1:39 PM Subject:

Re: [PHP] checking if e-mail address and syntax are valid

2001-04-24 Thread Sterling
H- If you're wanting to do it *before* the user sends the form than javascript is the way to go. http://developer.irt.org/script/email.htm It's the very first FAQ. #122. -Sterling Carlos Fernando Scheidecker Antunes wrote: > > Hello all! > > I would like to know if anyone has or know any

RE: [PHP] checking if e-mail address and syntax are valid

2001-04-24 Thread christopher hamilton
I'd like to add to that, before someone spends a lifetime searching for an answer ... "Solution: There isn't one. You cannot do real-time validation of mail addresses. You must pick from a number of compromises." The section goes on describing how many RFC-valid addresses are undeliverable and

Re: [PHP] checking if e-mail address and syntax are valid

2001-04-24 Thread Martin Skjöldebrand
Carlos Fernando Scheidecker Antunes wrote: > Hello all! > > I would like to know if anyone has or know any PHP code to verify if a > form entered e-mail address is valid? > > I would like that things like 4$%^%$@@.com.br could not be sent. I only > has to verify the syntax of it, the existance

[PHP] checking if e-mail address and syntax are valid

2001-04-24 Thread Carlos Fernando Scheidecker Antunes
Hello all! I would like to know if anyone has or know any PHP code to verify if a form entered e-mail address is valid? I would like that things like 4$%^%$@@.com.br could not be sent. I only has to verify the syntax of it, the existance I believe should be harder to verify but if it is possi

Re: [PHP] Checking if a web, a url really exists ?

2001-03-19 Thread Geoff Caplan
Steve wrote: SH> Anybody got an idea on how to check if a url really exists ? Look at the function url_responds() in class.Validator.php3 from http://www.thewebmasters.net. This is a useful general validation class open sourced on the Gnu licence. Cheers Geoff Caplan mailto:[EMAIL PROTECTED]

SV: [PHP] Checking if a web, a url really exists ?

2001-03-19 Thread Daniel Svensson, Coretrek
: 19. mars 2001 15:27 Til: PHP Mailing Listl (E-mail) Emne: [PHP] Checking if a web, a url really exists ? Anybody got an idea on how to check if a url really exists ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

[PHP] Checking if a web, a url really exists ?

2001-03-19 Thread Steve Haemelinck
Anybody got an idea on how to check if a url really exists ? -- 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] Checking if files are there?

2001-01-24 Thread Jon Haworth
Yep. $file = @fopen (. The @ sign suppresses the warning messages. Should work fine after this. HTH Jon -Original Message- From: Sam [mailto:[EMAIL PROTECTED]] Sent: 24 January 2001 12:19 To: 'php' Subject: [PHP] Checking if files are there? Hi all, I was wo

[PHP] Checking if files are there?

2001-01-24 Thread Sam
Hi all, I was wondering if you could use PHP to test if a picture is there? I.E. checking if you could open the picture or not, and displaying a message either way. I have tried $file = fopen ("../images/maps/$filename.jpg", "r"); if (!$file) { print "This is no map for this trip.";