|
-
Sep 29th, 2004, 10:29 AM
#1
Thread Starter
Addicted Member
-
Sep 29th, 2004, 10:37 AM
#2
Frenzied Member
I'm presuming you know how to set PHP up and have it running on your PC so you can test it. This code will display your IP and nothing else:
PHP Code:
<? echo $_SERVER['REMOTE_ADDR']; ?>
To get other's IPs you'd need something like this. When I run the program, it get's my IP and sends it (encrypted hopefully) to a server database. It then reads all the entries in that database checking for IPs with names that correspond to ones I have in my contacts list.
It then returns the names and IPs so I can start a conversation.
All this database stuff can be done in PHP very easily. You can google for mySQL with PHP and get some good tutorials on how to get it done.
I think the hardest thing would be getting your VB application to read the PHP. This project can be done in PHP and in VB, but using both might get tricky. I'm sure that VB has some way of sending data to online DBs. I think using that would be easier than PHP.
Wait for a response from an expert though.
Have I helped you? Please Rate my posts. 
-
Sep 29th, 2004, 11:47 AM
#3
Stuck in the 80s
Re: Php big project
Originally posted by Tommy101
Being a programmer i have no real knowledge of php!
I'm a programmer, and I have vast knowledge of PHP.
-
Sep 29th, 2004, 11:51 AM
#4
-
Sep 30th, 2004, 05:51 AM
#5
Thread Starter
Addicted Member
I meant that i have not studied php before and you probaly program in C++ right?
Anyway can someone tell me how to create a simple logon page?
-
Sep 30th, 2004, 07:53 AM
#6
Frenzied Member
Well. how simple do you want it?
I'm not going to make the page which submits data to this code, but I'll presume that the username field is called un and the password field is called pw.
PHP Code:
//untested
$un = $_POST['un'];
$pw = $_POST['pw'];
//Here you'll want validation to make sure they didn't inject anything.
$query = "SELECT * FROM `users` WHERE `username`='$un'";
/*That will get the get the row from the database, from the table called users, where the heading username mathes the username that was inputted*/
$result = mysql_query($query);
if ($pw == @mysql_result($query,0,'password')
{
//Person logged in correctly. Start some sessions etc.
}
else
{
echo "username/password invalid";
}
To find out about sessions just do a search, both on google and in this PHP section.
BTW, lots of people (and I meant lots) will know several branches of languages. For example, VB, C++, PHP, COBOL, PYTHON, PERL etc. It's not that rare, to be an expert in all is, but several people at least know enough for their needs in plenty of languages. Just because you've learned C++, that doesn't mean that you can't also learn VB.
Last edited by Acidic; Sep 30th, 2004 at 07:56 AM.
Have I helped you? Please Rate my posts. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|