www.webdeveloper.com
Results 1 to 7 of 7

Thread: Lets see if this is the right place...

  1. #1
    Join Date
    May 2003
    Location
    Pensacola, FL
    Posts
    635

    Lets see if this is the right place...

    I recently posted in the javascript forums, and they told me my request would probably be better using a server side script ... and I really dont know what to do... If you could look at this, then you should get what Im asking... I already looked around the php forum and didnt find what I was looking for.... Here it is... My JS Post
    Thank You

    JDM

  2. #2
    Join Date
    May 2003
    Location
    Doetinchem [Holland]
    Posts
    12
    You could do it in PHP with MySQL or without MySQL..
    I prefer with MySQL because that is a lot easier to code..
    it could look like something like this:
    PHP Code:
    <?php
    if ($voegtoe) {
    $server mysql_connect();
    mysql_select_db("members",$server);
    $sql "SELECT * FROM `members` WHERE `gebrnaam` = '$gebrnaam'";
    $result mysql_query($sql);
    if (
    mysql_num_rows($result) > 0) {
    echo 
    "This username is already in use.";
    }
    else {
    if (
    $gebrnaam && $naam && $anaam && $email) {
    $server mysql_connect();
    mysql_select_db("members",$server);
    $sql "INSERT INTO `members` VALUES ('$naam','$anaam','$woonplaats','$email','$gebrnaam','normaal','$select','$leeftijd','$w8wrd')";
    $result mysql_query($sql);
    echo 
    "You registration in completed";
    }
    else {
    echo 
    "You forgot to fill in some information";
    }
    }
    }
    ?>
    <form action="index.php?act=aanmelden" method="POST">
    <table>
    <tr>
    <td>Username: </td><td><input type='text' name='gebrnaam'></td>
    </tr>
    <tr>
    <td>Password: </td><td><input type='text' name='w8wrd'></td>
    </tr>
    <tr>
    <td>Name: </td><td><input type='text' name='naam'></td>
    </tr>
    <tr>
    <td>Last name: </td><td><input type='text' name='anaam'></td>
    </tr>
    <tr>
    <td>Town: </td><td><input type='text' name='woonplaats'></td>
    </tr>
    <tr>
    <td>E-mail: </td><td><input type='text' name='email'></td>
    </tr>
    <tr>
    <td>Gender: </td><td><select name='select'>
    <option value='man'>male</option>
    <option value='vrouw'>female</option>
    </select></td>
    </tr>
    <tr>
    <td>Age:</td><td><input type='text' name='leeftijd'> </td>
    </tr>
    <tr>
    <td><input type='submit' name='voegtoe' value='Register!'> </td>
    </tr>
    </table>
    </form>
    Some variables are Dutch sorry for that
    And there aren't many checks like an email-check

    greetz Koen
    Last edited by koeniepoenie; 05-25-2003 at 12:43 PM.
    -- Koen in da House --

  3. #3
    Join Date
    May 2003
    Location
    Pensacola, FL
    Posts
    635
    Ok I put the code into a .html under the body but I think that would be wrong? What do I do with the code is what Im asking? Also what do I save it as?

    JDM

  4. #4
    Join Date
    May 2003
    Location
    Pensacola, FL
    Posts
    635
    Well... let me just get all my questions out now, because once I figure out how to make a registry page, then I am going to move into if the on registration can the info be automatically saved? Can someone make me a script where on the login form it will contain this...

    Username
    Password
    Link To My Register Page
    *Which both have to be filled out in order to submit... If accepted then move onto page, but if not then alert...

    And on the register page if it would be possible to make it where once you submitted the form

    Username
    Username
    Password
    Password
    Email
    Email

    filled out completely then I will get an email, but also the information (Username & Password) they submit will automatically be recorded into the database so they can log in? I know Im probably asking too many questions, and Im sorry ANother question I have is that can this be bypassed by anyone or can any find a way around it? Also thanks to anyone that helps. If you do reply try to walk me through step by step please because Im dummy in PHP...

    JDM
    Last edited by JDM71488; 05-25-2003 at 01:50 PM.

  5. #5
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Ok, it sounds like you need more of a custom script. What you are asking is a bit beyond the scope of this forums. There would be many willing to do this as a contract programming job (myself included), but that may get expensive. My advise to you would be to begin learning PHP, starting with some easier scripts. Also, you will want to make sure your server supports PHP and mySQL (or someother database). To check if your server supports PHP, try this. Note that PHP scripts must be renamed to .php (or .php4 for some servers).

    test.php
    PHP Code:
    <?PHP
    echo "I have PHP!";
    ?>
    Run that and check the output.

    You could, perhaps, scour the internet for a free script doing what you are looking for, if you don't want to take the initiative to learn PHP...

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  6. #6
    Join Date
    May 2003
    Location
    Pensacola, FL
    Posts
    635
    Thanks pyro... Im going to take your advice on learning php. But I tried that test.php... Well I am currently through cox.net for my web site. And when I uploaded test.php to the server, and viewed it. It displayed the whole code. Is it supposed to do that? I dont think it is, not sure, but I renamed it to .php4 as you said. And still same thing. Is anything wrong? I think my server just doesnt support php... it wont allow me to post either... Thats why Im going to get a domain, when I get some income .

    JDM

  7. #7
    Join Date
    Feb 2003
    Location
    Britain
    Posts
    1,335
    If you just saw the code, tat does mean that your server doesn't support PHP. Never mind.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles