HTML Help
HTML Help Central . com

» Online Users: 117

0 members and 117 guests
No Members online
Most users ever online was 695, 02-16-2011 at 07:01 AM.

» Site Navigation

 > FAQ

» Domains For Sale

Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    1,766

    Post Getting started on PHP

    I'm getting started on PHP for my website. If I have any questions I'll post them here.

    Question 1:
    I've included my links.php from my index.php using:
    PHP Code:
    <?php include 'links.php?link=index'?>
    How can I retrieve the parameter of link from inside links.php?
    Last edited by samliew; 06-29-2006 at 11:07 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    1,766
    Answer to Question 1:
    PHP Code:
    global $HTTP_GET_VARS;
    $_link '';
    if(isset(
    $HTTP_GET_VARS['link'])) $_link $HTTP_GET_VARS['link']; 
    Is the syntax correct? The _link variable declared correctly?
    Is the semi-colon at the end of each statement compulsory?
    Last edited by samliew; 06-29-2006 at 11:56 PM.

  3. #3
    Join Date
    Apr 2005
    Location
    Upland, CA
    Posts
    1,031
    Why dont you do a templating system sam? I did...
    Chris

    Computers are like Air Conditioners..
    Once you open windows they both stop working.
    Updated Links

    My Blog | MadReligion | My facebook | Twitter

    Windows has Written There Code to fail!! Save YourSelf.. Go Linux!!

  4. #4
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    1,766

  5. #5
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    1,766

  6. #6
    Join Date
    Apr 2005
    Location
    Upland, CA
    Posts
    1,031
    Hey sam thats great post the tutorials that you find during your construction, Because i am learning PHP and i think that would be very helpfull.

    I have a templating code if you want to check it out it works. Basically you design your layout and then you use a tag replacement script to replace the tags in your layout. This way your pages are always uniform with the others..

    I implemented a link system into mine

    Let me know if you would like me to post it. I used a tutorial and did some hacking to the code as well as had Billy help me out on the debugging of the code...
    Chris

    Computers are like Air Conditioners..
    Once you open windows they both stop working.
    Updated Links

    My Blog | MadReligion | My facebook | Twitter

    Windows has Written There Code to fail!! Save YourSelf.. Go Linux!!

  7. #7
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    1,766
    It's ok. I'd probably get most stuff figured out. If I need help I'll post here.

  8. #8
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    1,766
    Question 1, part 2:
    Ok, I still have some problems with the first question.
    PHP Code:
    <?php include 'links.php?link=index'?>
    PHP Code:
    <?php
    global $HTTP_GET_VARS
    $the_link '';
    if(isset(
    $HTTP_GET_VARS['link'])) { $the_link $HTTP_GET_VARS['link']; }
    echo 
    $the_link;
    ?>
    Nothing is retrieved from the parameters. Is that the correct way to pass the parameter 'link' with the value 'index' to the page?

  9. #9
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    1,766

  10. #10
    Join Date
    Apr 2005
    Location
    Upland, CA
    Posts
    1,031
    You know you can just make a link or nav layout however you want.

    Code:
    <a href="ladida">ladida</a>
    <a href="ladida1">ladida1</a>
    <a href="ladida2">ladida2</a>
    Name that nav.html or whatever you prefer. The php will process it
    then use you include tag
    PHP Code:
    include 'nav.html'
    you can format this nav in anyway you ant use css, tables, etc etc and the php will process that page as html and the use it in the position or place you put the include tag. I am not 100% sure but i think you can use a div and css to position your nav or whatever your including.
    Chris

    Computers are like Air Conditioners..
    Once you open windows they both stop working.
    Updated Links

    My Blog | MadReligion | My facebook | Twitter

    Windows has Written There Code to fail!! Save YourSelf.. Go Linux!!

  11. #11
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    1,766

    Date Function

    This is what I use to print out the current year using PHP:
    PHP Code:
    <?php
    $b 
    time ();
    echo 
    '&copy; Copyright 2001-';
    print 
    date("Y",$b) . "";
    echo 
    '. All Rights Reserved.';
    ?>
    Last edited by samliew; 08-20-2006 at 10:26 PM.

  12. #12
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    1,766

    Sucessful Migration of website!

    I've sucessfully moved most JavaScript includes (document.write) to PHP.
    Now it's fully accessible, even with JavaScript disabled.

  13. #13
    Join Date
    Aug 2005
    Location
    NJ
    Posts
    16

    php include

    I am assuming what you are trying to accomplish is include one file 's content to other pages. I do that too especially for my headers and footers so that if I make a change it shows on every single page by just changing one page. Here is a simple way to do it.

    Code:
    <?php include("dir/filename.php"); ?>
    \
    Where ever you add this line content from that file will show up there. Hope this helps.
    cheers

  14. #14
    Join Date
    Aug 2001
    Location
    New Jersey, USA
    Posts
    1,940
    Sam, I think the way you are going about what you are doing is incorrect, but I don't exactly know what you are trying to accomplish. I see a lot of different things being thrown around in this thread, can you try to clarify your question?

  15. #15
    Join Date
    Oct 2002
    Location
    Houston, Texas
    Posts
    1,994
    Quote Originally Posted by sam1986 View Post
    Question 1, part 2:
    Ok, I still have some problems with the first question.
    PHP Code:
    <?php include 'links.php?link=index'?>
    PHP Code:
    <?php
    global $HTTP_GET_VARS
    $the_link '';
    if(isset(
    $HTTP_GET_VARS['link'])) { $the_link $HTTP_GET_VARS['link']; }
    echo 
    $the_link;
    ?>
    Nothing is retrieved from the parameters. Is that the correct way to pass the parameter 'link' with the value 'index' to the page?
    PHP Code:
    <?php 
    $the_link
    =@$_GET['link']; 
    echo 
    $the_link
    ?>
    -Billy

    "I am using Linux every day to up my productivity - so up yours!"

    ******** W A R N I N G ! *******************************
    Linux should not be used by those under the influence of Microsoft.
    May cause dizziness or vertigo. Consult your tech support before
    using Linux. (note--after using Linux, you may notice extreme
    discomfort when using Microsoft. Discontinue use of Microsoft.)
    ******************************* W A R N I N G ! ********

Similar Threads

  1. Help getting started.
    By Ognar in forum Database Web Development
    Replies: 3
    Last Post: 01-26-2008, 08:25 PM
  2. getting started
    By anguslad in forum Miscellaneous
    Replies: 1
    Last Post: 07-19-2007, 02:37 PM
  3. A few questions to help me get started
    By MRRM in forum HTML / XHTML / XML
    Replies: 6
    Last Post: 04-02-2003, 01:56 PM
  4. getting started
    By Jessica in forum Miscellaneous
    Replies: 2
    Last Post: 03-06-2003, 01:40 PM
  5. just started html please help me
    By RICH2001 in forum HTML / XHTML / XML
    Replies: 3
    Last Post: 07-08-2001, 07:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.1.1