
Moon-Man.net
Members-
Posts
84 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
Moon-Man.net's Achievements

Member (2/5)
0
Reputation
-
$path = FILES_PATH.$path; Could that be an issue? FILES_PATH?
-
add a print_r($file_info); somewhere and see if it contains the details it should. Where does this get_image(); function come from?
-
We need some code of somesort to help you. Where is the code that you use to check if they are under 18? You will need 2 variables, one of the logged in user ($user_age) and one of the user you are trying to message/add/whatever ($target_age) then base your if statement off that Need some code to help. What variables do you have to work with?
-
I don't think apache has much to do with PHP at all. As far as I'm aware PHP runs the code, and simply hands Apache the HTML to be served via http. Are the GD library's installed correctly and loaded? Maybe make a small test page. Just throwing idea's.
-
I could be wrong, but if it is working on one server, but not the next. I would say its a PHP enviroment issue? Maybe check php.ini between the two servers?
-
Ok, well we are very close. The issue here now is the first page, where the <option> tag is built. you need a "value=" bit in each of your options containing the employee ID. Replace your printf line with this {printf("<option value=%s>%s, %s</option>\n", $row['employeeID'], $row['lastName'], $row['firstName']);} ?> Let me know if you don't understand anything and I'll explain in a little more detail. There's no use having it work and you not understand what was wrong.
-
When the SQL server gets that string, any values (not table/field names) need to be in quotes. DELETE FROM employees WHERE employeeID=German, Sarah needs to read: DELETE FROM employees WHERE employeeID='German, Sarah' so your SQL line to: $sql = 'DELETE FROM employees WHERE employeeID=\''.$_POST['deleteUser'].'\'';
-
Only show Mysql data from a certain user
Moon-Man.net replied to winmastergames's topic in PHP Coding Help
Haku, I apologize, my mistake. I was judging what he wanted via the code, I must have misread his first post. -
Only show Mysql data from a certain user
Moon-Man.net replied to winmastergames's topic in PHP Coding Help
Haku, he is not trying to display the email at all, he wants the ftp username, ftp password and weburl for the specific user out of the database.... <?php //Defines Vars // Connects to your Database mysql_connect("localhost", "root", "com12345") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); //checks cookies to make sure they are logged in if(isset($_COOKIE['ID_my_site'])){ $username = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $check = mysql_query("SELECT * FROM users WHERE username = '{$username}'")or die(mysql_error()); while($info = mysql_fetch_array( $check )){ //if the cookie has the wrong password, they are taken to the login page if ($pass != $info['password']){ header("Location: login.php"); }else{ $yrwebsite = $_POST["weburl"]; echo "Website Administration<p>"; if (isset($_COOKIE["ID_my_site"])){ echo "Welcome " . $_COOKIE["ID_my_site"] . " to SWD<br />"; }else{ echo "Welcome guest!<br />"; } $sql = "SELECT * FROM users"; $query = mysql_query($sql); $result=mysql_fetch_array($query); while($result as $row ) { echo "<td>Your website URL is: ".$row['weburls']."</td>"; echo "<td>Your FTP Username is: ".$row['ftpuser']."</td>"; echo "<td>Your FTP Password is: ".$row['ftppass']."</td>"; } echo "<br><a href=logout.php>Logout</a>"; echo "<br>"; echo "<br>DEBUG RESULT:"; echo "Username: " .$username ."<br>"; print_r(mysql_fetch_array($query)); } } }else{ //if the cookie does not exist, they are taken to the login screen header("Location: login.php"); } ?> Let me know what that outputs, I'm guessing $username isnt being set correctly -
Only show Mysql data from a certain user
Moon-Man.net replied to winmastergames's topic in PHP Coding Help
My Mistake, forgot a ';' on line 35 <?php //Defines Vars // Connects to your Database mysql_connect("localhost", "root", "com12345") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); //checks cookies to make sure they are logged in if(isset($_COOKIE['ID_my_site'])){ $username = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $check = mysql_query("SELECT * FROM users WHERE username = '{$username}'")or die(mysql_error()); while($info = mysql_fetch_array( $check )){ //if the cookie has the wrong password, they are taken to the login page if ($pass != $info['password']){ header("Location: login.php"); }else{ $yrwebsite = $_POST["weburl"]; echo "Website Administration<p>"; if (isset($_COOKIE["ID_my_site"])){ echo "Welcome " . $_COOKIE["ID_my_site"] . " to SWD<br />"; }else{ echo "Welcome guest!<br />"; } $sql = "SELECT * FROM users WHERE username = '$username'"; $query = mysql_query($sql); while($row = mysql_fetch_array($query)) { echo "<td>Your website URL is: ".$row['weburls']."</td>"; echo "<td>Your FTP Username is: ".$row['ftpuser']."</td>"; echo "<td>Your FTP Password is: ".$row['ftppass']."</td>"; } echo "<br><a href=logout.php>Logout</a>"; echo "<br>"; echo "<br>DEBUG RESULT:"; print_r(mysql_fetch_array($query)); } } }else{ //if the cookie does not exist, they are taken to the login screen header("Location: login.php"); } ?> -
Only show Mysql data from a certain user
Moon-Man.net replied to winmastergames's topic in PHP Coding Help
Please try this <?php //Defines Vars // Connects to your Database mysql_connect("localhost", "root", "com12345") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); //checks cookies to make sure they are logged in if(isset($_COOKIE['ID_my_site'])){ $username = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $check = mysql_query("SELECT * FROM users WHERE username = '{$username}'")or die(mysql_error()); while($info = mysql_fetch_array( $check )){ //if the cookie has the wrong password, they are taken to the login page if ($pass != $info['password']){ header("Location: login.php"); }else{ $yrwebsite = $_POST["weburl"]; echo "Website Administration<p>"; if (isset($_COOKIE["ID_my_site"])){ echo "Welcome " . $_COOKIE["ID_my_site"] . " to SWD<br />"; }else{ echo "Welcome guest!<br />"; } $sql = "SELECT * FROM users WHERE username = '$username'"; $query = mysql_query($sql); while($row = mysql_fetch_array($query)) { echo "<td>Your website URL is: ".$row['weburls']."</td>"; echo "<td>Your FTP Username is: ".$row['ftpuser']."</td>"; echo "<td>Your FTP Password is: ".$row['ftppass']."</td>"; } echo "<br><a href=logout.php>Logout</a>"; echo "<br>"; echo "<br>DEBUG RESULT:" print_r(mysql_fetch_array($query)); } } }else{ //if the cookie does not exist, they are taken to the login screen header("Location: login.php"); } ?> -
haku is correct with the form name tags. no need. He is also correct on the posting issue, you could also use: <form action=deleteUser2.php method="get"> and $sql = 'DELETE FROM employees WHERE employeeID='.$_GET['deleteUser].'';
-
Only show Mysql data from a certain user
Moon-Man.net replied to winmastergames's topic in PHP Coding Help
can you please post the complete code? Thanks -
Explode file to array and use parts for MySQL?
Moon-Man.net replied to pakenney38's topic in PHP Coding Help
I may be wrong, but try changing these two lines foreach ($line as $key => $value) { $info = explode("\t", $value); to oreach ($line as $single_line) { $info = explode("\t", $single_line); Maybe add a few debug echo's around the joint to see whats happening -
Only show Mysql data from a certain user
Moon-Man.net replied to winmastergames's topic in PHP Coding Help
Providing the data in the MySql database field `username` matches $username, this should work. Echo $username, and match it to the `username` field in the database. If they don't match, then there is your problem. if they do, then it is somewhere in your display code.