Complete Newbie - Need very simple php.

Discussion in 'PHP' started by prawn_86, Dec 21, 2008.

  1. #1
    Hi all,

    let me preface this by saying i have never written a php code in my life, but i do have minimal experience with javascript so programming isn't completely foreign for me.



    Im using Dreamweaver CS3 and i want a code that does the following:

    I have 2 text boxes, one called 'name', the other 'link', when I input both these values in i want 'name' to appear on my page and it to be hyperlinked to 'link'.

    I also want the date they were added to appear next to them.

    And if possible, i would like them to only stay on my page for X number of days.


    I know this is probably very simple, so if someone could point me to an easy tutorial or a simple way to do it, I would be very grateful.

    Thanks
     
    prawn_86, Dec 21, 2008 IP
  2. www.hunthost.in

    www.hunthost.in Peon

    Messages:
    147
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use a normal html form with PHP GET and POST, you can store it in database or file with the date using date() function. Run a cron job every X hours to remove it ;)

    In short learn PHP POST n date() function.
     
    www.hunthost.in, Dec 21, 2008 IP
  3. caribbean_hatch

    caribbean_hatch Peon

    Messages:
    19
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It's not quite as simple as you think. When you're talking about storing user inputted data, then you need a database - you're no longer just using a WYSIWYG editor to create static html pages, rather you need create dynamic pages, meaning the web pages are compiled on the fly when a user requests it from their browser.

    It's time to play with mySQL and php. You need to make sure that mySQL and PHP are installed and running on whatever server you're hosting your pages on. Then you need either how to use the shell command line to create a mySQL database, or use a web interface to it (Google: phpmyadmin), then you can use Dreamweaver to bind to the database and create the proper statements to process the form data. Check the Dreamweaver help section on using the application panel to set up a database connection, create bindings to it, and use behaviors.
     
    caribbean_hatch, Dec 21, 2008 IP
  4. prawn_86

    prawn_86 Peon

    Messages:
    483
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks guys, i'll look further into it.

    my server does run php and i have found the phpmyadmin part :)
     
    prawn_86, Dec 21, 2008 IP