DonationCoder.com Forum

DonationCoder.com Software => Coding Snacks => Post New Requests Here => Topic started by: Killeroid on January 07, 2008, 01:52 AM

Title: IDEA: Simple php directory
Post by: Killeroid on January 07, 2008, 01:52 AM
Hello, I am basically looking for a simple script, that will accept user input from a form (these two fields: name/nickname and sip address) and then store it in a mysql database. The script should be able to display the list of users and the sip addresses(25-50 uses a page). Thanks a lot.
Title: Re: IDEA: Simple php directory
Post by: tinjaw on January 07, 2008, 07:40 AM
There are plenty of websites that would do that for you. Would that meet your needs or does it need to be something you host yourself? In which case, there are plenty of scripts to do that, but they will probably do more than what you need.
Title: Re: IDEA: Simple php directory
Post by: Killeroid on January 07, 2008, 10:37 AM
It needs to be somthing that i can host.
Title: Re: IDEA: Simple php directory
Post by: tinjaw on January 07, 2008, 10:49 AM
It needs to be somthing that i can host.
Would a combination of something like phpFormGenerator (http://phpformgen.sourceforge.net/) and phpMyAdmin (http://www.phpmyadmin.net/home_page/index.php)? Or are you looking for a few lines of custom PHP code to do that and only that?
Title: Re: IDEA: Simple php directory
Post by: Killeroid on January 07, 2008, 10:59 AM
phpFormGenerator will work for the accepting of data from users and storing it in a mysql database.. I dont know about phpmyadmin (basically, i ust want a script that will access the mysql database and print out and display the list of users and the sip adresses that i collected using the form and stored in the database.). It would be a great bonus if users could also seach through the database and find users by their usernames or voip numbers.
Basically, a phone directory script that lists the names and sip adresses of users and if easily done, also contains a search function so that you can search usng either fields.
Title: Re: IDEA: Simple php directory
Post by: tinjaw on January 07, 2008, 11:10 AM
That is why I suggested phpMyAdmin. You could just browse the database if you want, or make changes as you need. But if all you need is a phonebook-like directory, the search the PHP script sites on the web for phonebook & mysql. You're bound to find at least a few dozen.
Title: Re: IDEA: Simple php directory
Post by: Stoic Joker on January 07, 2008, 10:25 PM
PHPMyAdmin is a bit heavy just to dump a user list.

This is pipebomb crude but it's about all that's really needed: 
<table border='1' width='442' cellspacing='1' cellpadding='1' bordercolor='#000000'>
  <tr>
   <td bgcolor='#0065AD' align='center'><b><font face='Arial' size='2' color='#FFFFFF'>User Real Name</font></b></td>
   <td bgcolor='#0065AD' align='center'><b><font face='Arial' size='2' color='#FFFFFF'>User Nickname</font></b></td>
   <td bgcolor='#0065AD' align='center'><b><font face='Arial' size='2' color='#FFFFFF'>User's SIP</font></b></td>
  </tr>
    <?PHP
$q = "SELECT * FROM table_Name LIMIT('$i', 50)";
$qResult = MYSQL_QUERY($q) or die("Invalid query: $q");
while($qRow = MYSQL_FETCH_ARRAY($qResult)) {
Print"<tr>
   <td align='center'><font face='Arial' size='2'>$qRow[Name]</td>
   <td align='center'><font face='Arial' size='2'>$qRow[NIC]</td>
   <td align='center'><b><font face='Arial' size='2'>$qRow[SIP]</td>
  </tr>";
}

$i +=50; // Pass incremented $i back to page for next loop (Block of 50)
?> </table>