Page 1 of 1

Replacing php

Posted: Thu Dec 07, 2006 9:43 pm
by Nicole
How would I replace this
<?php
$getfile = rand(1,5);
$includefile = "file" . $getfile . ".txt";
include ($includefile);
?>

on my web page, with another one exactly the same after the
first one executes? Very important, I hope someone can give me some ideas. Thanks.

Posted: Thu Dec 07, 2006 9:47 pm
by feyd
Copy and paste the code.

:?

Posted: Thu Dec 07, 2006 9:48 pm
by aaronhall
Another what?

Posted: Sat Dec 09, 2006 8:52 pm
by Nicole
Funny guy :lol:

Replace the code I listed with another after the first one executes. I already know how to
do page refreshes etc, this is an odd request but still an important one. Javascript won't work, it has to read as php.

Re: Replacing php

Posted: Sat Dec 09, 2006 10:31 pm
by neel_basu
Nicole wrote:How would I replace this

Code: Select all

<?php
$getfile = rand(1,5);
$includefile = "file" . $getfile . ".txt";
include ($includefile);
?>
on my web page, with another one exactly the same after the
first one executes? Very important, I hope someone can give me some ideas. Thanks.
I Really Didn't Understand Clearly What You Told ?

Posted: Sun Dec 10, 2006 3:04 am
by feyd
Nicole wrote:Funny guy :lol:

Replace the code I listed with another after the first one executes. I already know how to
do page refreshes etc, this is an odd request but still an important one. Javascript won't work, it has to read as php.
Seriously, what's wrong with copy-and-paste?

Posted: Sun Dec 10, 2006 8:25 am
by aaronhall
Nicole wrote:Funny guy :lol:

Replace the code I listed with another after the first one executes. I already know how to
do page refreshes etc, this is an odd request but still an important one. Javascript won't work, it has to read as php.
I'm still confused as to what you're trying to replace. Are you trying to include that file only the first time the user visits the site? Are you replacing the file being included? To "replace" code itself, you would adjust the conditions under which it executes by using an 'if' statement.