Jump to content

Moon-Man.net

Members
  • Posts

    84
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Moon-Man.net's Achievements

Member

Member (2/5)

0

Reputation

  1. $path = FILES_PATH.$path; Could that be an issue? FILES_PATH?
  2. add a print_r($file_info); somewhere and see if it contains the details it should. Where does this get_image(); function come from?
  3. 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?
  4. 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.
  5. 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?
  6. 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.
  7. 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'].'\'';
  8. Haku, I apologize, my mistake. I was judging what he wanted via the code, I must have misread his first post.
  9. 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
  10. 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"); } ?>
  11. 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"); } ?>
  12. 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].'';
  13. 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
  14. 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.
×
×
  • 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.