Forum Moderators: coopster

Message Too Old, No Replies

PhP calling external PHP File

         

Hipp

8:37 pm on Apr 21, 2006 (gmt 0)

10+ Year Member



Hi,

i am a newbee. I have a php-file. After processing, i want to call an other php-file for output. How does it work?

Best regards

Hipp

eelixduppy

8:38 pm on Apr 21, 2006 (gmt 0)



Hello...

do you mean something like this:

include("include_file.php");

I don't know if this is what you mean

Hipp

8:43 pm on Apr 21, 2006 (gmt 0)

10+ Year Member



Hi,

no. I have a news_add.php-file, which prints out a html file. After some file operation in this file i want to call an other file news_admin_php.

eelixduppy

8:46 pm on Apr 21, 2006 (gmt 0)



Check to see if the form is submitted and then do something like this:

header("Location: news_admin_php.php"); /* Redirect browser */

Hipp

8:51 pm on Apr 21, 2006 (gmt 0)

10+ Year Member



Hi,

here is my coding (internal function of news_add.php):

...

function newsdelete($id) {
$db = new Database("MyDB");
$rs=$db->executeQuery("DELETE FROM news
WHERE newsid=$id;");;
$id="";
---->> NOW I want to call the php-file "news_admin.php"
exit;
}

...

I put "header" line in my script, but got an error:

Warning: Cannot modify header information - headers already sent by (output started at ...\news\news_add.php:13) in ...news\news_add.php on line 275

Hipp

9:08 pm on Apr 21, 2006 (gmt 0)

10+ Year Member



I have got it :-)

I inserted

...
?>
<html><head></head>
<body onload=setTimeout("location.href='news_admin.php'",0)></body>
</html>
<?PHP

...

and it works fine :-) :-)

eelixduppy

9:10 pm on Apr 21, 2006 (gmt 0)



nice work...

i'm not much of a javascript thinker but i was just starting to think about that...sorry i couldn't help sooner