Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

saving a form

bworkbwork Posts: 7Member
hello i'm makeing a site in html/javascript and i was wondering if it was posible to save the form on the site.
someone told me iet would be possible with GCI , or PHP scripting/programming.
could anyone help me with this??

best help would be soms example code of a similar site or soms tutorials

thank you in advance


greets bwork

Comments

  • the walrusthe walrus Posts: 249Member
    who's hosting your website? is it on geocities? are you paying a company to host it? is a friend hosting it? are you hosting it?

    php isn't like html in the sense that you can just upload it and everything works. it's server side, so before i can answer your question, i need to know who's hosting it.
  • bworkbwork Posts: 7Member
    : who's hosting your website? is it on geocities? are you paying a company to host it? is a friend hosting it? are you hosting it?
    :
    : php isn't like html in the sense that you can just upload it and everything works. it's server side, so before i can answer your question, i need to know who's hosting it.
    :

    well for testing the site i would be hosting on my own pc
    but for the site itself it would be a remote server who's hosting.
    i dont exactly know wich one but its a php/mysql hosting type server.


  • the walrusthe walrus Posts: 249Member
    [b][red]This message was edited by the walrus at 2005-2-16 9:13:44[/red][/b][hr]
    ok, at first it sounded like you needed help getting php installed, but assuming you already know all that, here's some code to show you how you can save a form submission with php:

    HTML:
    [code]






    [/code]

    save.php:
    [code]
    <?php

    $ff = fopen('testfile.txt', 'w');
    fwrite($ff, $_POST['input1']) or exit("Could not write to file.");
    fclose($ff);

    echo "Saved successfully";

    ?>
    [/code]

    if you're using linux you'll have to make sure your http server has write privileges in the /var/www/html directory (or whatever directory you're using). when you save something from the html page, the php page should save it to testfile.txt in the html directory. it might be worth checking out http://www.php.net .. i dont know what experience you have with programming, but php can be picked up pretty quickly. if you have any questions, just ask.


Sign In or Register to comment.