Jump to content

phpnewbei

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by phpnewbei

  1. Hello everybody! I've been working with CSS/HTML for 2 years and would like your comment on this 'Design' I will add to my World of Warcraft forum that i am currently working on! Would also love some ideas for the website Image shown below! http://imageshack.us/f/716/generaldesignwow.jpg/
  2. Thanks for all the replies! Adam, I'll look at the jQuery-plugin you linked to and will try to work from that. Anyhow, I will try to get a grip about the MySQL part, I think it should work out just fine! //Machram
  3. Thanks for a fast reply! That was what I was looking for, but do you know if I can use MySQL commands in there also? Cuz it's pretty much needed I'm going to use it for a photo that you can choose to make as profile picture In the meantime, i'll try to fix it on my own! Thanks in advance! / Machram
  4. I need help with my webpage here, how do you get so if you are at http://www.blabla.com/account.php and then click on a photo, it will go to www.blabla.com/photo.php?id=1 but still be at account.php? Just like facebook shows their photos. I dont know how to think nor to get it work. Would appreciate some help! ThNXX 1n 4dv4nc3 // Machram!
  5. Not that good at explaining stuff, haha. Sorry mate, good luck tho!
  6. $votes = mysql_query("SELECT * FROM toplist WHERE serverowner='" . $_SESSION['user'] . "'") or die(mysql_error()); Think it should be like this, not sure though.
  7. As the title says I need help with multiple update system.. Can't really get it to work at all >.< Here's some code: $selectt = mysql_query("SELECT * FROM exercises WHERE user='" . $_SESSION["user"] . "' AND exname='" . $_GET["edit"] . "'"); echo '<form method="POST" action="exercises.php?edited">'; echo '<div id="newexx">'; while($raw = mysql_fetch_array($selectt)) { echo '<input type="text" name="up[' . $raw["id"] . ']" value="' . $raw["swe"] . '">'; echo '<input type="text" name="up1[' . $raw["id"] . ']" value="' . $raw["eng"] . '"><br>'; echo '<input type="hidden" name="id[' . $raw["id"] . ']">'; } echo '</div>'; echo '<input type="submit" value="Update Exercise">'; echo '</form>'; if(isset($_GET["edited"])) { $swe = $_POST["up"]; $eng = $_POST["up1"]; $id = $_POST["id"]; foreach($id as $value => $index) { $update = "UPDATE exercises SET swe='".$swe."', eng='".$eng."' WHERE id='".$index."'"; mysql_query($update); } Would be thankful for reply!
  8. <?php echo "<div id=\"homeform\">"; if(isset($_SESSION["username"])){ $link1 =' <a href="members.php?uname&changeinfo=' . $_SESSION["username"] . '"> Change information </a>'; $uname = isset($_GET['uname']) ? $_GET['uname'] : 'guest'; if($_SESSION["username"] == $uname){ echo "hej"; echo $link1; } elseif ($_SESSION["username"] == $_GET["changeinfo"]) { $sql = mysql_query("SELECT * FROM userinfo WHERE username='" . $_SESSION["username"] . "'"); while($row = mysql_fetch_array($sql)){ echo '<form method="POST" action="members.php?uname&changeinfo=' . $_SESSION["username"] . '">'; echo '<input type="text" name="name" value=' . $row["firstname"] . '>'; echo '<input type="submit" name="submit" value="Change">'; echo '</form>'; $firstname = $_POST["name"]; mysql_query("UPDATE userinfo SET firstname='$firstname' WHERE username='" . $_SESSION["username"] . "'"); } if($_POST["submit"]) { echo "Success!"; } } else { echo "du suger"; } echo "</div>"; } ?>
  9. Now, If I write something in my input fields and update, it works, but when I go back and change the information again, the field in my database gets emtpy :S My guess would be that when the database have been update, nothing happends, you'll return to the input field again.
  10. What's the differences between " and ' ? By the way, it doesn't update the table ;/
  11. Now I have an UPDATE error heh, here's my code: elseif ($_SESSION["username"] == (isset($_GET["changeinfo"]))) {$sql = mysql_query("SELECT * FROM userinfo WHERE username='" . $_SESSION["username"] . "'");while($row = mysql_fetch_array($sql)){echo "<form method=\"POST\" action=\"members.php?uname&changeinfo=" . $_SESSION["username"] . "\">";echo "<input type=\"text\" name=\"name\" value=\"" . $row["firstname"] . "\">";echo "<input type=\"submit\" value=\"Change\">";echo "</form>";$firstname = isset($_POST["name"]);mysql_query("UPDATE userinfo SET firstname='$firstname' WHERE username=" . $_SESSION["username"] . "");}}
  12. So I should place $uname = isset($_GET['uname']) ? $_GET['uname'] : 'guest'; in the beginning?
  13. Could you explain more how the code works and what it means?
  14. Ahh, thankyou It works properly now. I'll try to work on my own now, if it's something i'll write it here. Again, thankyou!
  15. I've done that now, but it still don't work cuz in my address field When I'm logged in as "Machram" and click in my profile the address field is : http://localhost/project/members.php?uname=Machram When I go to like "http://localhost/project/members.php?uname=Test" It still says the same thing on the page "Echo "Hello";"
  16. What do you mean? I have a session_start(); right after the php tags.
  17. Need some help with Profile page, it goes like this: <html> <head> <style type="text/css" media="all"> @import url("style.css"); </style> </head> <body> <div id="header"> <h1><a href="index.php">ProjecTM</a></h1> </div> <div id="menu"> <ul> <a href="index.php">News</a> <a href="guestbook.php">Guestbook</a> <a href="changepassword.php">Change Password</a> <a href="logout.php">Log out</a> </ul> </div> <?php include("dbconnect.php"); session_start(); echo "<div id=\"homeform\">"; if(isset($_SESSION["username"])){ $link1 =' <a href="members.php?uname&changeinfo=' . $_SESSION["username"] . '"> Change information </a>'; if($_SESSION["username"] == isset($_GET["uname"])){ echo "hej"; } elseif ($_SESSION["username"] != isset($_GET["uname"])) { echo "hejdå"; } } echo "</div>"; ?> </body> </html> THe link to the profile page goes like this: echo "<a href=\"members.php?uname=" . $user . "\">Your page</a>";
  18. Yeah it was set, but at sometimes it wasn't! But now I deleted almost everything to do a fresh start, I noticed I messed up every code I had haha Anyone know how you do a "Profile Page"? I want to do, if($_SESSION["username"] == $_GET["uname"]){ echo "Edit your information"; } else{ echo "Checking someone elses profile"; } Here's my code: <html> <head> <style type="text/css" media="all"> @import url("style.css"); </style> </head> <body> <div id="header"> <h1><a href="index.php">ProjecTM</a></h1> </div> <div id="menu"> <ul> <a href="index.php">News</a> <a href="guestbook.php">Guestbook</a> <a href="changepassword.php">Change Password</a> <a href="logout.php">Log out</a> </ul> </div> <?php include("dbconnect.php"); session_start(); echo "<div id=\"homeform\">"; if(isset($_SESSION["username"])){ $link1 =' <a href="members.php?uname&changeinfo=' . $_SESSION["username"] . '"> Change information </a>'; if($_SESSION["username"] == isset($_GET["uname"])){ echo "hello"; } elseif ($_SESSION["username"] != isset($_GET["uname"])) { echo "goodbye"; } } echo "</div>"; ?> </body> </html>
  19. Notice: Undefined index: uname in C:\wamp\www\project\members.php on line 26 Notice: Undefined index: uname in C:\wamp\www\project\members.php on line 39 Notice: Undefined index: changeinfo in C:\wamp\www\project\members.php on line 46 Here's the code: <html> <head> <style type="text/css" media="all"> @import url("style.css"); </style> </head> <body> <div id="header"> <h1><a href="index.php">ProjecTM</a></h1> </div> <div id="menu"> <ul> <a href="index.php">News</a> <a href="guestbook.php">Guestbook</a> <a href="changepassword.php">Change Password</a> <a href="logout.php">Log out</a> </ul> </div> <?php include("dbconnect.php"); session_start(); echo "<div id=\"homeform\">"; if(isset($_SESSION["username"])){ $link1 =' <a href="members.php?uname&changeinfo=' . $_SESSION["username"] . '"> Change information </a>'; Line 26 -> if($_SESSION["username"] == $_GET["uname"]){ echo "<h3>Here you can change private information, what you would like to show to other users and change account information!</h3>"; $uname = $_GET["uname"]; $sql = mysql_query("SELECT * FROM userinfo WHERE username='$uname'"); echo "<div id=\"loginform\">"; while($row = mysql_fetch_array($sql)){ echo "Förnamn: " . $row["firstname"] . "<br>"; echo "Efternamn: " . $row["lastname"]; } echo "</div>"; echo $link1; } else { Line 39 -> $hamta = $_GET["uname"]; $sql = mysql_query("SELECT * FROM userinfo WHERE username='$hamta'"); while($row = mysql_fetch_array($sql)){ echo ($row["firstname"]) . " "; echo ($row["lastname"]) . " "; } } Line 46 -> if ($_GET["changeinfo"] == $_SESSION["username"]){ echo "byt saker"; $hamta = $_GET["changeinfo"]; $sql = mysql_query("SELECT * FROM userinfo WHERE username='$hamta'"); if(isset($_GET["submit"])){ $update = "UPDATE userinfo SET firstname='$firstname' WHERE username=machram"; mysql_query($update); } while($row = mysql_fetch_array($sql)){ echo "<form method=\"get\" action=\"members.php?uname&changeinfo=\"" . $_SESSION["username"] . "&\">"; echo "Förnamn: "; echo "<input type=\"text\" name=\"firstname\" value=\"" . $row["firstname"] . "\">"; echo "<input type=\"submit\" name=\"submit\">"; } } } echo "</div>"; ?> </body> </html>
  20. But if I want to check from form like this: if (($_GET["email"]) == filter_var("chris@example.com", FILTER_VALIDATE_EMAIL)) (Don't ask me what've done, I just tested some things ^^) How do I do then?
  21. As the topis says, I need help with an email form. You must have valid email address to go further, so lets say you write asdada as email, you won't be able to register the account, you must have asdada@hotmai.com or something like that. If anyone knows it would be awesome!
  22. Is it the background of the whole page, or what? x)
  23. Would be better if I could take a look at your site
×
×
  • 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.