Activity Stream
48,167 MEMBERS
6835 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1.     
    #1
    Banned
    Website's:
    xsl.tel xsltel.com

    Default replacing mysql $link supplied data, a question?

    Hello,

    most of you know that php is using
    Code: 
    $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.

    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 H
    XSLTel 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

  2.   Sponsored Links

  3.     
    #2
    Respected Member
    If I understand you correctly then the line would be:

    PHP Code: 
    $link mysql_connect('localhost''username''password'); 

  4.     
    #3
    Banned
    Website's:
    xsl.tel xsltel.com
    no 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" 
    now after it gets executed
    PHP Code: 
    $link mysql_connect('localhost'$mysql_user$mysql_pass); 
    by default the code will resulted in this
    PHP Code: 
    $link mysql_connect('localhost''root''rootpassword'); 
    I want to change the above resulted code with another username (root) only username without touching the variables mentioned above

  5.     
    #4
    Member
    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.

  6.     
    #5
    Respected Member
    Sorry but I still don't understand.

  7.     
    #6
    Moderator
    NewEraCracker's Avatar
    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

  8.     
    #7
    Member
    Website's:
    sborg.us
    Ah 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

  9.     
    #8
    Banned
    Website'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.

  10.     
    #9
    Member
    Website's:
    vaporhostn.com
    You 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

  11.     
    #10
    Member
    Website's:
    sborg.us
    Why don't you encode the values? Create your function to do this job, and your problem is solved!

    V3g3ta | Halcyon | Abhi

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problem my display data php mysql
    By softpk in forum Web Development Area
    Replies: 1
    Last Post: 22nd Apr 2012, 11:42 AM
  2. Replacing MySQL with MariaDB in a CentOS VPS
    By NewEraCracker in forum Technical and Security Tutorials
    Replies: 14
    Last Post: 30th Jan 2012, 11:39 PM
  3. Replies: 1
    Last Post: 15th Nov 2011, 05:59 AM
  4. Mysql fetch specific data from row (id)
    By roadrunner in forum Web Development Area
    Replies: 9
    Last Post: 23rd Aug 2011, 03:45 PM
  5. Fetching Data from mysql database (Well Commented)!
    By litewarez in forum Tutorials and Guides
    Replies: 3
    Last Post: 9th May 2009, 03:36 AM

Tags for this Thread

BE SOCIAL