DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA: Simple php directory  (Read 8,489 times)

Killeroid

  • Participant
  • Joined in 2007
  • *
  • Posts: 8
IDEA: Simple php directory
« on: January 07, 2008, 07: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

  • I'm so glad breakbeat techno isn't an illegal drug
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Military Service Badge - US Army
    • Linux User
Re: IDEA: Simple php directory
« Reply #1 on: January 07, 2008, 01:40 PM »
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
  • *
  • Posts: 8
Re: IDEA: Simple php directory
« Reply #2 on: January 07, 2008, 04:37 PM »
It needs to be somthing that i can host.

tinjaw

  • I'm so glad breakbeat techno isn't an illegal drug
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Military Service Badge - US Army
    • Linux User
Re: IDEA: Simple php directory
« Reply #3 on: January 07, 2008, 04:49 PM »
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
  • *
  • Posts: 8
Re: IDEA: Simple php directory
« Reply #4 on: January 07, 2008, 04:59 PM »
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

  • I'm so glad breakbeat techno isn't an illegal drug
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Military Service Badge - US Army
    • Linux User
Re: IDEA: Simple php directory
« Reply #5 on: January 07, 2008, 05:10 PM »
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,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: IDEA: Simple php directory
« Reply #6 on: January 08, 2008, 04:25 AM »
PHPMyAdmin is a bit heavy just to dump a user list.

This is pipebomb crude but it's about all that's really needed: 
Code
 <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>

Original address: https://www.donationcoder.com/forum/index.php?topic=11713.0