1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need help to make a simply Script

Discussion in 'PHP' started by osama11, Jun 16, 2007.

  1. #1
    Hello guys I was just wondering how to make a script where I get pages 1 2 3 4 5 6 7 8 9 and etc. I want to make a page that looks the same on all the pages. And when I go to page 7 and I see all the other pages too I don't want to use html to do this becaues when I have to fix every page using html plz somebody help me how to make this fuctions work
     
    osama11, Jun 16, 2007 IP
  2. devensitapara@yahoo.com

    devensitapara@yahoo.com Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Let's do it
    give me ftp
     
    devensitapara@yahoo.com, Jun 16, 2007 IP
  3. osama11

    osama11 Peon

    Messages:
    117
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hey bro is it ok if you can just tell me how it;s done so I can learn too
     
    osama11, Jun 16, 2007 IP
  4. osama11

    osama11 Peon

    Messages:
    117
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    can somebody help me plz
     
    osama11, Jun 16, 2007 IP
  5. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #5
    not quite sure what you are asking.
     
    ansi, Jun 16, 2007 IP
  6. dankenpo

    dankenpo Guest

    Messages:
    30
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hey Osama, if I understand you correctly, you want numbered pages with the same universal design, but let's say you have 20 pages and 2 weeks from now you want to change the font and the background color on the entire website. With plain HTML, you would have to edit all 20 pages! But with php, we can create one design file and simply edit this one file, which will reflect in all of the files (This can also be accomplished with a CSS style sheet, but we will include a simple layout in our first file as well).

    We'll begin by creating five files: top.php, index.php, pg1.php, pg2.php, and footer.php.

    Here is our sample top.php file:
    
    <html><head>
    <title>Welcome to Osama's Website!</title>
    </head>
    <body>
    <div style="background-color:#FF9900; font-family:Verdana;
    font-size:smaller" align="justify">
    <a href="index.php">Return to Home Page</a>
    
    Code (markup):
    Now we have the body of our index.php page (index.php will be the first page displayed at startup):
    
    [COLOR="Red"][B]<?php include('top.php'); ?>[/B][/COLOR]
    <h1>Osama's Home Page!</h2>
    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
    nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
    erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
    et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est
    Lorem ipsum dolor sit amet.</p>
    [COLOR="Red"][B]<?php include('footer.php'); ?>[/B][/COLOR]
    
    Code (markup):
    Ok, and we wanted our menu (page numbers) on the bottom of the page, so we create the footer.php file:
    
    <br /><br />
    <div align="center">
    <table border="1">
    <tr>
    <td><a href="pg1.php">Page 1</a></td>
    <td><a href="pg2.php">Page 2</a></td>
    </tr>
    </table>
    </div></div>
    </body></html>
    
    Code (markup):
    Now just create content for pg1.php and pg2.php and voila! a website. Now if you want more pages, simply add them as new tabular data (<td> tags) and create their content. You will only need to edit footer.php or top.php and it will reflect in all of the pages. Be sure to use the <?php include('file.php'); ?> code in every content file (index.php, pg1.php, pg2.php, etc.) I hope this helps! Let me know if this is what you meant or not, I aired on the side of a basic answer, so if you were looking for something more complicated just let me know, but it looked like no one had answered you yet. Enjoy!
     
    dankenpo, Jun 16, 2007 IP
  7. osama11

    osama11 Peon

    Messages:
    117
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    WOW THANKS ALOT dankenpo you are the best! I will try this now and tell you if this work, THANKS ALOT
     
    osama11, Jun 18, 2007 IP
  8. dankenpo

    dankenpo Guest

    Messages:
    30
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    glad to be of assistance!
     
    dankenpo, Jun 18, 2007 IP