HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 29th, 2000, 05:54 PM
colin_anderson colin_anderson is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 41 colin_anderson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
I'm using PHP to send variables to another page using a simple <input type="text" name="whatever" size=60"> input tag. However, when the info in that is transferred to the next page (to show what the user has entered), if it's too long, instead of wrapping the code on the second page, it keeps going and completely screws up the page. What can I do to make if wrap on the second page?

Reply With Quote
  #2  
Old October 29th, 2000, 11:40 PM
Ripped_edge Ripped_edge is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 4 Ripped_edge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
if (strlen($mystring) > 40) {
$firstline = substr ($mystring, 0, 40);
$nextline = substr ($mystring, 40, 80);
}
echo" $firstline<br>$nextline";

Use that basic concept but with a while loop. (The above won't work)





Reply With Quote
  #3  
Old October 30th, 2000, 06:48 PM
colin_anderson colin_anderson is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 41 colin_anderson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
I apologize for this... but could you give me more information on a "while" loop?

-Colin Anderson

Reply With Quote
  #4  
Old October 31st, 2000, 10:02 PM
Ripped_edge Ripped_edge is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 4 Ripped_edge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
while ($length > $mylength) {
$do_stuff
}
In this case as long as $length is less than $mylength $do_stuff will continue to happen, be it once, twice, a million times. Take a look at http://www.php.net/manual/control-structures.while.php
So you would want a while loop. Somthing like:
$length = 40; // How much on a line
$end = 0; //start point
while (strlen($mystring) > $length) {
$line = substr ($mystring, $start, $end);
$start = $start + $length;
$end = $end + $length;
echo" $line";
}
But no gaurentees that that 1)works or 2) is the easiest way. But thats close to what I would do.

------------------
Ripped_edge
-----------
Senior Web Content Engineer
VP General Obfuscation
VP World Domination Division
-------------

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Form formatting - wrapping the data


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT