Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 05-17-2005, 06:27 PM PHP Redirectal Help
Webmaster Talker

Posts: 560
Trades: 0
Hello, I need some help with PHP and Redirectal stuff. What I am doing is implementing a a script on my site that simply checks the availability of domain names. However, if a domain name IS available, I would like the customer to be redirected to "Page A." If the domain name is NOT available, I would like the customer to be redirected to "Page B." Below is the script that I need to edited. Thanks and I would greatly appreciate any help I can get.

Matt

<?
include ("tld_check_form.php");
function whois ($a_server, $a_query, $a_port=43)
{
$available = "No match";
$available2 = "Not found";
$a_query = str_replace("www.", "", $a_query);
$a_query = str_replace("http://", "", $a_query);
global $whois_servers;
@reset($whois_servers);
$a_query = $a_query . "." .
$a_server;
$a_server = $whois_servers[$a_server];
$sock = @fsockopen($a_server,$a_port);

IF (!$sock) {
echo ("<b>Could Not Connect To Server.</b>");
}

ELSE {
$send_request = @fputs($sock,"$a_query\r\n");

IF (!$send_request) {
echo ("<B>Unable to send request.</B>");
}

ELSE
{
while(!feof($sock)) {
$result .= fgets($sock,128);
}

$result = str_replace("\n", "<br>", $result);


IF (@eregi($available,$result) OR @eregi($available2,$result)) {

echo ("<BR><BR>
<font color=\"blue\"><b>$a_query is available.</b></font>");
}

ELSE {
echo ("<BR><BR>
<font color=\"red\"><b>$a_query is not available.</b></font>
<BR>
");
}
@fclose($sock);

}
}
}
// Check request, post form

IF (!empty($_REQUEST[query]))
{
whois($_REQUEST[server],$_REQUEST[query]);
}
ELSE IF (isset($_REQUEST[query]))
{
echo ("<b>Domain name left blank. Please fill in a domain name and try again.</b>");
}

?>
__________________

Please login or register to view this content. Registration is FREE
170 Designs is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-17-2005, 07:21 PM
leavethisplace's Avatar
Ultra Talker

Posts: 297
Trades: 0
Sure, you just need to use the header() function in php. This must be used before any actual output to the browser, so before any echo or such like.

Say i wanted to redirect someone to google, just do this
PHP Code:
header("Location: http://www.google.com/"); 
This what you wanted? Just for future reference please enclose all your PHP coding in the PHP square brackets!
__________________
A lie gets halfway around the world before the truth has a chance to get its pants on. - Sir Winston Churchill

Please visit my sites:
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
leavethisplace is offline
Reply With Quote
View Public Profile
 
Old 05-17-2005, 07:30 PM
Uche's Avatar
Extreme Talker

Posts: 174
Location: Nigeria/Lagos
Trades: 0
Or this PHP CODE : header ("location: thankyou.php"); which ever one you wanna use.
__________________
Life is just lyke a school where everybody goes to learn one or two thing. the more u school, the more u learn more about school..The more we live our lifes.. the more we learn more about life.

Please login or register to view this content. Registration is FREE
Uche is offline
Reply With Quote
View Public Profile Visit Uche's homepage!
 
Old 05-17-2005, 07:31 PM
leavethisplace's Avatar
Ultra Talker

Posts: 297
Trades: 0
aint they the same thing?
__________________
A lie gets halfway around the world before the truth has a chance to get its pants on. - Sir Winston Churchill

Please visit my sites:
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
leavethisplace is offline
Reply With Quote
View Public Profile
 
Old 05-17-2005, 07:35 PM
Uche's Avatar
Extreme Talker

Posts: 174
Location: Nigeria/Lagos
Trades: 0
Watever anyway ! Extreme just letting him know that they are same thing.
__________________
Life is just lyke a school where everybody goes to learn one or two thing. the more u school, the more u learn more about school..The more we live our lifes.. the more we learn more about life.

Please login or register to view this content. Registration is FREE
Uche is offline
Reply With Quote
View Public Profile Visit Uche's homepage!
 
Old 05-17-2005, 08:36 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Quote:
Originally Posted by Uche
Watever anyway ! Extreme just letting him know that they are same thing.
Did I miss something?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 05-17-2005, 08:52 PM
Uche's Avatar
Extreme Talker

Posts: 174
Location: Nigeria/Lagos
Trades: 0
Not at all .
__________________
Life is just lyke a school where everybody goes to learn one or two thing. the more u school, the more u learn more about school..The more we live our lifes.. the more we learn more about life.

Please login or register to view this content. Registration is FREE
Uche is offline
Reply With Quote
View Public Profile Visit Uche's homepage!
 
Old 05-17-2005, 09:54 PM
Webmaster Talker

Posts: 560
Trades: 0
Hey guys, thanks for your interest in helping me. However, where EXACTLY in my coding do I add the necessary new coding? Please look at my coding that I posted above and just copy and paste the part where the new stuff needs to be added. Thanks again and I really appreciate it.

Matt
__________________

Please login or register to view this content. Registration is FREE
170 Designs is offline
Reply With Quote
View Public Profile
 
Old 05-17-2005, 11:33 PM
desertland's Avatar
Skilled Talker

Posts: 86
Trades: 0
Inside your code here:


IF (@eregi($available,$result) OR @eregi($available2,$result)) {

echo ("<BR><BR>
<font color=\"blue\"><b>$a_query is available.</b></font>");
}

ELSE {
echo ("<BR><BR>
<font color=\"red\"><b>$a_query is not available.</b></font>
<BR>
");


Instead of the 'echo' statements, put the 'header' code (shown above) that's used to redirect the user.
__________________
I store my recipes online (the way nature intended) at
Please login or register to view this content. Registration is FREE
desertland is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP Redirectal Help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29125 seconds with 12 queries