LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-26-2004, 07:41 AM   #1
ArulPrabhuT
LQ Newbie
 
Registered: Aug 2004
Posts: 16

Rep: Reputation: 0
need help in PHP header() function


How could i have to handle errors in php header() function

I am using the following line in my php script,

header("Location: http://ServerMcName:7080/server/settings.php")

its just redirect to another machine's php page.

if that machine(ServerMcName) is not running or web server is not yet started, how should i have to handle error in php.

any help would be appreciated.
 
Old 11-26-2004, 10:17 AM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
You could try :
PHP Code:
$fp = @fsockopen("ServerMcName"7080$errno$errstr2);

if(
$fp) { 
    
fclose($fp);
    
header('Location: htt p:// ServerMcName:7080/server/settings.php');
} else {
    echo 
$errstr;
    
fclose($fp);


Last edited by Cedrik; 11-26-2004 at 10:18 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Header Script newuser455 Programming 1 08-30-2005 05:33 PM
MySQL client/header/dev for PHP? kailun Slackware 1 03-04-2005 07:12 AM
Passing one php function result as a parameter to another php function davee Programming 13 09-12-2004 12:08 PM
PHP, header and meta, charset apertran Programming 2 08-24-2004 08:05 AM
Accessing http header in PHP artois_val Programming 1 08-07-2004 10:20 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration