Insert A Page Break
I have a for statement that looks something like this: PHP Code:
for ($i = 1; $i <= 100; $i++) {
       Â
        echo '<a href="someurl.php?p=$i">Link</a> | '
}
I'd like to put in a <BR> tag after every multiple of 10. I've tried to use a nested for statement, but I just get errors. I don't think I'm doing it right.
View Complete Forum Thread with Replies
Related Forum Messages:
Insert A Page Break For Printing Purposes After X Records On Page.
I need to insert a page break for printing purposes after X records on page. I'm querying five diffrent records with 5 different results and displaying them like: $record1 $record2 $record3 and so on So I want to get total number of records which is pretty easy I just add all the totals let's call it $subtotal. Then I want a page break after every 20 records of the $subtotal. Is this possible?
View Replies !
Php Page Break
I am building a form that inserts data into a database and then another user comes and pulls like a report from the database of all the information int he database. I was wondering when i create this report it is actually going to have multiple reports because every record is a a report and I was going to list them all on one screen but i need a way to be able to say where a page breaks for printing.
View Replies !
Css Page Break
I'm trying to print results from a mysql database on a printer friendly page I created. I'm printing multiple records at once, and I would like to have each new record from the while loop to display on a new page. I trying css page-break, but I the results don't show up on separate pages. Heres what i'm doing: While () { <p class="breakhere"> <table><tr><td> Content here </td></tr></table> </p> } And I use this css in my stylesheet: p.breakhere {page-break-after: always}.
View Replies !
Page Break
I have a html table that echos the mysql results like this =============== | result 1 | result 1 | =============== this loops until all results are shown. I have 2 issues with this: 1: The table echos the same result in each field, I want it to echo a new result in each field. 2: I want to be able to place a page break after X amount of results are echoed. For example I want it to do this =============== | result 1 | result 2 | =============== looping until all results are shown, but doing a page break after 7 rows of results are shown (14 results total).
View Replies !
Generating Page Break ?
I am doing a CARBASE for some dealer, to update his cars on sale online. Within the admin function he wants to be able to print out a list of all cars in the database, but only two per page. Now I have two questions: 1. Can I access the printer dialog of the browser from PHP? 2. Can I add page breaks after two records to get the printout right?
View Replies !
EzPDF : Page Break
I am using ezPDF to create PDF on the fly... I need to create a multipage listing using this ths class in my PDF, I want to Show only 50 no of record per page that I need to put page break and than go again with 50 records per page in my PDF. My question is simple.. How to put Page Break using this class ) I know the logic for getting 50 record per page. I notice that it insert page break if data exceed but in my case Data will never exceed single page infact I have 3-4 blank line at last as some data can get big.
View Replies !
Show Page Break In Records
I've just started to learn php and sql, and I noticed that there are several php discussion groups here. Pardon me if this is the wrong group, and I hope my first question isn't too silly. :-) I'm building a website that will publish articles, so I have an article table which contains a heading field, an ingress field, and a body field which will hold the complete article. There are line shifts (or page breaks) in this field, but my display-page won't show them. How do I show the article with the page breaks?
View Replies !
Insert Page Into Template
I have a script that uses a template for my site. I am trying to add a page(s) to it and have the pages use the template. The template has an area where I want the contents of my other page to appear. The other parts of the script use this PHP Code:
View Replies !
How To Insert Tab In An Html Page???
i am making one appllication inwhich the user enters text in textarea field. i am saving this value in database and when user accesses value from database, i want to display text in a format entered by user. i.e. if the user has entered some text in 2nd line then it should be displayed on second line and not after the end of first line in continuation. if user has entered tab in some location, the tab will be displayed while viewing data from database.
View Replies !
OOP Page: Where To Put Update, Insert, Delete
I have a page that shows info from MySQL. It is for an online education site. It uses different classes arranged in a hierarchy. Each lesson is roughly laid out like this: Lesson |-Intro | |-Section | |-Procedure | |-text, video, images | |-Section | |-Procedure | |-text, video, images | |-Summary I have all the classes working properly for displaying info from the database. Now I am building the admin site. Where should I put the update/insert/delete code? Would those go inside the classes? Should I use the lesson object when doing the maintenance? Or, should I just have a separate page that handles the database stuff and only use the objects to display the data from the database?
View Replies !
INSERT Data On Page Load?
I have an avatar system where certain avatars are locked until the user unlocks them by going to certain pages of the site. So far ( being the newb I am ) I only know how to INSERT data from a form. Is there a way to do it on page load or similar? I also need it to first check if the data already exists and if not it inserts the data and then displays a message to the user that they have unlocked the avatar. Code:
View Replies !
Traverse And Insert Page Breaks?
My website is going to host various and future pieces of my writing. Some of the pieces are going to be very long, so I need to split them up over multiple pages. I have an input form through which I can type or paste a piece of writing and have it inserted into MySQL. What I need now is to have PHP automatically insert page breaks before the piece is inserted. I was told I could use regular expressions, or I could use PHP to traverse the string and insert a page break, say, after 1400 characters so long as it ends on a period. I know of str_replace, but how do I set it go a certain amount of characters? This whole pagination thing has me completely stumped. I'm not looking to paginate display results. I'm displaying one result split up in pages.
View Replies !
Refeshing Page Duplicate Insert
I am creating a registration script for my site and it is posted to itself. The problem is that when all the information is inserted into the database and i display what you have inserted, like username and email etc. If i refresh the page then it tries to insert it all again flashing up a dublicate entry message. How can i get around this? I thought of a redirect but would prefere not to.
View Replies !
How To Simply Display On My Page Another Insert From A Different Table.
$judet = $_GET["judet"]; $result = mysql_query ("SELECT oras, id_oras FROM orase WHERE id_oras = '{$judet}' ORDER BY oras"); This is a piece of my code. The variable $judet is working perfect but i have a problem with another variable in the same table with judet witch i can't call.Everything from table orase works i just don't know how to simply display on my page another insert from a different table.
View Replies !
Howto Insert Picture Stored In Directory With Url In Db Onto Web Page?
If I read one tutorial more on how to store a image inside a mysql database I will blow my mind. I read everywhere on the forums to store the image on the harddrive and use the url in the database and then pull the image out of the directory and onto a web page. I am new to PHP and mysql but have looked now for two weeks on how to code a page to do this. It really has to be simple, so simple no one has taken the time to write a tutorial on it. There are lots, many, plenty, please no more tutorials on using BLOB to store an image inside a database. What is the code to pull a image from a dir. using a url in the db and put it on a web page, I have been trying my own ideas and not working....NO I don't want to use BLOB. darn thing with php, you can't see the code that does the trick...all I can see is the std <img scr="blab,blab,blab">
View Replies !
Stopping Another Data Insert When User Reloads Page
My PHP script inserts data into a mysql table that has been passed into it. My question is, what is the general method by which to ensure that if a user reloads the screen, the same set of data doesn't get duplicated into the database? For instance, I am inserting ticket data (its an ecommerce event system) into a mysql and really dont want duplicated entries if the user happens to press reload or back or whatever Any ideas?
View Replies !
Multi Page Form Question Concerning $id = Mysql Insert Id();
I am creating a multi page form. The code below is what I am using. However, I am having a difficult time having it post to MySQL under "pg2" where it posts to MySQL I have the function $id = mysql_insert_id(); to post the id from "pg1" post to the database. However it only post 0 which I think is due to it being in an array. Code:
View Replies !
Break After 5 In Loop
I just tried searching this on the forum but i couldn't find what I needed, i know there is a way to insert a break after a certain number of times a loop has been executed i.e. after every 5 times insert <br> But I've tried but the list is only having two per row:? PHP Code:
View Replies !
Php Break Command
I have a while look inside of a for loop and when i use the break command it stops boths loops. I am wondering if there is a way to only have it stop the while look.
View Replies !
Break Apart A Variable
I would like to know how I can break apart a variable. I'm currently passing the variable $id-hours and I would like to break it down. I would like to break down to something similar to: $eid = id (id part of $id-hours) $ehour = hours (hours part of $id-hours) Is this possible? I'm new to programming and just trying to get thru it all.
View Replies !
If Statement (break)
Can something be used in an if statement that works like a break; in a switch statement. I would like to exit the if statement and carry on with the rest of the script if a certain value is true e.g. if $var = 1 { exit if and carry on with script } else { [statement] } rest of script....
View Replies !
Case And Break
can someone give me a brief explanation or code example of what case and break do in php? and what about classes?
View Replies !
Break Up Article
I want to list the first three paragraphs from an article on a page, then have a link for the full article after the third paragraph. I am relatively new to PHP and know how to take care of this in ASP, but I am racking my brain of how to break it apart at the third paragraph. I have been playing around with the following, but to no avail. It doesn't break it off at the third paragraph. [php] <?php if ($RSMiddle1['Body'] != "") { $str = $RSMiddle1['Body']; $cols = explode(chr(13),$str); $i = 0; while ($i < count($cols)) { $PG1 = $cols[$i]; $PG2 = $cols[$i + 1]; $PG3 = $cols[$i + 2];
View Replies !
Break Apart Value For New Query
ok this is mainly me not knowing and understanding loops and me trying to do a loop inside of a loop i dont even know how to start but i have a table field that returns data like this: Code:
View Replies !
Price Break
Is there a way to make my shopping cart do price breaks. like i have a item for sale for 10.00 and if you buy 10 of them it goes down to $8.00 each instead of $100.00 each.
View Replies !
String Break
I am using basic tables and everyone knows if you type something like the following it will stretch the table to unbelievable lengths. Word: wert23rtw2tergwergwr83dty5754c7n53yv59t7vn358935yhmc5t735ytn75mcn73v5tv78935hym357tvm9357yhc3579thc4tgciwhomhegmvy2893589t3yvn59357y635nic9n5y I want to know if there is an existing function in PHP to break the word when it gets to a certain length.
View Replies !
Paragraph Break
I have searched through this forum but I've drawn a blank. What I want to do seems simple enough. I want users who fill in a text area to be able to include a new paragraph break. I have used HTMLSpecialChars for security reasons, and now, paragraph breaks disappear. I have in mind the posibility of asking users to enter something like --P-- and then have my script change that part of the string into <p>.
View Replies !
Break Word
I have a form, and i want to prevent words (inserted in a multiline textfield) to become too long. (So my lay-out won't be messed up) How can i detect after submitting if any word from the field is longer then e.g. 15 chars. If so, break it at the 14th char, add a dash, an continue at the next line. Code:
View Replies !
Break The String
I have a variable called $partno. It is in the form of abc1-DEF234. I want to retrieve only 1, DEF and 234(without leading zero if there is any) from the variable. How should I do it? For example: $partno ='USG2-PTR010' I should get the output of 2, PTR and 10.
View Replies !
Break Up Array
can someone send me to a tutorial that helps me breakup _POST results. I'm using a table that shows all information from a DB. The client wants a checkbox next to each that allows you to select a few then print them. I'm sending the ID number as the value for "Selected" to the action page, so I need to split each post up to grab again from the DB and print results out.
View Replies !
Break Loop
Trying to understand how the break statement works. If $x does = 0 will the below skip all statement in the while loop and start again at the top or just break out of it's own statement. while( $line= mysql_fetch_array($result, MYSQL_ASSOC)){ If($x=0){ break; } If($name="BOB){ echo $name; } }
View Replies !
Break A Loop
I want to get a 'security' trigger on a loop based on the time it has run. What would be the best way to do this? With 'break'? The loop is opening a file, but the file is on a diferent network, what is the way i take to place the break? Check time before open, and check time 'after'? I dont understand if the second check would happen even if the loop would.
View Replies !
Line Break
I have been making a newsletter script, but instead of there being a linebreak, there ends up being 's or rn's where the break should be without skipping a line. I have tried echoing the values of the variables for nletter and subject and returned rnrn Code:
View Replies !
Break Out Of IF Statement
This registration form checks for the submit button then displays the next form from the include statement. But before it displays the next form it will check to make sure the user has entered details correctly and give error messages of whats missing before displaying the original form again. My problem is that I can't exit from the 'if' statement, it brings up the first form as desired, but I can't get it to quit there. I tried using the break; function but it needs to be in a 'do while' sort of loop before it will let you break out of it. I tried putting the if statement inside a do while like this one do { if ($cond1) { ... } } while(0);.
View Replies !
Break Url Up Into An Array
I use the following code to call a flat text file to a php page. The flat file is a tab-deliminated file that was generated by a CMS. <?php $page = basename($_SERVER['QUERY_STRING']); if(!$page){ include('contentstandard.php'); } else { if(file_exists('pages/'.$page.'.txt')){ include('contentgen.php'); } else { include('nocontent.php'); } } ?>
View Replies !
Insert Values - Table Has Four Columns To Insert Into
I have a bunch of information that I want to insert into a table insert into TABLE values ('hello','I','am','lost'); pretend that the words that are being inserted are coming from a form for another page. In he case I above I have declared that the table has four columns to insert into. What if I do not know how many columns there are?
View Replies !
Insert Into Table - $query = "INSERT INTO Tbl
I have a small problem which I've been working on for a while. PHP Code: $query = "INSERT INTO tbl(username,ip,link) VALUES("Brin' . $result['id'] . '","$REMOTE_ADDR","http://www.domain.com/sub/start.php?username=Brin"' . $result['id'] . ' )"; mysql_query($query); Any ideas?
View Replies !
Line Break In Text Box To < Br >
I made a little form that allows me to post news. When submit is hit, it just writes to an html file. I want to know, if i make a line break in the text box when im entering news, how can i make that carry over to a < br > tag.
View Replies !
Break Down Multidimensional Array
I have a multidimensional array and was wondering how it can be broken down... Array ( [0] => Array ( [0] => Array ( [0] => 1 [intsch_id] => 1 ) [1] => Array ( [0] => 2 [intsch_id] => 2 ) ) ) And I want to break it down to Array ( [0] => 1 [intsch_id] => 1, [1] => 2 [intsch_id] => 2) And this is in a dynamic query, so the results won't always be this simple. It will have the same structure as the above multidimensional array.
View Replies !
Break Apart A String At Newlines?
I have a string variable, holding the results from a <textareaof a POSTed form. I want to create an array from this variable, with each element containing one line of text from the string.
View Replies !
Break Words, But Not Tags
I have data drawn from a mySQL DB. I used to massage the text like this: nl2br(wordwrap(htmlentities(stripslashes($entry["msg"])), 27, " ", 0)) Now i have a problem: i wanted pasted links to become real links. I found a script to do that... (on the bottom of this post) I have 3 problems: 1: The script doesn't recognise image links.... (*.jpg, *.gif, etc...), and i really don't have a clue how to fix this... It handles things like '*.php?parameter' well. 2: if i have a very long url, it distorts my layout, so want it to be broken, but of course not inside the tag, but only the 'visual' tag... I tried wordwrap, but that also breaks my tags..... 3: I want the visual part not to display the 'http://' part, but of course it has to link to that... Hope this is not too much... ----------------Code------------------ function makeClickableLinks($text_string) { $text_string = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_+.~#?&//=]+)', '<a href="1" class="bodylink" target="_blank">1</a>', $text_string); $text_string = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_+.~#?&//=]+)', '1<a href="2" class="bodylink" target="_blank">2</a>', $text_string); $text_string = eregi_replace('([_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3})', '<a href="mailto:1" class="bodylink">1</a>', $text_string); return str_replace(' target="_blank">http://',' target="_blank">', $text_string); };
View Replies !
Can't Seem To Remove Line Break..
In my PHP script I put a text file into a string. Part of that string is read, changed and removed. The while loop continuest to extract the next part of the string. This goes all fine with one exception. When there is a line break in the second string that has the extract of the first string, it cannot find the words I am looking for as it stops looking when it hits the line break. For example: string = why is that line break there string2 = that line break I am looking for "that line break", it can't find it with stristr. Which function can I use on the second string to have the line break removed?
View Replies !
Break Current Script, But Run Next
I have PHP set upp to ato_prepend and auto_append files to every script I run. So if I someone surfs to /index.php, these scripts run: init.php -> set up DB connections and stuff. Buffers output index.php -> The current page with it's layout, output is buffered. postprocess.php -> Fetches buffer, applies layout to page. Now, sometimes I want to break the execution of index.php (or whatever page that is in the middle). For example, when someone submits a form with insufficient data, I want to quit executing code and just put up an alert. But if I use "die;", then PHP will stop executing all code, it won't just stop executing the code in index.php. Is there a way to tell PHP to stop executing code in the current script, but continue with the next? I would guess that the same could apply to include()'d files, where I want the execution of the included file to stop, but the page that included the file shouldn't stop executing. I.e.: <? print "Hello "; include("world.php"); print "!"; ?> And "world.php" would in this case just output "World", but by using some method, I could just break the execution of world.php from within world.php (without using large IF blocks) and the result would then be "Hello !" from the page, and not "Hello " which happens if I use "die;" in world.php.
View Replies !
Line Break In Email
When using the mail() call, I formatted the message with " " for new lines. The text of the email ran together without line breaks. I also tried " " and that also didn't work. The email reader I am using is Outlook Express and is set to plain text. I checked the manual and it says to use " ".
View Replies !
|