image source editor online

Discussion in 'PHP' started by cuze, Jul 11, 2011.

  1. #1
    Hi everyone!
    I am new on here, and i got stuck with php.
    I need a php function or code that edit a html's image "Source", on live edit.
    For Example:
    The updater.php have a textbox and button
    and if i change that textbox and i press the button,it should change a html's image source with that on the textbox.

    There is nothing about this on Google.
    please help.
     

    Attached Files:

    cuze, Jul 11, 2011 IP
  2. akshat.gl

    akshat.gl Member

    Messages:
    85
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    Put this code in your updater.php file

    <?php
    if(isset($_POST['url']))
    $url = $_POST['url'];
    ?>
    <img src="

    <?php

    if(isset($url))
    echo $url;

    else echo original_img_src; ?>
    ">

    <form method="post" action="updater.php">
    <textarea name="url">
    </textarea>
    <input type="submit" value="Change URL">
    </form>
     
    akshat.gl, Jul 11, 2011 IP
  3. cuze

    cuze Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    its working but when i delete the cookies its disappear the image.
     
    cuze, Jul 12, 2011 IP