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 Complete Forum Thread with Replies
Related Forum Messages:
HOWTO: Output A Picture In The Middle Of A Page
I want to generate a web page using PHP, and in the middle generate a graphic I read from another server. So the graphic is in $picture. So I can either write $picture to a temp file and then use an ordinary <img src=filename> to get the browser to display it, or output it by itself in a new page, because then I have a chance to output the correct header so I don't just get garbage on the screen. Evidently first approach is poor because I have to write a local file, and second approach is not what I want anyway. Is there a way to do this? That is, I have $picture that contains an image, and I want to output it here and now in this HTML page I am in the middle of creating, and have it show as a picture.
View Replies !
Echoing Picture Stored In DB?
How would you echo pictures (specifically .jpg, .png, or .gif file types) stored as a blob in multiple rows in a MySQL database? I've tried doing it, but it gives me is a red X. I'm trying to build an online photo hosting service that lets you create an album, but I'm struggling. Can someone help me?
View Replies !
Resize The Picture Before It Is Uploaded And Stored On The Server And Db.
I have found this script to resize the picture, and what I am trying to do is resize the picture before it is uploaded and stored on the server and db. Below are the two scripts, the first one uploads the files and stores them, but the second one I got from here http://uk2.php.net/imagecopyresampled to resize the image before it is uploaded. I have tried for a while now to configure the second script ......
View Replies !
Howto Images From A DB To A Web Page
I am in a hurry to learn this so I am looking for a tutorial that shows how to upload the info in the database and then use php to load the images into cells of a table on a web page. Sort of like a gallery but for displaying products. I am studying how to make thumbnails for the main page and allowing a user to click on it or a link and open a new window with the larger view of the product. I am sure this has been done a hundred times on the net but it is new to me. Anyone know of some good tutorial on doing what I am talking about.
View Replies !
Insert A Picture In Doc
I want save a html(or php script) into word format,this word document must have pic.if am tring to save a text or picutre only its perfect,but tring to save both picture and text,it's dosn't work.what am do?,(if possible in com pls sent code,and it's save with html format not in text).
View Replies !
How To Insert Picture In Echo Statement?
is it possible to have an image in an echo statement? this is my echo statement >> echo(" <fieldset><legend>Success!</legend> Your application form has been successfully stored in our database.</fieldset>"); i want to put an image in the echo statement. i have tried using <img src="Desktop/pictures.is.best/scs.jpg" width="176" height="83" /> in the echo statement, but still, there are no image in the browser. can someone tell me how can i insert an image in the echo statement?
View Replies !
Insert Date Into Database, Values Stored As Array
how to insert a date into a database. I have it working where if it is typed into a text field in a form, but i want it to work with a select box. There are 3 select boxes, month, day, and year, and each value is put into the same array. Up at the beginning of my code i have my update and insert querys. Everything works, but i just can't figure out how to get the information from the select box array into the database, it just gives me 0000-00-00, so something is wrong. I guess its just that i dont know how the correct syntax for arrays in the query if i'm using $_POST, since no variables are defined.
View Replies !
Using The Same Page To Display A Hundred Pictures One Picture At A Time
I have over a hundred pictures I would like to present. Is it practical to create and parse an array of pictures, picture paths, et al using server-side scripting to accomplish this? I created an array already, and whereby, the HTML and Javascript currently used amount to about 14KB for each of four different pages, the PHP page I started working on is already over 35KB in size (most of it is server side processing creating the array of pictures). What I'd like to do, is load the array only one time, and keep that loaded so the page doesn't recreate the array each time, thus minimizing the server side array creation. Also, I think I'm running into some problems whereby the javascript is messing up Google's parsing of the page. I don't see creating 100 different html pages as an answer, in the respect if something ever changes, that's one big mess to update and major portion of the content and alot of files. Am I wrong in trying to avoid doing it via strictly HTML pages? The pages exist at, and they represent swimming pools designed by the owner of Aquatic Creations (North Carolina In-Ground Swimming Pool Designers): Custom Swimming Pool Water Features http://aquaticcreationsnc.com/lib/php/viewing0.php Custom Designed Swimming Pools http://aquaticcreationsnc.com/lib/php/viewing1.php Custom Designed Spas http://aquaticcreationsnc.com/lib/php/viewing2.php Custom Swimming Pool Features http://aquaticcreationsnc.com/lib/php/viewing3.php Stone And Tile Around Swimming Pools http://aquaticcreationsnc.com/lib/php/viewing4.php Does anyone have any suggestions on how to accomplish such or directions to pursue? If you could take a look as well and provide comments on the pages, I appreciate constructive criticism as well.
View Replies !
Upload_tmp_dir - Upload Files Stored In The Same Directory With Upload Script
I have a problem when I upload files: if try to upload files stored in the same directory whith upload script it is ok, it uploads them on the ftp. IF I select a file from another directory than the one with tha php script I get an error: uploadPHP Warning: ftp_put(langtxt-update.sql) [function.ftp-put]: failed to open stream: No such file or directory in D:Atlanticmooncollaudiftp_upload.php on line 35. I tried to set the upload_tmp_dir in the php.ini to c/Windows/Temp/ - that is the default. I tried phpinfo() and it is set. Trying $_FILES["file"]["tmp_name"] I get the correct path. After many tryes to understand why I get an error, I changed again upload_tmp_dir, hit an phpinfo() and it changed. At $_FILES["file"]["tmp_name"] in the script I get the default: windows/temp. What is the problem?
View Replies !
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 !
"next" Page Howto?
Can anyone help me out by either telling me how to get to the result i need or by pointing me to some documentation about the following question: A certain query to a database give me eg 100 results: $query = "select id, name, addr1, addr2, city from mytable where id=" ..$id; $connection = mysql_connect(etc etc) .... Then: <table> while ($result = mysql_fetch_array($connection)){ <tr> <td>echo $result['name]; </td> <td>echo $result['addr1']; </td> </tr> } </table> This all works well, but will give me all eg 100 results in one webpage. What i want however is max 10 results per page, and then a link in the bottom of a page with "next" reloading that page but then displaying result 11-20 etc etc. Now i've been puzzling about that the last couple of days but i just can't get that to work. Anyone any suggestions / links / idea?
View Replies !
Adding Stored Month Value To Stored Date
i have a simple problem where i wish to add a number of months, stores in a database field to another stores value that is a date .data base is MySQL and the date is in YYYY-MM-DD format. The month field is simply a variable, interger 2 digits. I have tried the adddate function in MySQL but it does not seem to take a variable as a interval field.
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 !
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 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 !
Particular Directory / Page
I'm using PHP 4.4.4. In our php.ini file we have notices and warnings turned off. However, I would like to enable them for a small subset of pages. I know the pages specifically, but I would also settle for enabling notices and warnings for a certain directory.
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 !
Restrict PHP Page To Only One Directory
I am trying to restrict access of PHP script to a single directory only. How can I do that? I am running Apache 1.3 and PHP 4 in Linux. I think I need to use the Directory and SetHandler directive right? Something like: <Directory /php/enabled/directory/> SetHandler ### what's here? ### ### ### anything else here? ### </Directory> Currently the way it's set up now is that PHP can be placed anywhere below the doc root but I am trying to avoid that. I only want PHP to go in one directory.
View Replies !
How To Fix URL And Redirect The Page To Other Directory?
I want to keep the URL fix in the address bar and redirect the page to a different directory.how can i achieve this. say for example-my URL is http://www.example.com ,I want to keep this fix but I want ,if someone clicks on this URL he will see the page of some other directory like - http://www.example.com/home/. but in the address bar the URL will be shown as http://www.example.com how can i achieve this.please help me to solve this problem.
View Replies !
Directory Onto An Index Page
I'm just looking for some simple code that will take the contents of a directory, say /junk and print them onto a page for me, like junk.htm, so my friends have easy access to files I post.
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 !
Protect A Directory With An Interim Page
I was wondering if anyone had any ideas on how to accomplish this bit of php Programming. What we need is to essentially protect a directory with an interim page. The interim page would have a form asking a yes/no question. For example: What we have now.. / --> /protected_dir/ turns into this: / --> interim page (with form) --> /protected_dir/ Optimally, when a person requests a file in the protected directory they would be redirected/prompted by the page with the form on it. Once they answer the question and hit "Submit" they would then be redirected to the page they intially requested. I've tried. htaccess and $HTTP_REFERER but have had no luck. The $HTTP_REFERER is always the page with the form.
View Replies !
Web Desktop Howto?
Just wanna gather your inputs and ideas on how to create web desktop/os? I've all been asking Mr. Google but no reliable source results to it.
View Replies !
Variable Howto
I have this in a .inc (include file): <title> <?php $page_title; ?></title> in the php page I have this: <?php $page_title = 'Reidsville Christian Church' include('./include/template.inc'); ?> I'd like to do the same for the .css file to include in the php page. Something like this: In template.inc <link href= $page_css rel="stylesheet" type="text/css"> In index.php <?php $page_title = 'Reidsville Christian Church' include('./include/template.inc'); $page_css = 'index.css' ?>
View Replies !
Sybase Howto?
i want to connect to Sybase server (win2000) from remote workstation (winXP) to do SLQ query. Both PC are in same local network. How do I do that? As I understand I install xammp or wamp and try to write php code. Am I right? or i have to install aditional drivers to Sybase server? Or what?
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 !
Usenet, Newsgroups Howto ?
I would like to know how to get threads from usenet newsgroups and paste them on my website. Also how to create new threads in the newsgroups and how to reply to those that are already there. Is there any source available on the internet?? I just want the basic code, not all fancy functions.
View Replies !
Howto: PHP4 Dom XML To PHP5 XML ?
Can anyone point me to a guide or something for conversion? I need to translate following code: PHP4 $eir_dom = domxml_open_mem($eir_padfile_content); $eir_root_node = $eir_dom->document_element(); // = root element PHP5 $eir_dom = new DOMDocument; $eir_dom->loadXml($eir_padfile_content); // need equalant of: document_element(); PHP4 .... $nodes = $cur_root_node->child_nodes(); .... if ($test_node->node_name() == $next_node_name_to_find) { PHP5 // need equalant of: child_nodes(); node_name() PHP4 .... if ($node_child->node_type() == XML_TEXT_NODE) { $node_child->set_content($new_content); break; } PHP5 // need equalant of: set_content, node_type()
View Replies !
Howto Return 'best' Key From An Array?
I have an array of seller items, sorted by price. Sometimes, however, the item described is incorrect--and so I need to parse through the description and if it contains certain badwords I need to skip to the next key to perform the same test. An array may contain many keys, yet I need to narrow it down to one.
View Replies !
Howto Load SQL From A File
How to load sql file(external) with php ... >>index.html <form method=post action='test.php'> <input type=file name=file><br> <input type=submit value=DO> </form> >>test.php $sql = file_get_contents($_FILES['file']); $sql = trim($sql); mysql_connect('localhost','root',''); mysql_select_db('test'); mysql_query($sql);
View Replies !
Howto: Detect Encodings?
Here is a nice code to detect utf-8 <http://in2.php.net/utf8_encode#39986> But, I couldn't find out the logic behind the script. If anyone knows that please share. Particularly I would like to detect other encodings too. So, I would like to know the logic. For example these texts are in TSCII encoding (for Tamil):
View Replies !
HOWTO: Check FTP Site Is Up
Had to write something similar to this for my office. You can adapt to your use. I just put it on a chron job for every 15 minutes. My bash script did: php -d max_execution_time=1000 -q /root/projects/ftptest/ftptester.php <?php // ftptester.php: // use your own mail script -- see my note on this below require('_sendmail.php'); $FTP_ADDR = 'myftpsite.com' $FTP_USER = 'special' $FTP_PASS = 'GhX77ED011FJH' $FTP_TEST_FILE = 'ftptest.txt' $FTP_TEST_FILE_PATH = '/root/projects/ftptest' $SMTP_IP_ADDR = 'mymailserver.com' $FROM = 'me@me.com' $TO = 'to@to.com' $CC = 'cc@cc.com' $SUBJECT = 'ALERT: FTP Server Unavailable!' $MESSAGE = " ******** *** ALERT FTP server $FTP_ADDR is not responding to file uploads."; echo " Starting FTP Server Test..."; echo " ...connecting to $FTP_ADDR"; $FTP = ftp_connect($FTP_ADDR); echo " ...login with special account"; ftp_login($FTP, $FTP_USER, $FTP_PASS); echo " ...waiting for latent FTP login"; sleep(4); echo " ...pushing test file"; ftp_put($FTP, $FTP_TEST_FILE, $FTP_TEST_FILE_PATH . '/' . $FTP_TEST_FILE, FTP_ASCII); echo " ...waiting for latest FTP file upload"; sleep(4); echo " ...checking for file upload success"; $nSize = 0; $nSize = @ ftp_size($FTP, $FTP_TEST_FILE); if ($nSize < 1) { echo " ...PROBLEM! file upload failure"; // I don't want to plagarize, so use your own mail script, which you can // get easily from PHP.NET website if you search on fputs function and // scroll down to see user submitted entries $mail->Send($SMTP_IP_ADDR, $FROM, $TO, $CC, $SUBJECT, $MESSAGE); } else { echo " ...file upload was a SUCCESS"; } echo " ...deleting test file"; @ ftp_delete($FTP, $FTP_TEST_FILE); sleep(1); echo " ...logging out"; ftp_quit($FTP); echo "Stopped FTP Server Test"; ?>
View Replies !
Howto: Please Wait, This May Take A Few Seconds...
what if i have a webpage that displays the text "please wait, this may take a few seconds..." and it now waits until some event on the server happens. whatever this is, this can be quick, but it could also be slow, or it can even fail. but once this event has happened, i want the webpage to reload and display a different message, like "the process completed successfully". Code:
View Replies !
Howto JOIN Tables
I'm looking for a solution on howto join multiple tables across databases. This bit of code does not work. yet. $SqlSelectQuery = ( " SELECT a.ID, a.Name, b.ID, b.Name FROM db1.a, db2.b WHERE a.ID = b.ID " ); $SqlSelectResult = mysql_query($SqlSelectQuery, $db1); $SqlSelectResult2 = mysql_query($SqlSelectQuery, $db2);
View Replies !
HOWTO Secure Write A File?
To write/read files on a secure file, for example /bob/data/secure.txt setting 1- db accounts setprop <ibay-name> PHPBaseDir ... 2- signal-event ibay-modify <ibay-name> test 3- db accounts getprop <ibay-name> PHPBaseDir
View Replies !
Character Encoding Override - Howto Fix
coded pages valid and all - me mate loaded it up -> iso-88591 says the validator but my pages have this line: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> Apache server of me mates webhost uses iso-88591 which chokes the validator How to make sure <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> will be used , can I insert a <php ?> header something top of page to override the wrongly iso-88591 (no hyphen) What a webhost.
View Replies !
|