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
>
-
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:
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
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
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
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
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
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
[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
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!
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
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
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
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]
--
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
* 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_
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
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
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
> 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,
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
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
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
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
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
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
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
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
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
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
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
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
> 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',
>
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
thank you chris and marek..
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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
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
> 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
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
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
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
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
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
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 ,
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
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
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
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:
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
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
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
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
-
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
"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.";
}
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
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
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
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
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
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
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:
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
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
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
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
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]
: 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
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]
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
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.";
70 matches
Mail list logo