Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




How To Check An URL ..?


I am a beginner in PHP. Does anybody know how to check if an URL is
alive or dead in PHP (not exist or server down...or whatever ) ?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Check Box?
i am trying to create few check box in one page without a submit button, and there are 5 have which is some with this. User only able to click submit in the last page after he make a selection after these 5 page.

How can it keep the selected check box so that i can process in last page. I had heard there are one way to create a onclick function inside check box but how?

CHECK URL
How it can be checked that a URL exists or not in PHP.There is one
way is to use fopen function then passing the URL as a parameter.
Like this,

<?
$URL = "http://www.abc.com";
$fp = @fopen ($URL, "r");
if (!$fp)
{
die ("Cannot open website $URL!");
}
?>

But I think that there should have some other smart technique.

Can I Check SSL Somehow With PHP?
Ever since I got a server for our site, it just opens new issues.  Here is the problem: My SSL Cert somehow got corrupted.  The server is managed, so they fixed it right away once I noticed it, but nobody was able to checkout until it was fixed, and I cannot check the site every hour.

Here is what I want to do (but the server people say it is not possible): Is there a way, by chron or otherwise, to run a PHP  that requests a secure page, and if it does not respond, it emails a warning? It seems that this should be able to be done without too much trouble.  Any ideas?

How Can I Check The Url?
Is there a way to check if a user entered www. before the url?

How To Check Id
I was wondering how to get the id that has the biggest number and then add 1 to it so I can have an id field

id    name
1     test
2     test1

Eregi For URL Check
Can someone hook it up with an eregi expression to check URLs for validity?

Check For Folder
how would i check if there's at least one folder in the current folder? the current folder is $dir/$f/

this is what i have, but i know its wrong

$fillle = "$dir/$f/";
if (file_exists($fillle)) {$Q="true";} else{$Q="false";}

How To Check If I've Been CHMODED 220 ?
My host and I have come to a dissagreament on filedownload sizes, and everyday when I wake up, I see that I'm back to 220 for that /files/ directory.

I'd like to point out that it's nothing illegal, it's just gamepatches, and yes... these can get quite big.

Now, untill I settle that, I need to redirect my visitors IF that site is innaccessible to another box... how can i detect if the user gets a 403 page so that I can redirect him?

Had a look at "socket_read()" etc... but can't make heads or tail in it yet, will keep looking in there, but if someone can give me a push in the right direction, I'd apreciate it.

How To Check For Multiple @'s
We are trying to prevent spammers from mass mailing their list while
using our contact us script. We have a few security measures in place
but would also like to add a "check for more than 1 @'s in the to:, cc:
and bcc: fields. Can anyone point us to some code or turotials for
doing this?

Check A String
Hey everyone, how would I check a string for having only numbers and having 4 integers exactly?

