-
php script problems
Can anybody help me with this problem.
I want to display all webpages as .txt files to eliminate the use of frames. However, i have come across a problem.
I want the page to display welcome.txt as soon as the page loads, but also get a variable when a link is clicked so it goes to another .txt file.
I think it has something to do with a IF statement but i can't get to to work.
Here is my script ATM:
<?PHP
IF(@$name=$_GET('name')){
if($name=""){include("welcome.txt");
} else {
include("$name.txt");
}
} else {
echo('Unable to connect to the server');
}
?>
-
IF(@$name=$_GET('name')){
This is probably the line that's causing the problem. You need two equal signs, and also square brackets, like so:
IF(@$name==$_GET['name']){
Otherwise, if you only use one equal sign, you're assigning the value of the $_GET['name'] to $name and it will always be true.
Though, I'm not really sure what you're trying to do. Why do you need to use .txt files to get rid of frames?
-
Thanks very much, works now.
Amazing how a little error like that can cause the whole thing to fail.
As for the frames, i dont like using frames so i use:
include("name.txt"); to display information instead of using a iframe.
Anyways, thanks again.
:)
-
Yes, Amazing
Cough*Windows*Cough
-