Yeah, that's a good idea, although you'd have had to have doneor similar.Code:<?php echo($pic); ?>
Yeah, that's a good idea, although you'd have had to have doneor similar.Code:<?php echo($pic); ?>
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
yeah you could have done that, taht would have been easier but i wnet with the difficult function...
w00t this ones nice that i just made like in 20 seconds using my original untested script, so I made a succesful one without testing... this ones nice though...
test it onCode:<?php $pic = $_POST['pic']; $htm = $_POST['htm']; $bbc = $_POST['bbc']; ?> <img src="<?php echo($pic); ?>"><BR><BR> <form name="changepic" action="" method="post"> <input name="pic" size="50" type="text" id="pic" value="<?php echo($pic); ?>"><BR> <input type="submit" name="Submit" value="Submit"><BR> <input name="htm" size= "50" type="text" id="htm" value="<img src='<?php echo($pic); ?>'>"><BR> <input name="bbc" size= "50" type="text" id="bbc" value="[img]<?php echo($pic); ?>[/img]"> </form>
http://michael.hungerford.us/imgtransfer.php
this one lets you click submit after entering img location on first field, then click submit and it refreshes and puts a preview of the image, the location in the first field, the html version in the second field, and the third field is the bbcode.
This is the first php script I've ever just writeen and it worked on my own, so Im pretty happy about this.
Updated version!
Code:<?php $pic = $_POST['pic']; $htm = $_POST['htm']; $bbc = $_POST['bbc']; ?> Image Preview:<BR> <HR WIDTH="100%" SIZE="1" ALIGN="Left" NOSHADE COLOR="#000000"> <img src="<?php echo($pic); ?>"><BR> <HR WIDTH="100%" SIZE="1" ALIGN="Left" NOSHADE COLOR="#000000"><BR> <form name="changepic" action="" method="post"> Picture Location: <input name="pic" size="50" type="text" id="pic" value="<?php echo($pic); ?>"> <input type="submit" name="Submit" value="Submit"><BR><BR> HTML code: <input name="htm" size= "50" type="text" id="htm" value="<img src='<?php echo($pic); ?>'>"><BR> BBcode: <input name="bbc" size= "50" type="text" id="bbc" value="[img]<?php echo($pic); ?>[/img]"> </form>
Just remember to strip HTML.
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
tells description, and img preview... also hides the <img scr=''> and [omg][/img] in fields when the first field is emptyCode:<?php $pic = $_POST['pic']; $htm = $_POST['htm']; $bbc = $_POST['bbc']; ?> Image Preview:<BR> <HR WIDTH="100%" SIZE="1" ALIGN="Left" NOSHADE COLOR="#000000"> <?php if ($pic !=""){ ?> <img src="<?php echo($pic); ?>"> <?php } else { ?> <?php } ?> <BR> <HR WIDTH="100%" SIZE="1" ALIGN="Left" NOSHADE COLOR="#000000"> <form name="changepic" action="" method="post"> Enter an image's location and this will convert it to HTML code and BBcode.<BR><BR> Picture Location: <input name="pic" size="50" type="text" id="pic" value="<?php echo($pic); ?>"> <input type="submit" name="Submit" value="Submit"><BR><BR> <?php if ($pic !=""){ ?> HTML code: <input name="htm" size= "50" type="text" id="htm" value="<img src='<?php echo($pic); ?>'>"><BR> BBcode: <input name="bbc" size= "50" type="text" id="bbc" value="[img]<?php echo($pic); ?>[/img]"> <?php } else { ?> HTML code: <input name="htm" size= "50" type="text" id="htm"><BR> BBcode: <input name="bbc" size= "50" type="text" id="bbc"> <?php } ?> </form>
Bookmarks