1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP form for creating HTML code...

Discussion in 'PHP' started by Lever, Jan 11, 2008.

  1. #1
    Can anybody point me in the right direction of how to code a php form to create HTML/xhtml from input such as 1) a link 2) an image URL please? It's a sort of "banners for idiots" form. If I can just get my head 'round the basics I might be able to eventually add image size parameters and alt/title attribute fields too

    Thanks :)
     
    Lever, Jan 11, 2008 IP
  2. logondotinfo

    logondotinfo Peon

    Messages:
    314
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #2
    um...couple of ways...probably the long term simple one would be to download tiny_mce or a similar wysiwyg plugin, then you have a full wysiwyg panel to upload banner, add link and what have you as you liike. If that sounds a bit over the top or defeats the point of a deliberate learning curve you have set yourself, then you have to decide how you are going to layout the form....something roughly along the lines of:

    <?php
    if (!empty($_POST['banner']) {
    mysql_query("INSERT into table (banner, image, url) VALUES ($banner, $image, $url);");
    echo 'data added to table';
    }
    ?>
    then a simple html form below with the three tags of banner, image and url...this is far from complete and is meant to be a starting point for you, so please dont copy it onto your site then ask me why it doesnt work! Just had 2 minutes before i went home, thought id steer you in a direction......good luck
     
    logondotinfo, Jan 11, 2008 IP