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 Complete Forum Thread with Replies
Related Forum Messages:
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 !
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 !
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 !
Warp When Text Reachs The End Screen
I am getting a user to enter in some information through a textarea in a form. But later on when I come to access it I find that when it appears on the screen that it's one big line. I would like the text/line to go down to the next line when it reachs the end of screen. So how would I go about doing this?
View Replies !
Text File Displaying On Screen
I have a file that downloaded a CSV file for the user based upon some information gathered from the Database. My file was working fine until recently (I believe that my hosting company did something when they upgraded to PHP5). Everytime a user tries to download the file, it displays the contents on the screen. Here is what I have for my file handling. Am I missing anything obvious? when called, $filecontent is displayed to the screen... $downloadfile=$shownic."AttendeeRoster".time().".csv"; header("Content-disposition: attachment; filename=$downloadfile"); header("Content-type: text/css; charset=UTF-8"); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".strlen($filecontent)); header("Pragma: no-cache"); header("Expires: 0"); echo $filecontent;
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 !
Gaining Access To How MySql Parses Text For Full Text
I want to gain access to the function or process MySql uses to parse words and phrases for Full Text searching. Here is an example. If the user inputs... Milan in history MySql will search for milan, history, and milan history. Is there a way to extract just the combination of terms MySql uses to search the db without the stop words? Stop words are automatically eliminated from the search request unless the user encloses a phrase in quotes. What I am trying to do is develop a script to highlight found search terms and phrases. I can explode a phrase into single words but if I do that the stop words would be included in the array. If there is some way of getting into the parsed words or phrases MySql Full Text actually uses to search, I can use each of those combinations as a keyword in my highlighting script. This request is about searching for the code or any code related to the questions involved.
View Replies !
How Do You Query A Db From Link Text?
I was wondering how I would go about doing this. I would like to return some items from a database depending on what a user clicked. I would like to just use the link text that was clicked on. Then I would search through one field in each record to see if it matched that text, if so, I would display it. I'm not sure how I could give each link a value though. I would like someway to get the link's text and use that to search a database. Thanks in advance for all the help!!!
View Replies !
Converting Www Text To A Link
Does anyone know how i could check some inputted text and see if it had a www.url.com in it and if so wrap it with: <a href="http://www.url.com">www.url.com</a> It would need to do .com .co.uk .ie etc I think its something to do with regular expression but im not sure.
View Replies !
Clicked Link Text
I have created a table on the fly from mysql while($row = mysql_fetch_array($query)) { echo "<tr>"; echo "<td class='body'><a href='#'>".$row['au_id']."</a></td>"; echo "<td class='body'>".$row['au_fname']."</td>"; echo"<td class='body'>".$row['au_lname']."</td>"; echo "</tr>"; } is there anyway of getting the current clicked au_id? i would like the user to click the id to display more information but I'm unsure how to get the currently clicked id...
View Replies !
Formatting Text - Read More .. Link
I am currently looking for a way to have text that is entered in my news service (it is added to a databse, then displayed) to be cut off after a certain length on some pages (mainly the front page)...kind of like what you see on some sites with the "read more" at the end. I want it so i could enter a long news/article update, then on the home page it would be shortened, and when the user clicks on the title, it takes them to the detail page with the full length article. I am using dreamweaver, if that makes any difference.
View Replies !
Automatically Make Text Into A Link
how do I make php search through a $_POST[variable] for a certain set of string, lets say R1000000. Then I would want to turn that string (R1000000) into a link <a href=example.php?id="R1000000">R1000000</a>Then append that link back into the original $_POST[variable] replacing the R1000000, with the link version. I'm sure this is doable, I just have no idea where to start, regex?
View Replies !
Make Link To Typed Text
Is there some possibility in PHP to do automatic link when somebody type URL in form window? (One or more URL in one text.) example: www.xxxxxxxx.com to be a <a href="http://www.xxxxxxxx.com">www.xxxxxxxx.com</a> (as I think, maybe I can do that with chage string when query returned from database, but I must to know how he typed in database in text: only "www..." or begin with "http://www...".) Is somebody have a script how can I change strings?
View Replies !
Removing URL Link From Text Field
How can i remove a URL link from a form text field or the area where results are posted when a user enters http://www.mywhateversite.com. For example, here on this site. I want to allow the text, but not the link. If you guys are familiar with myspace and have tried to put a link to another site, the myspace site automatically changes it to something else or blank. Thus allowing the user to post the site url, but without the link.
View Replies !
Command Button To Text Link
i'm trying to format a little code i found on hot scripts and have run into a problem trying to replace the submit button with a text link that will do the same thing. here's the code. <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>?do=add"> Email Address: <input type="text" name="email"><br> <input type="submit" value="Submit"> </form> i just think that links look better than buttons.
View Replies !
Text Link Form Submit
I'm trying to make it so instead of an image submitting my form, its just a plain text link. The problem is any of them I have tried using either done work, or if they do im stuck with a big text input box. Basically I need to submit the value of a variable $page. The script itself determines what the variable value will be when I press the button, I don't need to type it in. How can I do this?
View Replies !
Passing Text String Through Link
I am creating a setup where a user can return to their last search results after editing a file within those results, and I've done this by passing the mysql query string through the URLs of links. The problem I think I'm having is that this text string contains spaces (ie: $string = "SELECT * FROM...") and this creates a funky URL (search.php?id=1?string=SELECT * FROM. that the browser chokes on. The first value gets passed but the second is lost. Do I need to encode the value of $string somehow to get it to pass to the next page?
View Replies !
Creating A Link Inside A String Of Text
First I want to grab a string of text from a database like so, $query = "SELECT text FROM $database WHERE id = '$id'"; The text will look something like this, echo "This is some text about widget nuggets and how they work"; What I want to do is put the word "widget nuggets" inside a function that will turn it into a link like this, echo "This is some text about ". link( 'widget nuggets' ) ." and how they work"; My first thought on how to approach this would be to add some type of identifier around the text in the database I want to be turned into a link like so, "This is some text about ^widget nuggets* and how they work" What symbols would you use? What symbols are allowed in mysql? Anyway, now that i've marked the text to be put inside a function what would be the best approach to searching the string for this text? My current thought would be to count the length of the string and then do a substr search for the occurences of the characters and insert the function call in the appropriate places. I am also thinking about preg_match but I am thinking there is a better and more effecient way to do this.
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 !
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 !
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 !
How To Change Template Menu Link Text Color For Page Currently Viewed ??
Say you have a left menu that stays the same on every page within in your site. Obviously you would make this menu a template or library item, so that when you edit one version, all the others are updated. Let's say the left menu is the following: Page_1 Page_2 Page_3 Now, when I am viewing Page_1, I want the "Page_1" text in the left menu to be red, so that the viewer knows what page they are on. When I click on the left menu link for "Page_2", then I want the "Page_1" text to go back to black and the "Page_2" text to be red.
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 !
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 !
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 !
|