Jump to content

Azerex

New Members
  • Posts

    9
  • Joined

  • Last visited

Azerex's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am aware, sorry, this code is a snippet from one of my older programs so I didn't go through and fix any deprecated functions.
  2. No I'm not. I posted the above code in 1 other thread because it was relevant. I have just decided to edit my current code because since he isn't making a website of his own he is using forum software the current user should already be defined. If you know how to read you can see that there are differences in the code from the other post. Learn to read before calling someone a troll smart one. [uPDATE] It won't let me edit the first post so ignore the first post and follow this: if your forum already keeps track of the currently logged in player you should find where that is defined and then echo that value on the page. ex: <?php $user = $_SESSION['username']; // This is an example of the definition $echo $user; // This will echo the username of the current person logged in. so if you find the definition you just go to the page you want to add it to and then inject php into that page by doing this eg... <fieldset> <legend> <?php echo $user; ?> </legend> </fieldset>
  3. so the php could be something like this. // Database Variables define('DB_HOST', 'Database Host (Normally "localhost" if your script is on the same ip as the db'); define('DB_USER', 'Database User'); define('DB_PASSWORD', 'Database Password'); define('DB_DATABASE', 'Database Name');; //Connect to mysql server $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } //Select database $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } $table = "table you are pulling data from"; $username = $_SESSION['username']; $query = "SELECT * FROM `table_name` WHERE username = ".$username; //This is just an example where you can replace username with any column $result = mysql_query($query) or die(mysql_error()); //Grab Information from query if (mysql_numrows ($result) >= 1) { $rows = mysql_fetch_array ($result, MYSQL_ASSOC); foreach($rows AS $k => $v) { $$k = $v; } } you can put the above code at the top of the file. then you can just go to where your legend tag is and eg... <fieldset> <legend> <?php echo $username; ?> </legend> </fieldset>
  4. well you would want to do something like this // Database Variables define('DB_HOST', 'Database Host (Normally "localhost" if your script is on the same ip as the db'); define('DB_USER', 'Database User'); define('DB_PASSWORD', 'Database Password'); define('DB_DATABASE', 'Database Name');; //Connect to mysql server $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } //Select database $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } $table = "table you are pulling data from"; $query = "SELECT * FROM `table_name` WHERE account = 'account'"; //This is just an example where you can replace account with any column $result = mysql_query($query) or die(mysql_error()); //Grab Information from query if (mysql_numrows ($result) >= 1) { $rows = mysql_fetch_array ($result, MYSQL_ASSOC); foreach($rows AS $k => $v) { $$k = $v; } echo $Account_Paid; //assuming that that Account_Paid is a column name. You can do this with any of your column names in the database. //you might need to change your file extension to .php in order to insert the variable on the page where you want to show the data unless you want to use something like Smarty. //this can be it's own independent file if you want as well all you have to do is do include('path/to/this.php'); and then insert your variables. }
  5. post a link to what you are trying to mimic and I will come up with something.
  6. You can try this, I'm honestly not sure if this will fix your problem but it could. go to wamp/alias/phpmyadmin.conf and edit <Directory "c:/wamp/apps/phpmyadmin3.5.1/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Deny,Allow Deny from all Allow from 127.0.0.1 </Directory> to <Directory "c:/wamp/apps/phpmyadmin3.5.1/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Allow,Deny Allow from all </Directory>
  7. simply install mysql on your server/computer. Then setup all the login information and all that(write it down). Now setup a pretty html form on the page and give all of the fields unique name attributes. Then create a submit button with it's own unique attribute. Then you can set the form method to post and the action to = #. Then from there you need to write the php script that will collect and organize the data and then send it. So the best way to do this is to make sure that you're name attributes are the same as the column names in the database that you create. If you get that far reply and I'll help you with the rest of the php code.
  8. So I was messing around with the code more and I tried moving the PsTools directory into the wamp server and the calling it from the new path. This now does not cause it to indefinitely hang however, it still does not run the intended program on the remote computer.
  9. So I have a web server setup on a remote windows machine using wamp. I am trying to run this php script and have it open the file on that machine: <?php exec('C:\Users\*user*\Desktop\PSTools\PsExec.exe -accepteula -i -s C:\wamp\www\Titanium.exe', $output); ?> This code causes it to indefinately hang. Any suggestions?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.