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.
Replacing php
Moderator: General Moderators
- neel_basu
- Forum Contributor
- Posts: 454
- Joined: Wed Dec 06, 2006 9:33 am
- Location: Picnic Garden, Kolkata, India
Re: Replacing php
I Really Didn't Understand Clearly What You Told ?Nicole wrote:How would I replace thison my web page, with another one exactly the same after theCode: Select all
<?php $getfile = rand(1,5); $includefile = "file" . $getfile . ".txt"; include ($includefile); ?>
first one executes? Very important, I hope someone can give me some ideas. Thanks.
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
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.Nicole wrote:Funny guy![]()
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.