Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2007
    Posts
    28

    Unanswered: Help Required! Urgent

    Hello,
    i am looking for a Php script which could help me in organising my website.

    Ok the problem ...

    i have created index.html and made full layout in it. I use iframe in a table to view the pages which are navigated on the index.html..i hope u understand..its just like a index.html has all the links and those links open in that iframe page..

    now i create a page ..contactus.html and only put the contact numbers in this page.

    now the link to this page is on index.html nagivation menu... obviously when somebody will click contactus link which will be targetted to the iframe the page will open in the frame.i hope u get it till here..

    the problem is that when somebody will open www.website.com/contactus.html only this page will open...we won't be able to see the layout which is in index.html...

    i cannot avoid frames because whenever i will have to update the layout i will have to update all the pages..and neither i can use css layouts because i am not mastered in CSS Layouts..i dnt know much abt them and have done alot of research on them using google but still cannot produce good layouts..

    on many sites i have seen PHP Include type on command..the orignal page contains just small info but when u open like... www.website.com/contactus.php it will open with the layout which is on index.php.. the navigation links are like are like ..contactus.php/?include/news something..blah blah..there is something like that..i want to know step by step how can i do this in php..

    i want a create seperate pages with proper titles and meta tags but it should open in a table with proper layout page..no matter from where you open it and the page title should change with it.....

    Please let me know how can we do this in PHP..
    any help would be appreciated

  2. #2
    Join Date
    Mar 2007
    Posts
    24
    You can use PHP's include() function to accomplish this, and you don't even need frames. Just stick your include statement at the top of every page, then put the header code in the included file.

  3. #3
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    You could even have a controlling page that takes parameters from the url (using GET) and depending on that uses a switch statement to invoke certain includes for headers/footers/content.

  4. #4
    Join Date
    Mar 2007
    Posts
    28
    Fumigator and aschk can you please explain the solution you gave..it might help

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    ...standard php pages
    <? php
    include ("../incfiles/filetoinclude.php") ''include a block of code containing some common variables and common functions.. path is absolute to the sute URL
    $cnn=@mysql_connect($dbHost, $user, $pwd) //open a connection using variables se tin the script filetiinclude.php
    $out = myfucntionname($ooh, $are, $cantona) //call a function defined in the include file
    ....rest of your php script //do wahtever processign you require
    ?>

    ../incfiles/filetoinclude.php ///this file cotnains generic variables and functions
    <? php
    $dbName = "<mydbName>" //the name of the databse used int heapplication
    $dbhost = "<myhostName>" //the name of the server
    $pwd = "<mypwd>" //the password to use for the db
    $user = "<myusername>" ..the userid to use to connect to the db
    function myfunctionname(param1,param2...paramn) //a function defined in the include file and therfore available to any script that includes the file
    { //do some php stuff
    return ($retval)
    }
    ?>
    Last edited by healdem; 04-05-07 at 18:12.
    I'd rather be riding on the Tiger 800 or the Norton

  6. #6
    Join Date
    Mar 2007
    Posts
    28
    man i don't know php that much that is soo confusing for me..can u explain it

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Ive added some more comments to the earlier code, which I hope may help you

    however this thread isn't about teaching how to develop PHP scripts,

    its aimed at providing help with PHP especially with respect to db interaction.

    if you need to learn about PHP from scratch then there are sites like w3 schools or php.net which should give you some basics
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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