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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gbose
Forum Newbie
Posts: 1
Joined: Wed Aug 05, 2009 11:46 am

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

Post by gbose »

hai everyone...
how to divide a web page using php??? Please send me the coding for that???? I need it in urgent??? :(
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

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

Post 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"
prashanth.patkari
Forum Newbie
Posts: 1
Joined: Thu Aug 06, 2009 8:56 am

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

Post by prashanth.patkari »

Can you send ur requirement clearly
peterjwest
Forum Commoner
Posts: 63
Joined: Tue Aug 04, 2009 1:06 pm

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

Post by peterjwest »

I doubt it.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

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

Post by jackpf »

Lol

Harsh
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

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

Post 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.
Last edited by McInfo on Wed Jun 16, 2010 4:27 pm, edited 1 time in total.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

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

Post 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.
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

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

Post 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?
marty pain
Forum Contributor
Posts: 105
Joined: Thu Jun 11, 2009 5:32 am
Location: Essex

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

Post 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?
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

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

Post by jackpf »

McInfo wrote:

Code: Select all

<?php
$web_page = 100;
printf('%d', $web_page / 2);
?>
I found that quite funny...
peterjwest
Forum Commoner
Posts: 63
Joined: Tue Aug 04, 2009 1:06 pm

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

Post 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);
}
 
Post Reply