Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





How To Limit Number Of Lines Displayed On The Page?


I just wrote this script to read information from a TXT file that contains list of JPEG files, and the list is rather huge. So I want to limit the number of displayed files to like 20 per page (with NEXT/PREVIOUS links to the next or previous 20), but I have no clue how to do it. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
How To Limit The Number Of Picture Displayed
I have a fully working photo gallery. A database stores the image locations and then returns the location within the <img src=> tag. What i need to do is limit the number of picture displayed on one page.

Lets say if more than 50 pictures are displayed then a next button is generated. Once clicked the page refreshes displaying the next lot of pictures.

As i am a low leveled PHP guy im not sure how to go about this. Any ideas?

View Replies !
Limit Number Of Results Displayed From A Multidimensional Array
The closest I've come to finding a thread that solves this problem is
"MYSQL_FETCH_ARRAY without using while " ... I think it was in the database forum.

If I pull a bunch of calendar events out of a MySQL table, I will have a variable number of events per day. I can put these into a multidimensional array (Say, $$ResultArray[$DATE][] All the sorting by date and time has been done by the original SELECT query.

Once I have this array, I know I can show the whole thing with a FOREACH loop: Code:

View Replies !
Limit Result By Number Of Lines Or Characters?
I'd like to display just the first paragraph or so of text held in a mysql result followed by a link to the full article. Is this most easily done by putting some sort of limit into the mysql query, or is there a php function or method that will cut off the specific result field after so many lines or characters?

View Replies !
Limit String To Specific Number Of Lines
I was wondering how I would go about setting the number of lines for a string.  For instance, if I have:

This
Is
Just
A
Test

Say I just have room for 3 lines, I want it to say on the page:

This
Is
Just
- click here to read the entire string

The reason for this is I want to create a news section on the main page, that has the brief story and then click the link to go to the full story.

View Replies !
How To Limit Output Lines Per Page Using A Flat Txt Database
I searched the boards for some direction in limiting the output to so many lines like "Back 1 2 3 Next". However, everything is pointing to mysql databases. Has any one did it with a flat text file? This is a sample of how I print to the screen How can I modify this? PHP Code:

View Replies !
Phone Number Is Not Displayed In The Paypal Page
I am using Paypal in my site. The problem is the phone number is not
displayed in the paypal page, but am sending the phone number in a
hidden value with the name "H_PhoneNumber".

Can anyone tell what could be the problem? Why am not getting Phone
number in the paypal page.

View Replies !
How To Control The Number Of Page Links Displayed With Pagination?
Does anybody know how to control the number of page links displayed with pagination?  I mean like, with the tutorial on this site, if I had, say 50 pages of results, it actually creates individual links for page 1-50.  How could I make it truncate say 1-5, and then an arrow to goto 6-11 and vice versa? Here is the code the tutorial uses

    for($i = 1; $i <= $numofpages; $i++){
        if($i == $page){
            echo($i." ");
        }else{
            echo("<a href="$PHP_SELF?page=$i">$i</a> ");
        }
    }

View Replies !
Read File - Limit The Number Of Lines To Read
How can I open a file and then limit the number of lines I want to read? say I have a text file and I only want to read line one to get the title of the text within?

View Replies !
Limit Results Displayed
I have tried a few different tutorials etc on this but I cant get it to work properly with my code. What i need is the page to display 10 results per page and to automatically create a "Prev | 1 | 2 | 3 ..etc | Next" navigation that runs the results of the query.
PHP Code:

View Replies !
Limit Amount Displayed In Array
I need to limit the amount displayed in an array. if the array is 100 I need to limit it to the first ten. I tried to do range but I can't seem to get it to work. here is how I am showing the array.

<?
$results = array_unique($results);
foreach($results as $resultsindex =>$goto)
{
?>
<a href="index.php?mode=2&url=<? echo $url.$goto;?>"><? echo $goto;?></a><br>
<?
}

View Replies !
Limit # Chars Displayed On Echo?
I have a database w/ several text fields. I want to be able to echo only the first, say, 100 characters of the field only, instead of the whole thing. Is this possible?

View Replies !
Problems With Paging. Limit The Numbers Displayed
I'm having a problem with paging. I can do the paging but I want to limit the numbering. So if I had pages 1 to 30 I want 1 to 10 displayed and a next button beside the 10.

Here's what I got.

View Replies !
Number Of Rows--displayed
Is there a way to call a function that would display the number of rows in a table?
I'd like to have a count on the page that allows people to query the database to demonstrate that the database is growing and constantly changing.

View Replies !
Limiting Number Of Pages Displayed
I am querying my db, I have 300 items as my result, I am displaying 10 on a page, I only want 10 links to other pages displayed at one time instead of all 30, here is the code I am working with. Code:

View Replies !
Created A Form Where The Number Of Rows Are Displayed Based On A Value From A Select Box.
I have created a form where the number of rows are displayed based on a value from a select box. Everything works excellent this far. however I need to take it to the next step where I display the information back into the form based on values in a mysql table. Code:

View Replies !
Number Of Lines
Is there a function that returns the number of lines in a text
file? If so, what is it?

View Replies !
How To Number 42 Lines 1-14
I have 3 sonnets (14-line poems, fyi) in a file without blank lines and I want to tack line numbers onto the end of each line so that the first 14 lines will be numbered 1-14, as will the second 14 lines and the third. I've exploded the file by "
" so that I have each line as an array value. I've been using various loop fuinctions (for, foreach, while) to try to put individual numbers at the end of each corresponding line, but something either loops too much or not at all.

This is just an example. I know I could number 42 lines by hand, but I'd like an automated system to do it for much more line numbers.

View Replies !
Checking For Number Of Lines?
I have a problem. I have a static table cell (static meaning that it's dimensions do not change per amount of data) and i want to put news there. Via a mysql database i am outputting the news into this cell, but i want it to only allow enough so that it fits. Is there a way I can see how many lines a string has, or is there some other way to do this?

View Replies !
Removing Lines By Number
Is there a script that will remove lines by numbers or by name. I've go a back up and I need to remove a line and can not do manually do to size.

View Replies !
Error Lines Number
Is there a var in the php.ini file that allows PHP to count HTML lines as well as the PHP lines when returning the line at which an error has occurred? I'm getting bored of having to search for the line when PHP says there's an error at X when it's actually at X+300!

View Replies !
Php Script - Number Of Lines Or Words.
i mean the script works however i am having trouble modding it a bit. the thing is that i need the modifity the $end variable of the script, instead of looking for a unique word i need to a number of lines or words. The thing is i just need the number preciding the List Price

<?php

// include trailing slash in file
$url_to_grab = "http://www.amazon.com";

//IMPORTANT: BOTH OF THESE MUST BE UNIQUE PIECES OF CODE FROM
//THE TARGET WEBSITE--IF BOTH OF THESE ARE NOT UNIQUE,
//THIS SCRIPT WILL NOT WORK!
$start="List Price:</td>";
$end="";


// Grab source code from a file or web site
if(!($myFile=@fopen($url_to_grab,"r"))) {

View Replies !
Flat File Display <i>x</i> Number Of Lines
I have a "site updates" script that I wrote that stores my site updates in a flat file in the form:

21234123|>|blah blah blah
21234123|>|blah blah blah
21234123|>|blah blah blah

where 21234123 is a unix timestamp.

what I want, is to be able to display the last x updates on my main page. I have a "updates.php" page which displays ALL updates... but I want to display just the say... most recent 3 or 5 updates at the bottom of my main page.

This is my function that displays -all- updates.

View Replies !
Insert New Row In Table After 5 Lines - Detect Whole Number?
I have a script that loops through an image directory to create a table of thumbnails. I want to start a new row after every fifth thumbnail. I assumed there was a function which identified whole numbers, but alas, there doesn't seem to be. How do I produce a short version of my long, working version below. PHP Code:

View Replies !
Function To Count Number Of Lines In File
Is There A Function To Count Number Of Lines In File?

View Replies !
Count The Number Of Lines Of A Entry In A Table
could anyone give me a code to display the number of lines in the row "THREADPREFIX" of my "FORUM" table.

View Replies !
Page Not Displayed!
I have a site in PHP with a page 'approveMembers.php' within 'approve' directory under the site directory. This site has been hosted on net. Now the problem is when i access this page from my machine that uses a proxy server to connect to the internet, the contents get displayed properly.

However, when i use a machine that connects to the internet directly (without using a proxy), the contents do not appear in the page even though the status bar read 'Done' after loading the page. Code:

View Replies !
Page Cannot Be Displayed
OS: Windows 2003 Server
Program: EasyPHP1.8

Changed port to 81 in httpd.conf, rebooted and everything....

127.0.0.1:80 still connects to the index page
127.0.0.1:81 doesnt connect (Page cannot be displayed)
192.168.1.181:80 & 192.168.1.181:81 doesnt connect either (192.168.1.181 is the computers IP)

Is there any configuration I have to do with Windows Server 2003? This is all after a clean install of the OS. Firewall is off (default) or anyone have any advice what the problem could be?

View Replies !
The Page Cannot Be Displayed!
I have a problem when try to upload a quite BIG file (more than ~600K, less than 600K is OK). My browser said : "The page can not be displayed" - in IE and "The connection was reset" - in Mozilla Firefox.

Have someone found the problem like this before? And how can I solve it?? My very very simple code is:

View Replies !
Limit To Number
I was trying to figure out why some of my PHP wasn't working. It worked fine in my basic test file but when I applied it to my regular pages it wouldn't. So somehow I found myself taking out some of the other PHP code I had.

I have a few open/close php tags because I am putting it here and there. So now it works. if there is a limit for whatever reason to how many times PHP can be processed on a single file regardless of how simple each process is?

View Replies !
PhpMyAdmin - Page Cannot Be Displayed
I programmed my config.inc.php file with the codes below. But i cant go to the website.. It shows an error msg, "page cannot be displayed"

What haf i done wrong.. N i m actually not sure about my local host.. Cos i m using my school wireless network..

$cfg['PmaAbsoluteUri'] = 'http://www.example.com/phpMyAdmin-2.5.7-pl1/'

$i = 0;

$cfg['Servers'][$i]['host'] = 'example.com' // MySQL hostname

$cfg['Servers'][$i]['port'] = ''

$cfg['Servers'][$i]['socket'] = ''

$cfg['Servers'][$i]['connect_type'] = 'tcp'

$cfg['Servers'][$i]['controluser'] = ''

$cfg['Servers'][$i]['controlpass'] = ''

$cfg['Servers'][$i]['auth_type'] = 'config' // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'username' // MySQL user
$cfg['Servers'][$i]['password'] = 'my_pass' // MySQL password (only needed
// with 'config' auth_type)

View Replies !
Page Cannot Be Displayed Using Php.exe On Win2k
Im using php.exe on win2k. When I visit a php page i get page cannot be
displayed. Other pages work fine. Any ideas? the php dll wont work at all,
it refuses to read the ini file at all.

Really anonying, cant figure this out.

View Replies !
SQL Statements Displayed On Every Page
Every php page that queries my MySQL db outputs the SQL string on the result page. I just want to output the results. Code:

View Replies !
&JAVA - Page Cannot Be Displayed
I have installed j2sdk1.4.2_14 to work with my php-4.3.9-3.15. And i have follow all the step from head to tail.

Now, i suppose to just create a simple php coding on java function. When i exec the page...it did not show any error but just 'The page cannot be displayed'.

I hava added a line of : export LD_LIBRARY_PATH=/usr/java/j2sdk1.4.2_14/jre/lib/i386/server:/usr/java/j2sdk1.4.2_14/jre/lib/i386 to etc/init.d/httpd. Seems not working as well.

View Replies !
CHMOD 777 - Page Cannot Be Displayed. Why?
I have placed a CHMOD 777 on a folder and now all of the files inside that folder return 'page cannot be displayed' error, an internal server error (500).

I have tried on individual files as well.. the same thing happens. Anyone know what is going on?

View Replies !
How Do I Limit A Paragraph To A Set Number.
how do i limit a paragraph to a set number. like if i got a strory and i only want 15 words to show how would i do it? Code:

View Replies !
How To Limit Number Of Characters
I have a newsroom section in one of my projects and some of the news title are so long. now, my boss wants to limit the number of characters to be displayed in the lists of news room title to 50 characters only.

my problem is, i dont know how to do it. below is my current code for the listing of news title. Code:

View Replies !
Limit Number Of Outputs
I'm trying to use an array to build a dynamic menu. I use array_unshift to build up an array but I want to limit the number of items that can be returned to the first 4 in the array: Code:

View Replies !
How Do I Limit My Number Of PHP Hits Per Second?
I want to protect myself from if someone with a fast connection hammers my
site. It's not denial of service attacks, but offline downloaders (of course
that don't show they're offline downloaders in the useragent so I can't
filter them by that).

My main issue is my site is PHP so if they hammer it,
it gets all the PHP files executing and overwhelms the CPU. I'd like to be
able to after a certain amount of hits on my index.php per second, so just
refuse.

View Replies !
Array And Limit Number
PHP Code:

<?
$sql="SELECT used_id FROM friend_vote WHERE id='$info[auto_id]'";
$result_user=executeQuery($sql);
$line_user=mysql_fetch_array($result_user);

if($line_user[used_id]!=''){
   $temp_friendids_arr=explode(",",$line_user[used_id], 10);
}
$no=1;
      if(is_array($temp_friendids_arr)){
      foreach($temp_friendids_arr as  $ind=>$val){
?>

View Replies !
Hiding Hyperlinks For Page Displayed
Can anyone point me in a direction to find a tutorial on writing a script that will hide, (not show) The text link for the home page if my vistor is on the home page. i have read a book and they have on th4ere but it only deals with changing the type of image not disabling it and hiding it from veiw.

View Replies !
Pagination Displayed In One Long Page
My site is a virtual pet style site where there are user shops and at the moment all items are displayed in one long page, not so great when theres over 100 products in one store.

Below is a copy of the code. If anyone could please give me some pointers, Id really appreciate it. I've gone through tutorials but they seems to be to advaced for what I need and I simply get lost. Code:

View Replies !
Page Blank But No Errors Displayed
I have a script that's just returning a blank page. So I'm guessing I've got an error somewhere.

In fact I know I have because if I comment out one or two classes, I get an error message coming up. But why do I get a blank page at first? How come it's not giving me an error message for my obviously faulty class? Code:

View Replies !
Flip Flop The Displayed Page
I want to test different content on a landing page to see which my visitors like the most. Version A is to be shown 50% of the time, Version B to be shown 50% of the time.

So, visitor #1 gets shown Version A, visitor #2 is shown Version B, visitor #3 shown Version A and so on.

My idea is that I would have some code that would say include(content-a.php) or include(content-b.php) depending on which is due to be shown next.

View Replies !
Upload Something To Gets Displayed On The Pagination Page
I coded an upload system, and a pagination script. These 2 things are linked together so when you upload something it gets displayed on the pagination page. Now I want to make it so if the upload page is executed, then refresh the pagination page.

View Replies !
Limit The Number Of Checked Checkboxes
I'm making an online form-to-mail form (using mail() function) with 10 checkboxes. There's nothing complicated about this page, but the viewers shoule only choose 3 checkboxes.

Is there any way to limit the number of boxes checked? It would be even better if it returns the error message when a viewer selects more than 3 boxes.

Is this possible with PHP?

View Replies !
Put A Limit To The Number Of Characters Before It Says 'read More'
I am including a php file into a webpage, but the problem i am having is i want to put a limit to the number of characters before it says 'read more'

Its an article for my site, and it'll be on my homepage so i want it to be a certain length only before it gives the 'read more' link to the full articles

Does anyone know how i can set a limit to the length of the articles before it gives the read more link.

View Replies !
Limit Number Of Characters In A Field
My directory uses this piece of code to produce a field in a form.

<td><input type=text name=keywords size=60 value='##field##'>

Please could someone tell me how to limit the number of characters allowed in that field.

View Replies !
Limit Number Of Returned Characters
I am using this to display the result now::

<?=$w_data[$i]['Summary']?></td>

table SUMMARY

contains say 200+ characters in a field

how can i return a result but limit it by the first 20 or so

View Replies !
Limit A Variable By Number Of Characters
I am wondering if its possible to limit the output of a variable to say the first25 characters?
I have some code that looks like this...

View Replies !
How Can I Limit The Number Of Characters In A Variable?
How can I have a variable contain the value of, lets say, the first 500 characters. Im using session variables. If there isn't a way (which I doubt), is there another way to limit the amount of characters in an amount of text displayed?

View Replies !
Limit The Number Of Characters In A <textarea>?
if this can be done to limit the number of characters in a <textarea>?

$this->body .="<td><textarea name=description cols=30 rows=10 onkeypress="textCounter(this,this.form.counter,430)";>".urldecode($class_ad->DESCRIPTION)."</textarea>
";
$this->body .="<input type=text name=counter maxlength=3 size=3 value=430 onblur="textCounter(this.form.counter,this,255);">Characters remaining if neded.</td></tr>
";

View Replies !
I Can't Get Info.php Working On PWS Win98 The Page Cannot Be Displayed
Can someone help me?
I have tried php-4.3.4-installer
I have tried php-4.3.4-Win32
If someone has PWS running PHP4 on windows 98
I would appreciate any help. thank-you

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved