CrackCar101 Posted March 27, 2012 Share Posted March 27, 2012 MySQL Version: 5.5.20 (<-- This is my WAMPServer version to test my program, my hosting has 5.1 though) PHP Version: 5.3.10 (My Hosting says its PHP 5 but not sure what version, i know its not the newest) What im trying to do is have my site have a page like "www.mysite.com/data.php?user=Nicholas&country=USA" Thing is, i dont know what to add in my data.php source code to make it work like that. What im trying to achieve is for my users to sign up for my page but I DO NOT want to add my MySQL user and pass in the page where it can be cracked and hacked. When the user goes to the page, a script will automatically put the user and country and then the page will automatically add the user and his country to the MySQL table on my database. Im also making a program that will work like this and that will have a higher chances of being hacked if i add my MySQL info into the program in order to add data. Can someone please provide me of a sample source i can try? I will not only be adding user and country but i want to test this out. Thanks! Quote Link to comment Share on other sites More sharing options...
cpd Posted March 27, 2012 Share Posted March 27, 2012 At some point your going to need to include the username and password in order to connect from PHP... If you don't you can't connect. Moreover, PHP will execute before the page is output so unless you decide to print your sensitive data, your information should never be seen... Quote Link to comment Share on other sites More sharing options...
CrackCar101 Posted March 27, 2012 Author Share Posted March 27, 2012 At some point your going to need to include the username and password in order to connect from PHP... If you don't you can't connect. Moreover, PHP will execute before the page is output so unless you decide to print your sensitive data, your information should never be seen... But cant i just have a script that whatever info is put here: www.mysite.com/data.php?user=(USER)&country=(COUNTRY) Cant it just send the info to MySQL. Quote Link to comment Share on other sites More sharing options...
Jessica Posted March 27, 2012 Share Posted March 27, 2012 Yes. And it needs to be able to connect to MySQL to do so. If that page doesn't know your MySQL username and password, how would MySQL trust it? Quote Link to comment Share on other sites More sharing options...
cpd Posted March 27, 2012 Share Posted March 27, 2012 You login to your computer using a username and password. You access your emails using a username (email) and password. The same principle applies to a MySQL Server. You login with a username and password, then you can access the data (provided there are appropriate permissions). Quote Link to comment Share on other sites More sharing options...
CrackCar101 Posted March 27, 2012 Author Share Posted March 27, 2012 Okay, is there anyway i can make this without my MySQL user and pass showing up in the source page? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.