FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Is this possible?





janszmatt
1)My objective:

I want visitors to post their pictures (the url, not the file) in my gallery.

2)My solution:

Input a text box in the site for the urls. Visitors will then be notify that they have succesfully insert their picture

3)The progress:

1.Visitor visits site for inputing pictures "www.mysite.com/paste.php"
2.Visitor input url "www.visitorsite.com/picture.gif" into text box.
3.When visitor click submit, visitor will be redirected to url
"www.mysite.com/paste.php?picture=<img scr=www.visitorsite.com/picture.gif>".
4.Then the picture will appear here "www.mysite.com.gallery.php"

4)The problem:

I do not know how to create a php code to move the entry from the text box to the url.

5)The question:

Do you guys understand? Pls help if you do, i dont mind explaining it in detail
hexkid
That's kind of automatic Smile

When the fors is submitted, the information provided *can* be sent in the URL
Code:
<form action="paste.php" method="get">
URL: <input type="text" name="picture"><br>
<input type="submit">
</form>

Because the 'method' of this form is "get", the information is sent the way you want. You just have to catch it
Code:
<?php
if (isset($_GET['picture'])) {
  // there is a picture in the URL
  echo '<img src="', $_GET['picture'], '">';
} else {
  // no picture, put here the form above
}
?>
ock1991
People can spam F5 on 'mysite.com/paste.php?picture=...' and you'll have a gazillion duplicate entries... Remember to include a check for similar urls.
Related topics
Russian forum, if it possible?
Is it possible to...
Is it possible to add/manage my email forwarders with PHP?
PHP & Chat
Is it possible, can you build your own laptop from scratch ?
[RESOLVED] Is it possible to put up a music page
Would it be possible...?
How to become a millionaire on the internet?
swf to fla
is it possible to use my own domain
Possible Overheating
is it possible to recover the banned account?
Is it possible to change the bgcolor of <iframe> in IE
Is it possible?
open DVD from CD-ROM - possible??
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.