Page 1 of 1

How to divide a web page using php?????

Posted: Wed Aug 05, 2009 11:51 am
by gbose
hai everyone...
how to divide a web page using php??? Please send me the coding for that???? I need it in urgent??? :(

Re: How to divide a web page using php?????

Posted: Wed Aug 05, 2009 11:59 am
by Mark Baker
gbose wrote:hai everyone...
how to divide a web page using php??? Please send me the coding for that???? I need it in urgent??? :(
Search on "pagination"

Re: How to divide a web page using php?????

Posted: Thu Aug 06, 2009 8:58 am
by prashanth.patkari
Can you send ur requirement clearly

Re: How to divide a web page using php?????

Posted: Thu Aug 06, 2009 11:55 am
by peterjwest
I doubt it.

Re: How to divide a web page using php?????

Posted: Thu Aug 06, 2009 12:48 pm
by jackpf
Lol

Harsh

Re: How to divide a web page using php?????

Posted: Thu Aug 06, 2009 5:26 pm
by McInfo
These are the two solutions I can think of at the moment for dividing a web page in two.

Code: Select all

<?php
$web_page = 100;
printf('%d', $web_page / 2);
?>

Code: Select all

<?php
$web_page = <<<WEBPAGE
<html>
    <head>
        <title>Page Title</title>
    </head>
    <body>
        <p>My Web Page</p>
    </body>
</html>
WEBPAGE;
 
$length      = strlen($web_page);
$mid_point   = floor($length / 2);
 
$first_half  = substr($web_page, 0, $mid_point);
$second_half = substr($web_page, $mid_point);
?>
Oh, I'm so bad...

Edit: This post was recovered from search engine cache.

Re: How to divide a web page using php?????

Posted: Thu Aug 06, 2009 8:30 pm
by califdon
gbose, I'm going to be a little nicer than some of my other friends here and explain to you that your question makes no sense. This is a PHP Developer's forum where you can get help on SPECIFIC TECHNICAL PROBLEMS related to PHP programming. We don't respond to "urgent" requests to provide code to people who don't understand PHP programming, even if we could understand what you are asking for, which we can't.

Re: How to divide a web page using php?????

Posted: Thu Aug 06, 2009 9:23 pm
by omniuni
Maybe we need CSS?

Dividing a web page in two can be done several ways. You can cut the code in half. Cut the information in half, or display it in two browser windows side by side each adjusted to show exactly half the page. A similar effect can also be created by taking a screen shot and cutting it up with GIMP. More technically, you can use iFrames or CSS to divide up the content of a page.

I wonder which option the poster is looking for?

Re: How to divide a web page using php?????

Posted: Fri Aug 07, 2009 3:50 am
by marty pain
I use PHP templates. Basically I divide each section of my site into separate <div>s, then save one <div> in one PHP file. Then you only have to change the content of the main <div> and include the rest to build a page.

Is that what you had in mind?

Re: How to divide a web page using php?????

Posted: Fri Aug 07, 2009 8:16 am
by jackpf
McInfo wrote:

Code: Select all

<?php
$web_page = 100;
printf('%d', $web_page / 2);
?>
I found that quite funny...

Re: How to divide a web page using php?????

Posted: Fri Aug 07, 2009 8:27 am
by peterjwest
I think its fair to assume he wants to divide an html document and not an integer variable. Also he didn't specify dividing it in two:

Code: Select all

 
function divideWebPage($filename,$divisor) {
  return (file_get_contents($filename) / $divisor);
}