Jump to content

cruxaders

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cruxaders's Achievements

Member

Member (2/5)

0

Reputation

  1. heres is my code for time but it ddnt the time i get was not same in my computer $date = date("y-d-m") . " at " . date("h:i:s"); $time = time();
  2. hirs the code...my proble is when i upload a image yes its upload but the problem is the previous image that he got...that still the image i see after i click submit..then i press f5 to see the updated image i uploaded.... what i want is after i press submit button i want the previous image will be automatic replaced by current/updated images no need to press F5 $id = "sir"; $sql = "SELECT * FROM `users` WHERE `username` = '".$id."'"; $res = mysql_query($sql) or die (mysql_error()); $row = mysql_fetch_assoc($res); $location = $row ['imagelocation']; echo "avatar <img src=\"$location\" width=\"100\" height=\"100\">"; echo "<form action=\"\" name=\"form1\" enctype=\"multipart/form-data\" method=\"post\" >"; echo "<input type=\"file\" name=\"image\" />"; echo "<input type=\"submit\" name=\"submit\" value=\"submit\" action =\"\">"; echo "</form>"; if($_POST['submit']) { $name = $_FILES['image']['name']; $tmp_name = $_FILES['image']['tmp_name']; $location = "avatar/".$name; move_uploaded_file($tmp_name,$location); $sql = mysql_query("UPDATE `users` SET `imagelocation` = '".$location."' WHERE `username` = '".$id."'") or die (mysql_error());
  3. i got a submit button... if user click the submit button iwant to page will auto referesh... can someone teach me
  4. still ddnt see anything no error..all white what should i do...
  5. When i try to run the page...i ddnt see anything...its just a plane white background.. is there a problem in my code <?php $con = mysql_connect ("localhost","root",""); if(!$con) { die ('could not connect:' . mysql_error()); } mysql_select_db ("users", $con); $username = "sample"; $sql = "SELECT * FROM `users` WHERE `id`='".username."'"; $res = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($res)) { $imagename = $_FILES['image']['imagename']; $tmp_name = $_FILES['image']['tmp_name']; $location = "avatar/".$imagename; move_uploaded_file($tmp_name,$location); $avatar = mysql_query("SELECT imagelocation FROM `users` WHERE `id`='".$username."'")or die(mysql_error()); $row3 = mysql_fetch_assoc($avatar); $location = $row3['imagelocation']; echo"<table width=\"686\" height=\"178\" border=\"0\">"; echo"<tr> <td width=\"160\" height=\"30\">First Name</td> <td width=\"321\">" . $row['name'] . "</td> </tr>"; echo"<tr> <td height=\"31\">Email Address</td> <td>" . $row['email'] ."</td> </tr>"; echo"<tr> <td height=\"28\">Username</td> <td>" . $row['username'] ."</td> </tr>"; echo"<tr> <td height=\"30\">ProfilePic</td> <td> </td> </tr>"; echo"<tr> <td><table width=\"100\" border=\"0\" align=\"center\"> <tr> <td><img src =\"$location\" width=\"100\" hieght=\"100\"></td> </tr>"; echo"</table></td>"; echo"<td><form id=\"form1\" name=\"form1\" enctype=\"multipart/form-data\" method=\"post\" action=\"\"> <input type=\"file\" name=\"image\" id=\"image\" />"; echo"</form></td> </tr> </table>"; } mysql_close($con); ?>
  6. ill already figure out the image... tnx for the help and time
  7. $avatar2 = mysql_query("SELECT users.imagelocation FROM users , forum_replies WHERE users.id=forum_replies.uid ")or die(mysql_error()); $row4 = mysql_fetch_assoc($avatar); $location2 = $row4['imagelocation']; <table width=\"100\" border=\"0\" align=\"center\"> <tr> <td><img src =\"$location2\" width=\"100\" hieght=\"100\"></td> </tr> </table>
  8. this the other code with fetch $avatar2 = mysql_query("SELECT users.username, forum_replies.message FROM users,forum_replies WHERE users.id= forum_replies.uid ")or die(mysql_error()); $row3 = mysql_fetch_assoc($avatar2); $location2 = $row4['imagelocation']; <table width=\"100\" border=\"0\" align=\"center\"> <tr> <td><img src =\"$location2\" width=\"100\" hieght=\"100\"></td> </tr> </table>
  9. if thats the correct code why the image not yet shawn..what will i do to make the image visible
  10. btw i forgot to tell i got 2 tables 1st table is users, with fields -id -username -imagelocation 2nd table is forum_replies with fields -id -uid -message what i want to do in sql is to get the image location.. but when i echo the $avatar2 it appears Resource id #3 idk what the problem on my code
  11. can someone check if what the problem with my code $avatar2 = mysql_query("SELECT `users`.`imagelocation' FROM `users` `forum_replies` WHERE `users`.`id`= `forum_replies`.`uid`")or die(mysql_error());
  12. my problem is if my local date is february 1 or march 30... if i press previous month i cant see the month of february, but if i press the change the local date to february 2 or march 29 i can see the month of february in my event calendar... what should i do to see the month of february even i set the local date in february 1 or march 30.... heres the code if (isset($_GET['day'])){ $day = $_GET['day']; } else { $day = date("j"); } if(isset($_GET['month'])){ $month = $_GET['month']; } else { $month = date("n"); } if(isset($_GET['year'])){ $year = $_GET['year']; }else{ $year = date("Y"); } $currentTimeStamp = strtotime( "$day-$month-$year"); $monthName = date("F", $currentTimeStamp); $numDays = date("t", $currentTimeStamp);
  13. i got a problem on undefined index...but if i use Xampp i can run in nicely with our error..but in wamp it say undefined index... what i supposed to do.... so that i can run it in both xampp and wamp nicely
×
×
  • 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.