Results 1 to 5 of 5

Thread: php script problems

  1. #1
    "Out of the closet geek" wrigh_g's Avatar
    Join Date
    Aug 2003
    Location
    In the middle of No where
    Posts
    101

    Unhappy 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');
    }
    ?>

  2. #2
    Senior Member chromate's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    2,348
    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?

  3. #3
    "Out of the closet geek" wrigh_g's Avatar
    Join Date
    Aug 2003
    Location
    In the middle of No where
    Posts
    101
    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.

  4. #4
    Registered Member incka's Avatar
    Join Date
    Aug 2003
    Location
    Wakefield, UK, EU
    Posts
    3,801
    Yes, Amazing

    Cough*Windows*Cough

  5. #5
    Web Monkey MarkB's Avatar
    Join Date
    Nov 2003
    Location
    London, UK
    Posts
    1,783
    Or, you could use SSI
    Stepping On Wires - the new blog

Similar Threads

  1. Review: Professional PHP Programming
    By Chris in forum Books
    Replies: 6
    Last Post: 07-17-2013, 05:26 AM
  2. Looking for affiliates.. (to sell a PHP script)
    By listenmirndt in forum The Marketplace
    Replies: 4
    Last Post: 04-12-2004, 02:58 AM
  3. AWS PHP script problems
    By tempyyyst in forum Advertising & Affiliate Programs
    Replies: 8
    Last Post: 04-04-2004, 07:12 AM
  4. Anybody found a shopping cart script to use with AWS?
    By RockNRollPig in forum Advertising & Affiliate Programs
    Replies: 7
    Last Post: 02-18-2004, 06:44 PM
  5. Redirect script with statistics, graphs, etc
    By emke in forum Website Programming & Databases
    Replies: 7
    Last Post: 05-20-2003, 03:44 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •