Jump to content

Woad.php

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Posts posted by Woad.php

  1. I have a form on my webpage. Let's say I have three fields. Username, Email, and password. For all fields I have to check if they're too short or have invalid characters. For Username I need to check if it's been taken by another user, and for email I need to check whether it's a valid email. How do I perform these checks?
  2. I'm trying to create a members system and i'm having problems with the form validation. I want to have the validation code in a seperate file and be able to check if the username (one of the form's fields) has been taken by querying the database and comparing names. How do I do this?
  3. I have a shoutbox.txt that looks something similar to this:

    [code]<div align="left" style="font-family:Verdana, Arial, Helvetica, sans-serif; color:#FFFFFF; font-size:10px;">
    <b>Anonymous</b> ? <br>
    <b>Anonymous</b> ? <br>
    <b>24.16.80.177</b> ? <br>
    <b>RA</b> ? <br>
    <b>24.16.80.177</b> ? <br>
    <b>asdfafdf</b> ? <br>
    <b>asdfafdf</b> ? <br>
    <b>asdf</b> ? Enterasdf Message<br>
    <b>Beaches</b> ? Bork bork<br>
    <b>Sup?</b> ? Hahaha<br>
    <b>Anonymous</b> ? <br>[/code]

    And right now I'm using this code to show whats been said:

    [code]<table bgcolor="#292929" border="0" align="center" cellpadding="3"

    cellspacing="0" width="98%">
    <tr>
    <td valign="bottom" style="background-color: #444444; border: 1px solid

    #000000"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><?php

    include "shoutbox.txt"; ?></font></td>
    </tr>
    </table>[/code]

    How could I only show to people visiting the site only say the most recent 10 entries and delete the rest?
  4. You need to search for the smile and replace it with a picture like this:
    [code]$message = str_replace(":)","<img src=\"/images/smile.gif\" alt=\"Smile\">",$message);[/code]
    it replaces any :) in the message with the smile picture, and in the last parameter you're passing in the string (in this case $message) to be searched and replaced.
  5. Hey guys, I just learned all of the basics about php yesterday and now I want to try creating a timer that constantly refreshes and is taken away from.
    For example it shows 00:00:01, which changes to 00:00:02, 00:00:03, etc. etc. but adds to the timer while the page has been created.
    Is that possible?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.