topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday April 16, 2024, 5:46 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Simple php directory  (Read 6112 times)

Killeroid

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
IDEA: Simple php directory
« 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.

tinjaw

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • View Profile
    • Donate to Member
Re: IDEA: Simple php directory
« Reply #1 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.

Killeroid

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: IDEA: Simple php directory
« Reply #2 on: January 07, 2008, 10:37 AM »
It needs to be somthing that i can host.

tinjaw

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • View Profile
    • Donate to Member
Re: IDEA: Simple php directory
« Reply #3 on: January 07, 2008, 10:49 AM »
It needs to be somthing that i can host.
Would a combination of something like phpFormGenerator and phpMyAdmin? Or are you looking for a few lines of custom PHP code to do that and only that?

Killeroid

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: IDEA: Simple php directory
« Reply #4 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.

tinjaw

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • View Profile
    • Donate to Member
Re: IDEA: Simple php directory
« Reply #5 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.

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,646
    • View Profile
    • Donate to Member
Re: IDEA: Simple php directory
« Reply #6 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>