Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    23
    Member #
    25361
    Hi,

    I have this code here which i saved it as menu.php here is the code

    <html>
    <body>
    <a href="http://www.who.com/index.php">Home</a> -
    <a href="http://www.who.com/about.php">About Us</a> -
    <a href="http://www.who.com/links.php">Links</a> -
    <a href="http://www.who.com/contact.php">Contact Us</a> <br />
    </body>
    </html>


    And then write this code and saved it as index.php..here is the code
    <html>
    <body>
    <?php include("menu.php"); ?>
    <p>This is my home page that uses a common menu to save me time when I add
    new pages to my website!</p>
    </body>
    </html>
    Therefore when i preview index.php, it then gives me an error on line 10..now i have try several ways to solve but i am not..meanwhile the wampserver is working all right or it there any setting.

    Please help me solve this and make it work for me..any help to solve this will be thanked using the blue thank.

    Thanks.Clement Osei.

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,824
    Member #
    5580
    Liked
    726 times
    First of all, the included file(s) don't need the <html> tags.
    This is all that file should contain:

    <a href="http://www.who.com/index.php">Home</a> -
    <a href="http://www.who.com/about.php">About Us</a> -
    <a href="http://www.who.com/links.php">Links</a> -
    <a href="http://www.who.com/contact.php">Contact Us</a> <br />
    What exactly does the error say?

    It could have something to do with your server not being sure how to
    process the HTML you have ...

    Maybe this would work better for your menu.php script ...

    <?php
    echo"
    <a href=\"http://www.who.com/index.php\">Home</a> -
    <a href=\"http://www.who.com/about.php\">About Us</a> -
    <a href=\"http://www.who.com/links.php\">Links</a> -
    <a href=\"http://www.who.com/contact.php\">Contact Us</a> <br />
    ";
    ?>

    .
    kingot likes this.


  4. #3
    Junior Member
    Join Date
    Dec 2010
    Posts
    23
    Member #
    25361
    Hi Sir,
    Thanks very much.It is now working.You have helped me most because i really do not feel comfortable when i don't get thing work when i am learning.Thank you and may God bless you.

    Yea,sir ,you were talking about how the server to process HTMl code..Is there anything wrong with my server..please me if you can because it can disturb as this one.Is there any settings i should make.I know your much more to tell me.

    Thanks.Clement Osei.

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,824
    Member #
    5580
    Liked
    726 times
    Someone that uses WAMP might know what the issue might be.

    I always work with online shared webhosts, so it's never an issue for me.

    Which method worked ... the one without <?php or the other one?

    .


  6. #5
    Junior Member
    Join Date
    Dec 2010
    Posts
    23
    Member #
    25361
    Hi Sir,

    I love your professional experience.Now my aim it to become an expect in web development(web developer) whether it will take me my whole life years.

    Now would like you to recommend a and where i can get wampserver ebook or video tutorials to master it well to become expect in developing something wonderful.

    Thanks and i pray that God should grant you heavenly knowledge and wisdom to do more than what you do now.

    Clement Osei Tutu

  7. #6
    Senior Member Ferro's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    386
    Member #
    14204
    Liked
    5 times
    Hmmm... I use WAMP and don't have to use the <?php tags in an include. Are you viewing your site by going to localhost via WAMP then clicking on the site? Or are you just running the file "index.php" - if you just run it, it won't work, you have to have "localhost" on the beginning of your url.
    Could you post the exact url that it says in the address bar for index.php when you run it, and the exact error message it gives?
    Or have you got a link, if it's online?

  8. #7
    Junior Member
    Join Date
    Dec 2010
    Posts
    23
    Member #
    25361
    Hi sir,

    Please i have solve the previous one.But now,i have this code here which i think is ok but it is giving me error any time i preview it.

    Please this code is worrying me very much .Please help me.

    here is the code

    <html>
    <body>
    <?php
    print "I love to be a programmer";
    print "<br/>";
    print 'I love to be a certified programmer';

    $var1="I am learning php";
    $var2 = "PHP from siliconindia";
    $var3=$var1." ".$var2;
    echo "$var3<br/>";

    //this is a php constant
    define("WHO","Ghana");
    echo WHO;
    echo "<br/>";
    define("NuMBER","150");
    echo NuMBER;
    echo "<br/>";
    define ("DECIMAL","1.35373");
    echo DECIMAL;
    echo "<br/>"

    echo "These are valid variables";
    ?>
    </body>
    </html>

    Now the error message is...( ! ) Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in C:\wamp\www\web folders\assignvariable.php on line 30

    Please help me.And tell me do they a have a book the interpret these error ,so it be sort out easily on wampserver.

    Thanks .Clement Osei.

  9. #8
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,824
    Member #
    5580
    Liked
    726 times
    Missing semi-colon ...

    echo "<br/>";

    ============================
    Edit your code using notepad++
    http://notepad-plus-plus.org/

    It's free, and it highlights and line numbers your PHP code for easy troubleshooting.

    .


  10. #9
    Member LavaEagle's Avatar
    Join Date
    Dec 2010
    Location
    Seattle, WA
    Posts
    46
    Member #
    25843
    Liked
    1 times
    May god bless the rest of your days mlseim.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:20 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com