Jump to content

Yojance

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Yojance's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [quote author=Koobi link=topic=99217.msg390678#msg390678 date=1151869800] why don't you give it a quick try and show me what you have and i will tell you what changes you need to make :) just follow these steps while referring to the manual: 1. use file_get_contents() to get the image 2. use fwrite() to write the image to the disk. [/quote] Will try that. Thanks. [b]Redarrow[/b], im trying to write a script like www.imageshack.us, I will not be the one using the images :), its not for personal use :).
  2. That sounds promising, can you provide me with a small example code so that I can understand it better. Im so lost at this. I read the info at php.net but it doesnt say much.
  3. Thank you for your fast response Corbin. You misunderstood what I'm trying to achieve. I want to write a script so php can do this automatically. When i say my server, I dont mean my computer, I mean the computer that hosts the site online. I want to achieve something like www.imageshack.us, where instead of uploading the image from your computer, you tell it to get the image from a specific URL and host it on their servers. Thats exactly what I'm trying to achieve.
  4. An Iframe is like inserting a page into another one. It basicly adds a a scrollable page inside another page. In this case, from what I can see, it has a 1 by 1 pixel size so it should display something small, but I can also see that from my understanding is safe to remove the line. Hope this help, and wait for advise from the experts :)
  5. Here I'm again with a n00bie question. I've been doing some research about doing this but I've not been able to gather enough sources and what I see, mainly I can understand it. Here is what I'm trying to achieve. Lets say I know the URL of an image, for example [b]http://img165.imageshack.us/img165/3370/usflag0al.jpg[/b] Now I want to save that jpg image into a directory located on my server. Once I save it, I want to be able to display it on a site, using the image from my server. How can I do that? and is it even possible? Thanks to whoever can teach me a thing or two about working with images using php. Thanks for reading.
  6. Tried it and it works, plus I have a friend who just signed on MSN who is going to help me. Thank you so much.
  7. Here is my lame code. [code]<?php if(isset($_POST['img'])) { $IMG = $_POST['img']; $img = ($_POST['IMG'] / 100); $imgdir = 'images/' $chopurl = 'http://mysite.com/'; echo '<img src="'.$imgdir.$IMG.'.jpg" />'; } ?>[/code] Thanks for the fast response.
  8. I'm just wrote a very simple script that creates a link to an image. When I put all the code into <img src="all php code here /> the image won't display. I think I heard something about letting the browser know that an image is coming, I looked for it but I did not find it. Could anyone help me. Thanks.
  9. Hey Ken, thanks for your link, I read and I still find it confusing. Im going to keep looking at it hoping I can get something out of it. If someone else has can explain it to me, I would really appreacite that.
  10. I recently bought 2 books from Site Point and there is a bit of code that I do not understand, since the books doesn't explain it. I'm hoping one of you smart php guys can explain it to me. The part of the code I do not understand the very next line after the form, this line: [code]<?php else: // Default page display[/code] Why is there a ([b]:[/b]) instead of a { . And why is it that at the end, we must end it if an [b]endif;[/b] I never seen that one neither. Another thing I find stupid is that everytime I hit refreshed, the last joke it's added again to the database, which makes no sense to me. How could I eliminate that from happeing over and over. Would any of you care to explain to me in plain english why it has to be done like that? Thanks for your help in advance. [code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Welcome to Jokes DB!</title> </head> <body> <?php     if(isset($_GET['addjoke'])): //User wants to add a joke      ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <label>Type your joke here:<br/> <textarea name="joketext" rows="10" cols="40"></textarea></label><br/> <input type="submit" value="SUBMIT" /> </form> <?php else: // Default page display // Connect to the database server $dbcnx = @mysql_connect('localhost', 'user', 'pass'); if (!$dbcnx) {     exit('<p> Unable to connect to the database server at this time.</p>'); } // Select your jokes database if (!@mysql_select_db('joke')) { exit('<p>Unable to locate the joke database at this time.</p>'); } // If a joke has been submited, add it to the database if (isset($_POST['joketext'])) { $joketext = $_POST['joketext']; $sql ="INSERT INTO ijdb SET joketext='$joketext', jokedate=CURDATE()";   if (@mysql_query($sql)) {   echo '<p>Your joke has been added</p>';   } else {      echo '<p>Error adding submitted joke: '.mysql_error(). '</p>';     } } echo '<p>Here are all the jokes in our database'; //Request the text of all jokes $result = @mysql_query('SELECT joketext FROM ijdb'); if(!$result) {     exit('<p>Error performing the query: ' .mysql_error(). '</p>'); } //Display the text of each joke in a paragraph while ($row = mysql_fetch_array($result)) { echo '<p>'.$row['joketext']. '</p>'; echo '<em>'.$row['jokedate']. '</em>'; } /// When clicked , this link will load this page within the joke submission form displayed. echo '<p><a href="' .$_SERVER['PHP_SELF']. '?addjoke=true">Add a Joke!</a></p>'; endif; ?> </body> </html>[/code]
  11. Join the club, I get a lot of errors and dont know how to properly extract information from a database. Im sure you will find some help here.
  12. I'm a total noob in PHP, a quick look at my php book I use to learn at the moment, it says this. [b]upload_max_filesize [/b][i](integer)M[/i] Scope: [i]PHP_INI_SYSTEM[/i], Default value: [i]2M[/i] The upload_max_filesize directive determines the maximum size, in megabytes of an uploaded file. This directive should be smaller than post_max_size, becayse it applies only to information passed via the file input type, and not to all information passed via the POST instance. Like memoery_limit, note tha an M must follow the integer value. Just wrote this entirely from the book, I hope it helps. It does sound related to your problem, but I'm the n00b here :)
  13. Wow, i never thought it would be so complicated. Thank you Prismatic
  14. I've been wanting to do this for some time now, but I still dont know how to do it. Basicly it's a script that will display every image on a web directory. When I say display, I mean show the real image not the link like usual. I don't know how to tell php to go thru every image on a directory, so I'm asking you to help me do this. The rest I can probably figure it out in a day or two. I hope you can help me. Thank you.
  15. I fixed it now, a friend of mine helped me. Thank you all anyways. Thank you Crayon for the help :)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.