How To Check If 2 Vars Is Not Set?
How to check if 2 vars is not set?
I started with this
if (!isset($x,$y)){

and tried many like below but gave up.

if (!isset($x)) || (!isset($y){
if ((!isset($x)) || ((!isset($y)){

Check Data Not Already In D/b
Hwo can you do it, on an insert query so that it will check whether there is a record with the same info, say club name for example, and then if u try input same thing again it will reject it.

How To Check If Theres Something In STDIN
How do i check if there is something new in STDIN?

I ran into this problem when i was doing some simple command line script
that takes input from STDIN. And i noticed that feof() always returns
TRUE with STDIN. Also it seems that if i fread(STDIN) and there is
nothing in STDIN, it waits forever for input. So i was wondering if
there is some way to check how much stuff there is in STDIN and then
read it, because i dont want to wait for the input forever.

How To Check SessionID Available Or Not?
I am working on a site in which I need to check whether user is online
or not. If user successfully logged out then I can change status from
online to offline but if user do not logged out and close the browser
or session timeout then in both of the case I do not handle how to
change user's status from online to offline.

Check Box Question
I have a small question regarding check box and mail() forms.

I have a mail() form on my website and I want to add to it a check box
that if checked the user get a copy of the data he sent and if not
check the mail is sent to me only please help me doing this because I
have tried how to figure it out but I couldnt and the problem is that
am not a really good php developer am just a beginer.

Spell Check
I have a form with 6 different fields for the user to fill in. One of the field is the text field and they are suppose to fill in about 6 lines of information. This page/information is dynamically get displayed on my webpage. How do I make sure that before it gets displayed on the web some kind of spell check is done automatically.

I did try at php.net. There is a function call Aspell() but I don't know how to get that to work for my problem.

Domain Name Check
I want to check domainnames on my website. Type in a name and you'll see if it exists or not. I've once had a CGI Script dat does this... but I wonder if its also possible in PHP.. and how?

Webmail Check
How would I go about writing a script that checks users GMAIL and HOTMAIL emails and displays it for them? if you go to www.netvibes.com it allows you to check your gmail or hotmail and yahoo accounts right from their website.

Check Image Is Not There
is there an easy way to do a check on a directory to check that a file uploaded using php uplaod fucntion isn't already there, and if so where can i read up on this.

Spell Check
How can I do spell check words? I have a file with a bunch of words in it, I want to eliminate incorrectly spelled words.

String Check
I want to check if a string contains only alphabetical and/or numerical characters. I think the solution is eregi, but i am not an expert on regular expressions..

How To Check Value Of Variable??
I have this input box that is optional called "Reason" If a user submits this form with data in the "Reason" form then I want to take those contents and add to them, ie:

if (isset($reason)) {
$reason_message = "Reason for rejection: $reason";}
else {
$reason_message = "";}


Then I have $reason_message sent alow with other stuff in an email. The problem is that if a user leaves "Reason" empty, when they get their email, this string called "Reason for rejection:" is sent. Bottom line: is there a way for me to tell that "Reason" has no value and there for not send "Reason for rejection:"

Check Boxes
I have a very little problem with check boxes. How can I write a simple PHP code to tell me when a check box has been checked, and then use the name of the checkbox in a function.

Update Check!
i update a table like this and i want to check if the update was ok or not! Code:

Port Check In PHP
how can i check is port number xxx opened on localhost ?

Check For Cookies
This is more of a pain than I thought it would be. I need a simple code
segment to determine whether a browser accepts cookies or not. When I pass
variables between pages when cookies are turned off, the global variables
are empty between pages, fine, that tells me cookies store the global
variables - right? I store the values in $_session and when cookies are
turned on values are passed between web pages - I can see these values in
fields that are displayed in the next web page.

I need to be able to check on the 'first' entry webpage after a user enters
that page directly whether or not their browser accepts cookies at that
point. Everything I have tried complex to simiple won't work. How do I do
this?

Check My Math!
Not sure about you, but when I run this, it tells me 59001.31 doesn't
equal 59001.31. Change each side of the equation by a hundreth or two
and it checks. Change it a bit more, and it won't.

_What_ is going on here?!

<?php
$subtotal=59001.31;
$principal=58605.33;
$interest=395.98;
$check=$principal+$interest;
echo("<pre>");
echo("Check: " . $check . "
");
echo("Subtotal: " . $subtotal . "
");
if($check!=$subtotal) {
echo("Check (" . $check . ") does not equal subtotal (" .
$subtotal . ")"); // Check doesn't equal subtotal
}
else {
echo("Check (" . $check . ") equals subtotal (" . $subtotal .
")"); // Check does equal subtotal
}
echo("</pre>");
?>

Check If The Page Is Not 404
How can I check if some url or address works ? If I had in my database about 1000 links, how can I check if they work ?

Check Fonts
Is there a way to check wich fonts are installed on sombodies browser? if not in php maby in java or something. I need the code for that for a highly customizable graffity wall.

Cookie Check
I would like to check and see if my visitor’s browser accepts cookies, and do it on the first page they landed on. To best of my knowledge ‘setcookie’ function does not give a confirmation back if the cookie was already set. Is this possible and if so how?

Some notes:

How Do I Check Against The PHP Version?
I'm writing an installation script for my PHP content management
system. I've written the code to be compatible with PHP 4.06 or later.
I need to get the PHP version and throw an error message if the
version is less than 4.0.6. I realize that phpinfo outputs the info,
but what function would get me the version string?

Using PHP To Check POP Email?
PHP document that would log-in to the users POP mail server, and check for mail, allow them to "compose" and send an email through that server, along with any attachements, etc.
I've seen this done with Cold Fusion, and am looking for information on this using PHP.

Check Click
I have a page and a sponsor. Every time a user click on a banner from our
sponsor their webpage is opened. I'd like to reward these users, but how to
check who clicked on a banner. I can't do anything on sponsor's webpage?

Check Wildcard URL
I'm looking for a function that will help me determine whether or not a URL entered by a user matches specific requirements. This is done using $_POST.

Basically the format of the URL must be either: www.example.com, *.example.com, www.example.*, or *.example.* - or some kind of combination such as www.url.com*. I don't want to allow a star in the 'url'. So in theory, to check this, all i would have to do is make sure the string contains: [www and/or *].[text].[text and/or *]

Postcode Check
I have no idea where to start with the code, but would like in a way that i could input true and false values, eg if it contained "sw19" or "SW19" value = true. If postcode is something not listed, value = false also True and False results will take the person to a relevent page, or relevent pop up a box.

Check If Email Has Been Sent
How can I check whether the script sent the email ?

Is There A Way I Can Check Mail With ``?
I am trying to get the mail that is on a server. Is there some way I can do that with either `` or shell access?

Check To See If Row Exists
i need to know how to check to see if an id exists in a table. if the id does not exist then display "some text" else continue with script. my table is called "orders" and i just want to check if the row "id" exists

Check File
I'm trying to find a way to search a text file for a certain key, and there will be one key on each line. I'm hoping it could return 0 if there's no match, and 1 if there is.

I'm familiar with this in other languages, but I can't find how in PHP you can read a certain line of a file. I can get most of the code already:

$var=0;
for($i=1;$i<=file_lines();$i+=1)
{
if (file_read_line()=="key")
{
$var=1;}}

But I'm sure you spot two probmlems, they are file_lines() and file_read_line(). Does anybody know the proper replacements, or a simpler way?

Check File Age.
I am tring to make a script that i will turn into a cron job.

Idealily it would check the age of the file and then figure out if it is more then 48 hours old and if it is it will delete it. i have figured out how to check the age and how to delete the files, but how would i find out if they are 48 hours old?

Check What Page Someone Came From?
I need to find out how to see what page someone came from. I need this because I need to check if they came from a downloads.php page in order to download a file. This will stop hot linking.

How it works right now is you click a link on the downloads.php page, that sends the file id to a page called files.php. The files.php figures out which file url to get from the database. Before figures out which file url to get, I need it to see if the link on downloads.php was clicked.

Mysql Check.
<?php
$sql = "SELECT * FROM songs WHERE Title = '".$_POST['songtitledelete']."' LIMIT 1";
mysql_query($sql) or die ("Couldn't execute $sql: " . mysql_error()); 
if (mysql_query($sql) == NULL){
echo "No such song";
} else {
$sql2 = "DELETE FROM songs WHERE Title = '".$_POST['songtitledelete']."' LIMIT 1";
mysql_query($sql2) or die ("Couldn't execute $sql: " . mysql_error()); 
}
?>

That should make sense? I want to check if the song is there. Otherwise it always says "Song Deleted". I want something to detect whether it's there before deleting the row.

When i run it now i dont see "No such song" when i enter an invalid song name.

Check Numeric ?
How to check data, if the data not numeric. and if the data is not numeric i want to display alert to not save this data.

Check For Frames
Is there a way to check if a document is a part of a frameset? Search engines sometimes point to a single frame of my whole frameset. This will not show the whole site when clicked. I need something like: if main.php is not inside a frame it redirects to index.php.

Check CHMOD Value?
I'm building a script that builds itself. It's working fine, but I was struck with a thought; for some of the files that will be script-created, they will need to be 777 CHMOD value. So is there a code that checks a file's CHMOD value? I basically want to say 'if $file has 777 CHMOD do this, else do this'. I can do the if bit, I was just wondering how I would do the CHMOD bit?

Email Check
$query = "SELECT member_email FROM members WHERE member_email='$member_email'";
$result = mysql_query($query);
if (mysql_num_rows($result) == 0) {
}

Im using this to check wether or not the email address is already been taken, however it isnt working. My form is submitting even with the same email address being used. Any ideas?

How To Check If Multiple Of 2?
I am creating a tournament script and need to have total matches as a multiple of 2 (2, 4, 8, 16, 32... ). How can i check the number to see if it's ok.

example
$matchesNum = 38;//obviously this is not a multiple

How would I check that number to make sure it was 32 or 64...

Check If A String Contains Something Other Than
How do I check if a string contains something other than E.g

If $string has "" in it, it will be rejected. But if it has "hello"  in it that will be okay.

Check If A Folder Contains Anything
what do I use to check if a directory contains anything.

For example how do I check if there is anything in this? (Which in english is something like news/download/may2007/document1.doc

UPLOADS_PATH.'/news/download/'.$oDownload->download_path.'/'.$oDownload->download


Copyright © 2005-08 www.BigResource.com, All rights reserved