Results 1 to 10 of 11
-
21st Jul 2011, 01:51 PM #1OPBannedWebsite's:
xsl.tel xsltel.comreplacing mysql $link supplied data, a question?
Hello,
most of you know that php is using
Code:$link = mysql_connect('localhost', $mysql_user, $mysql_pass);
I want to do something like replacing those data after they are executed (I mean after variables getting replaced with real values) I want to change the real values.
to be more specific I want to change the $mysql_user after it gets replaced by variable value.
or forcing a php script to use 1 user and only 1 user with script(s) and drop the above mentioned variables
may be its not possible but was just wondering if anyone has an idea about that.
and please understand I don't know a lot in php and I didn't used google yet so don't judge me for a noob question
Highest Regards
Mohammed HXSLTel Reviewed by XSLTel on . replacing mysql $link supplied data, a question? Hello, most of you know that php is using $link = mysql_connect('localhost', $mysql_user, $mysql_pass); to connect to mysql databases. I want to do something like replacing those data after they are executed (I mean after variables getting replaced with real values) I want to change the real values. to be more specific I want to change the $mysql_user after it gets replaced by variable value. Rating: 5
-
21st Jul 2011, 03:00 PM #2Respected Member
If I understand you correctly then the line would be:
PHP Code:$link = mysql_connect('localhost', 'username', 'password');
-
21st Jul 2011, 03:39 PM #3OPBannedWebsite's:
xsl.tel xsltel.comno Lock Down I didn't meant that but thanks for reply
below example can make my request clearer :
PHP Code:$mysql_user = "root";
$mysql_pass = "rootpassword"
PHP Code:$link = mysql_connect('localhost', $mysql_user, $mysql_pass);
PHP Code:$link = mysql_connect('localhost', 'root', 'rootpassword');
-
21st Jul 2011, 04:27 PM #4Member
hmm i still don't see what the problem is and what you are trying to achieve
mysql_connect(); is a function that takes 3 arguments, server_ip, username and password . now you can write those details directly when you call that function or you can use variables to store those mysql login values to it and instead place the variable names there.
-
21st Jul 2011, 05:49 PM #5Respected Member
Sorry but I still don't understand.
-
22nd Jul 2011, 07:22 PM #6
php had to be running in safe mode to be able to override mysql options with the ones in php.ini file. That is not a good solution for this problem trough.
Trusted: Dom, l0calh0st, 0ccul7, robert420
Find all threads started by NewEraCracker
-
22nd Jul 2011, 11:43 PM #7MemberWebsite's:
sborg.usAh guys, He wants to change the value of username and password once they're substituted in the command!
So 'root' | 'password' has to be replaced with 'rooter' | 'new-pass'.
He's trying to build an interactive client based app(I guess), And wants the logins to change :/
@OP, Is this correct? If yes, Then why don't you take the values from user rather than trying to change them in mid program?
V3g3ta | Halcyon | Abhi
-
23rd Jul 2011, 01:13 AM #8OPBannedWebsite's:
xsl.tel xsltel.com@NEC yes I've looked at sql.safe_mode but it won't work in most scripts.
@V3g3t4 exactly that is what I need and I must change them in the mid of application it can fool a lot of script kiddies (they will see default value in config.php but another values will be used when the program executed) that's the main idea.
-
23rd Jul 2011, 01:55 AM #9MemberWebsite's:
vaporhostn.comYou could always keep the config.php settings and dureing the middle of the app make it switch to the new sql settings makeing the first sql settings dummy settings trying to fool the hacker that those are the real settings...
Or make a series of sql connections to switch them... Its a hard concept with php
-
23rd Jul 2011, 02:08 PM #10MemberWebsite's:
sborg.usWhy don't you encode the values? Create your function to do this job, and your problem is solved!
V3g3ta | Halcyon | Abhi
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Problem my display data php mysql
By softpk in forum Web Development AreaReplies: 1Last Post: 22nd Apr 2012, 11:42 AM -
Replacing MySQL with MariaDB in a CentOS VPS
By NewEraCracker in forum Technical and Security TutorialsReplies: 14Last Post: 30th Jan 2012, 11:39 PM -
[Selling] MYSQL Data for sale. Assorted Hi-traffic forums, ecommerce, investment, media, warez
By felosi in forum Completed TransactionsReplies: 1Last Post: 15th Nov 2011, 05:59 AM -
Mysql fetch specific data from row (id)
By roadrunner in forum Web Development AreaReplies: 9Last Post: 23rd Aug 2011, 03:45 PM -
Fetching Data from mysql database (Well Commented)!
By litewarez in forum Tutorials and GuidesReplies: 3Last Post: 9th May 2009, 03:36 AM
themaLeecher - leech and manage...
Version 5.02 released. Open older version (or...