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 Cut Text And Display It Plus The Remaining Texts


just wanna ask if there's a way I can limit the text length i wanna display and display the remaining text below...??

let's say here's my string:

$CallNum = $rows['CallNum'];

this contains : Q179:1546:554-abc

now i want to display this text like this:

Q179:
1546:
554-
abc




View Complete Forum Thread with Replies

Related Forum Messages:
Keeping Texts Outside Php Files
I want to keep all messages etc outside php to create a multilanguage site later. What is the best way to do this?

I was thinking of a session variable language, and call the text output with a function that receives the messageid and language id and so returns the text.

Is it wise to store all these messages in mysql or inside the function (if messageid=1 etc)? Does it make a difference in speed if the function handles all or if the message content is received by mysql query?

View Replies !
Store Texts In Quotation
I have a mysql database and i wanted to store texts under quotation. i used the addslashes() function so that the quotations will also be stored. But this function adds too many slashes before the text (eg. \"Agriculture and Development\"). When i try to display the text that is stored in the db, it creates disorder on my page.

View Replies !
Delete Specific Texts From File
The text file is in variable length. We can't point to where to delete. But there are texts we want to delete in the text. How can I do ?

The only way I can think of is load entire file, match the text we want, replace the text, and then rewrite the file. Is this way correct ?

View Replies !
Display Some Text To The Screen Via A Link To The Text In A Mysql Db.
I am just screwing around a little and trying to display some text to the screen via a link to the text in a mysql db.

View Replies !
Read And Display Japanese Text From Text File
I posted a question regarding reading japanese
text from a text file.

Well, since I solved the problem, I thought I'd post my solution for
the benefit of other people with the same problem.

The plan was to make a script to read and display japanese text. I
will use it for making a japanese proverb script and for a japanese
language study script.

Method :

I wrote a simple kanji text file (saved with UTF-8 encoding)
I wrote a simple PHP script to display the file contents (saved with
UTF-8
encoding)
I specified the content-type header for the HTML page :
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

*** All files have the same encoding. ***

UTF-8 supports japanese characters.

and it works!

this is my PHP (and HTML) script :

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PHP : Japanese Text File Read : Exercise 1</title>
</head>
<body>

<?php

$filename="japanese.txt";
//open file
$fp = fopen($filename,'r');

//loop through each line in the file
while($line=fgets($fp))
{
//output current text file line
print $line."<br>";
}
//close file handle
fclose($fp);

?>

</body>
</html>

I know it's a very simple script, for testing purposes only. It
displays the contents of the japanese text file line by line.

The key was to save all files in the same encoding (I used UTF-8) and
to specify the encoding / charset in the HTML header (<meta
http-equiv="Content-Type" content="text/html; charset=utf-8">)

View Replies !
Generate Random Warped Texts (images).
I am asked to write a code to generate random warped texts (images). Something similar to wut you see at the bottom of a Yahoo! user registration page to provide user authentication. Someone tell me how to convert a text into a warped image. I'd be very happy if someone can directly gimme the code.

View Replies !
Time Remaining
I've searched the forums for a solution to this problem but can't find one that matches my needs.

I'm wanting a time remaining counter to show when a item placed on a market ends (similar to ebay).

I've set when the item ends as a future timestamp, now i need to calculate how many days, hours and minutes are left until that time, i can't figure it out.

View Replies !
Days Remaining
I want to find out number of days remain from birthday(any other day).

View Replies !
Remaining Value For Select Option
i've used $_SERVER[PHP_SELF] , so my form and script are just one file .
when a user click the submit and have some errors the sript reload again ,
for a reloaded script i've put :(for exaple)

<input type="text" name="username" value=$_POST[username] />

so when it reload the last information the uer has typed won't be delete.it stays.

i want to do the same with my "select menu " , i don't know how , the select menu reset when script reload :(example)

gender :
<select>
<option value="">select one</option>
<option value="m">male</option>
<option value="f">female</option>
</select>

View Replies !
Number Of Days Remaining
Im wanting to let users view something for 3 months from the date of joining, after this time it will be disabled and they will have to upgrade to get access again. I have read the information in the manuals regarding TO_DAYS but still cant firgure it out:PHP Code:

SELECT m_usertype, TO_DAYS(DATE_ADD(m_joined, INTERVAL 3 MONTH))-TO_DAYS(NOW()) as days_left FROM members WHERE m_id = USERID

How do i correct this?

View Replies !
$_POSTs Remaining Empty?!
In writing to the flat file, only the ||||||s and the date function are being passed through. For some reason, the $_POSTs remain empty, or at least don't 'write'... I have tried different ways of building the $line variable but...nothing Code:

View Replies !
Create A Dropdown Of Remaining Months
I am attempting to figure out how I can do the following:

Take a date from a MySQL database like: 2006-06-01 (June 1, 2006)
Then have a dropdown list of remaining months using for example todays date of 2005-08-23
This would product a dropdown like:

1 month
2 months
3 months
4 months
......
10 months

View Replies !
Enter A New ROW After 3rd Image For 5 Rows And Then New Page For Remaining Results
I want to show 3 images per row and show 5 rows per page, that would be 3 images X 5 rows = 15 images. per page and then press next to go to next page to see if there are more images for that user. This is a script for making two users friends of each other. Code:

View Replies !
Text File Display
I have a number of SQL reports that create standard 132 column text files. The user wishes to view these files in a browser in addition to their daily printing on a laser printer.

I can handle directory structure, etc with PHP but I would like to know what is the best way of displaying these text files on screen. We can select them but they are very plain. Is there a TXT2HTML ot TXT2XML type tool that can display headings, bolding, etc without too much difficulty. I would rather not reprogram the reports as there are hundreds of them, and embedding HTML would not be an answer as they need to be printed on a regular laser.

View Replies !
Using PHP To Display News Text
I downloaded a php script from hot scripts called Blue Boy Whats New. I really like what he's done on his site for displaying news items.

I got the admin part working and can add and edit news items. I can view the page created
bb_news.php3, but when I try to include the php3 file in my home page nothing shows up.

View Replies !
Japanese Text Display
I have Japanese data coming from a mySQL database. It's internal encoding is EUC-JP and it is outputted as SJIS. This actually works just fine. My question comes from the fact that once these changes were made, all the static Japanese text on the page is botched. The meta tag in the head is set to Shift_JIS(SJIS) and it worked before the change.

Any suggestions? I just can't see how the two match up... The encoding of the db info shouldn't affect the encoding of static info on the page should it? Especially when they are both output in the same encoding..

View Replies !
Display Html Text From DB
I've got a text box and basically the user types text in html format, I then use htmlspecialchars to convert special characters to HTML entities, fine not a problem I then store the text in a DB with the HTML entities in place.

However when I want to display the text from the DB it still has the HTML tags in place and would like to render the HTML so to speak, how do I implement this? Sounds straightforward but need some pointers.

View Replies !
Display Text From Notepad
i'm using a script that displays news from a .txt file (greek characters) but when i run the script it doesn't display those characters. is there anything i can do to fix that?

View Replies !
Display Text In The Top Of The Browser
I use php to serve most of my documents using:

header('Content-type: application/pdf-or-rtf');
readfile($file);

For non html documents such as PDFs I would like to be able to show the title of the document in the top of the browser (the blue bar for most people). At the moment it shows application/pdf . I found that there are many possible header informations we can add to a document but none of them work . The ideal thing would be something like:
header("Title: ".$document_title); but that does't work .

View Replies !
Display Text Along With The Image
I am doing some work on one php page that is generating an array. Then I need to pass that array to a second page that then uses the info from that array to output an image.

However I would like to display text along with the image, so someone told me I needed to include the following line in the page with the outputted text: <img src="image.php/id=$imagenr">. But if I do that, how do I pass the variables to image.php?

View Replies !
Shortening Display Of A Text
Is there a good way to make a long database text displayed shorter once published on a site? For instance; "Hello my name is Johan and I love icecream with sausages" shortened down to "Hello my name is Johan...".

View Replies !
Display Images In Text
I'm pulling some text from a database, and currently I have a function that checks through the text and changes <i> to italic and <b> to bold, etc. standard stuff.

I would like to use a function that checks through the text for, say:
<img photo1.jpg> and changes it to:

<img src="http://www.mywebaddress.com/images/photo1.jpg">

View Replies !
Display Text On Images
I have an image using the:

<img src="">

standard image html notation. How would I create an image that displayed text echoed using php. For example I would like the result of:

echo "hello world"

to be displayed on my image?

View Replies !
Display Specific Text
if there is a way to display only certain text contained in a mysql cell. For example, could I only display text located between certain characters such as * or something like that? But leave the rest of the text in the cell undisplayed on the webpage.

View Replies !
Display A Text File On A Web Page
I have a text file that I am trying to display on a web page. If I cat
or more the file it formats and displays fine. When it comes up in the
browser it seems to loose tabs and the format gets messed up. This is
how I display the file.

$show = file("./fields/combined/$cdp$store");
$arrayitems = sizeof($show);
$x=0;
while ($x < $arrayitems) {
print("$show[$x]
");
$x++;
}

If I edit the file it has ^M at the end of each line if it matters.
Does anyone have a better idea as to how to display it?

View Replies !
Display Text In Firebird BLOB
I have a Firebird 2.o Database. When I display the text content of a BLOB field, I get the following result.
{
tf1fbidisansiansicpg1252deff0{fonttbl{f0fswissfprq2fcharset0 Helvetica;}{f1fswissfprq2fcharset0 Calibri;}{f2fnil MS Sans Serif;}} {colortbl ;
ed0green0lue128;} viewkind4uc1pardltrparqclang1033f0fs22 DURBANVILLE CONGREGATIONpar DEDICATED 28TH NOVEMBER 1999par.

I use ibase_blob_echo to return a result. How can I get the result to display witout the rtf characters.

View Replies !
Display Code As Plain Text
how to display code as plain text on an html page? I've tried using <PRE> and <TEXTAREA> but that isn't working. <LI> is still transformed into a bullet, and other things like that keep happening. <TEXTAREA> just makes it look really messy. Basically, I want something exactly like this: PHP Code:

<?

if (isset($_POST['submit'])) {
  echo "This is exactly what I want to do.";
} else {
  echo "Dangit. I can't figure it out.";
}

?>

View Replies !
Display Text Or HTML Emails
I want to be able to display emails in a web page whether they are text, HTML or both. Does anyone know of a PHP script or function out there that will parse the original email and display it properly?

View Replies !
Random Picture Display With Text
I want to display random picture from folder with text for each picture like caption.

View Replies !
Display Text Inside Image
I created a image using

<?php
$pic=ImageCreate(20,100);
$col1=ImageColorAllocate($pic,0,0,255);
$col2=ImageColorAllocate($pic,0,0,255);
ImageFilledRectangle($pic,1,1,100,100,$col2);
ImagePNG($pic,"pic.png");
ImageDestroy($pic);
?>
<img src="pic.png" border=0>

i want to enter text inside the image. at present it create a blank image.

View Replies !
Display Results From Text File
I use a string, eg "&&&" to mark pages in a text file. how can i display the contents of this file in multiple pages (by identifying the above string or any other method).

View Replies !
Read And Display Text File
I have a web site that has a text file indicating the results of golf, tennis, and swimming events. I would like to scroll those results on the web page by reading the text file and simply scrolling it to an area on the web page.

View Replies !
Text Display From My MySQL Database
There is also an id field that's an INI auto_increment. When I select the rows and try to display them, it appears as nothing. There are no error messages, but it just displays as nothing instead of the message in the MySQL database? What's wrong? PHP Code:

<?php
include "db_connect.php";
$id = $_GET['id'];
$sql = 'SELECT note FROM `notes` LIMIT 0, 30 WHERE id=$id'
$result = mysql_query($sql);
echo "Notes:<br><br>$result";
echo "ID #: $id";
?>

View Replies !
Storing Some Html Text In Database & Display Them
i have some text in HTML format ..i just want to store HTML text in database and retrive and display them as a HTML ...

View Replies !
How To Display Text On Browser After Forcing Download
how do i display text to my browser after i force a download? heres my working script:
Code:

$selected_file = "/home/user/somelogfile.log";
header("Content-Type: text/plain");
header("Content-Disposition: attachment; filename=" . $_SERVER[HTTP_HOST] . "_" . $selected_file);
header("Content-length: " . filesize($selected_file));
readfile("$selected_file");

what i want to do is display some text in my browser, but if i echo something after readfile(), it gets included in the download file, while i also cant echo before the download as headers need to be sent before any text .

View Replies !
Display MySQL Data In Text Field
I have my site set up and am now working on the admin side. I have a page that lets me search my users then its linked to another page so I can edit the information.

I am attempting to get the code to display in my forms text boxes and text areas for updating. My problem is that I can't figure out how to get the data into my form for editing. I have a few different things but can't seem to figure this out.

View Replies !
How Can I Display Text If A Field In A Table Is Empty?
I want to display some default text in case the data is not yet inserted into two specific rows in my table. So I need to check to see if data exists, and if not, them display some text.

The data being displayed is an MOV file and some comments about that movie. I would also like to not render the box for the movie if that data is missing. Right now, I am using an echo to embed the MOV files, and within the path is the call to the specific file in the table. But if the data is not there, I just get a blank box. Code:

View Replies !
Store And Display Information In A Text File
I want to make a script that records the users that visited main.php into a file called visitors.txt and displays it on a page called views.php. Here's an example. Let's say the link is 'http://perks.mypimpedlayout.com/profile/main.php?screenname=persons_sn'. I want to store 'persons_sn' in visitors.txt and display the users on views.php. Help would be appreciated.

View Replies !
Read A Text From Any Image Then Display It To The User.
Is it possible to read a text from any image then display it to the user.
if yes how ???

View Replies !
How To Display A Gif Image On A Webpage Along With Text With The Readfile()
I am trying to display a gif image, part of an image verification on a form conecealing the location of the gif file, on a php webpage, but along with other objects especially plain HTML (text).

The following code saved in a file displays the image fine.

<?
header("Content-type: image/gif");
readfile("image.gif");
?>

However as soon as I add some text like this it stops working, why? Yes I know it must have something to do with the dreaded header I suspect I have to add the html <img> tag somehow.

<html><body>
Gif image test using php function readfile()
<?
header("Content-type: image/gif");
readfile("cgi/verification/1.gif");
?>
</body></html>

View Replies !
Identify Url Written In Text Area And Display It Hyperlinked.
I am using html textarea control. user writes text in text area and i save it in database using php, then i display it where ever it is required. I want if user writes some url in the area like www.abc.com or http://www.abc.com , When i display this text as output this url must be shown there as hyperlink. by clicking over it user must be redirected to www.abc .com

Is there any html textarea control property that can do it, or i need to write some php or javascript code for it. If someone has php script for it please help. It is urgent.

View Replies !
Display Text/image At Certain Times Reading From A Mysql DB
Im after a php script that will display a presenters name on my website at a certain time and day... I am designing a website for a fm radio station. Now this needs to read from a DB as some presenters move shows etc etc.. So it needs to be easy to edit the schedule. Code:

View Replies !
Display Results From Text File In Multiple Pages
i use a string, eg "&&&" to mark pages in a text file. i use $count to count the above string. how can i display the contents of this file in multiple pages (by identifying the above string or any other method)?

View Replies !
Display The Text That Single Quotes Get Replaced With Question Marks
not sure if any one has had this problem before. I have for example

insert (text) VALUES ("'.$_POST['text']. '"); - it seems when i display the text that single quotes get replaced with question marks does this have to do with collation or magic quotes or something entirely different?

View Replies !
Can We Display Text In Form Of Wave As Shown In Gmail Forgot Password
https://www.google.com/accounts/Ren...aForPasswdReset , here characters are shown in wave nature.

View Replies !
Getting "true" Number Of Days Remaining ?
im writting a script, that alerts me when a set number of days are remaining to an event...(which im fine with!!!) The problem that i have, is the way that im getting the remaining days, the script is dividing the results by the number of seconds in the day...

So say that today is the 3rd July and the alert is excuted at 1pm, the the script will return 1 day, if say the event was on the 5th July....logically thinking it would return 1 day, but phyiscally there are two days remaining. PHP Code:

View Replies !
Getting "Days Remaining"
I have written a program that gets the date, and compares it with a "Sale Date". If the current date is before the sale date (November 22nd, 2007), it will print "Sale is on!". If it is after, it will print "Sale is over...".

$freestuffdate = "22-11-07";
$today = date("d-m-y");
if ($freestuffdate >= $today){
echo "Sale is on!<br />";
}
elseif ($freestuffdate<$today){
echo "Sale is over...<br />";}

I am wondering if there is any way to make a code that prints out how many days are left until the end of the sale. How can I tell PHP to subtract $today from $freestuffdate, so that it tells me how many days are left from the current date and the sale date?

View Replies !
"Stupid" Display Multi Line Text
I need to display text from database witch has couple paragraphs. When i drop it on the screen it shows up but it seems like there is no wrap on it, it is all in continues line.

When i look in to database or try to update it with update record is showing up as multi line, just how it should be. Code:

View Replies !
Image Display Doesnt Display The Entire Pic Just The $xhead Value.
i have this issue:
showpic.php
================================================
$ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $xmyurl);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
// Getting binary data
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$image = curl_exec($ch);
curl_close($ch);
header('Content-type: image/png');
$xim=@imagecreatefromstring($image);
$xbase = @imagecreatetruecolor(130,168);
$xback=imagecolorallocate($xbase, 255,255,255); //green
imagefill($xbase,0,0,$xback);
$xhead=@imagecreatefrompng('xhead.png');
imagecopy($xbase,$xhead,10,0,0,0,108,28);
imagecopy($xbase,$xim,0, 28, 0, 0, 130,140);
imagepng($xbase);
================================================
then i have this code to display the pic:
echo'
<font color="#FF0000" size="4">Congratulations!!!</font><br>
<span style="font-weight: 400"><font size="2">
<font color="#000000">Here is your pic ;-)</font><br>
</font></span>
<img src="showpic.php?xurl='.$newurl.'">
'
the issue is, on my machine both on ie and ff the image display
perfectly.
however on some machines it doesnt display the entire pic just the
$xhead value.

View Replies !
Display 10 Records Per Page And Then Display Links To Next Pages
I have been trying to display 10 records per page and then display links to next pages etc but I can't seem to get it to work. Code:

View Replies !
Quickly Adding Text To A Mysql Text Field That Is NOT Empty
Is there a way to insert text into a mysql text field that already has
text into it; without having first to extract the existing data and
append the new text to that string variable and then insert the new
string.

Basically i'm looking for a way to do it with a single query not 2 (one
being a select to gather existing data).

View Replies !
Rich Text Editor Which On Submit Updates The Field To Have The New Text
I have my content stored in a database. I need a rich text editor (so the user doesnt need to include HTML) so they can edit contact. So a rich text editor that displays whats in the current content field and can be edited so on submit it updates the field to have the new text. Get what i mean?

View Replies !

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