Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. Okay, here is an example. <?php $query = mysql_query("SELECT username FROM table"); $row = mysql_fetch_assoc($query); //put username into link to profile page echo "<a href='profile.php?user={$row['username']}'>Go to {$row['username']}'s Profile</a>"; ?> Now, on the profile page, the code should look like this: <?php //get username from the URL $username = mysql_real_escape_string($_GET['user']); //Get information about that user from database to display profile information $query = "SELECT * FROM users WHERE username='$username'"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); //Now you can start displaying their profile information with the info from the database. echo "This is {$row['username']}'s Profile page"; ?>
  2. You need to use a unique identifier in the URL for that user, such as their username or user ID. Then if the URL looks something like this: www.domain.com/profile.php?user=bob Then you can do a query to the database getting the information you need by using their username, which in this case would be "bob". Let me know if you need further explanation.
  3. Try changing this line: if(("{$_SESSION['admin']['admins']}" == "root") && ("{$_SESSION['admin']['adminpass']}"=="pwd123")){ To if (($_SESSION['admin']['admins'] == "root") && ($_SESSION['admin']['adminpass'] == "pwd123")){ Also, you should be calling session_start() at the TOP of your script.
  4. You need to call session_start(); at the top of all your pages.
  5. You didn't put the "or" before the "die". So change this line: $sql = mysql_query("SELECT * FROM students") die(mysql_error()); To $sql = mysql_query("SELECT * FROM students")or die(mysql_error());
  6. http://www.tizag.com/mysqlTutorial/
  7. Use a foreach loop. <?php foreach ($_GET as $key => $val){ echo $key .' - '. $val .'<br>'; } ?>
  8. Like this: <?php // OPEN THUMBNAILS DIRECTORY $handle = opendir ('./thumbnails/'); $count = 0; while (false !== ($file = readdir($handle))) { // RECOGNISE FILES if($file != "." && $file != ".." && $file != basename(__FILE__)) { // PRINT THUMBNAIL IMAGE AND LINK TO EACH LARGER IMAGE FOR EVERY IMAGE FOUND print "<a href='./uploadedimages/{$file}' target='_blank'> <img src='./thumbnails/{$file}'></a>"; if ($count == 5){ echo '<br />'; $count = 0; } $count++; } } ?>
  9. With HTML? Instead of using <ul> use <ol>.
  10. Good places to learn are: www.tizag.com www.w3schools.com
  11. Your code looks like this: <option value"4"> You need to put an equals sign in there: <option value="4">
  12. UPDATE quests SET ReqItemId1='$last', ReqItemId2='$last', ReqItemId3='$last' WHERE ReqItemId1='{$items['entry']}' Just follow that pattern.
  13. There was a similar question asked on a different forum, here are the answers:
  14. Check this tutorial out: http://www.hesido.com/web.php?page=imageswapping
  15. You gave a pretty vague description, but it sounds like you need javascript.
  16. Are you calling session_start() at the top of ALL your pages?
  17. Try this: <?php function productList($prod_id, $id) { $str = '<p style="margin-left: 15px; font-size: 14px;"><a href="ticket.php?id='.$id.'&p=prod_3">'.$prod_id.'</a></p>'; return $str; } echo productList('2', $_GET['id']); ?> All I did was assign what you had printing inside of the function to a variable, and I returned it.
  18. You could use a delimiter for the select boxes value, that way you can store the ID and email. Like this: <option value="ID-Email">Teams Name</option> Then on the next page, you can just use the explode() function to separate the ID and email by the hyphen.
  19. Like this: <?php if (isset($_POST['submit'])){ if (isset($_POST['check'])){ echo "Checked"; } else { echo "Not Checked"; } } ?> <form method="post"> <input type="checkbox" name="check" /> <input type="submit" name="submit" value="Submit" /> </form>
  20. Give us your table structures. Also, which field ties table1 and table2 together?
  21. Oops, I completely looked over the "AND" that was there. They are right, you need to use "OR".
  22. Did you try my code? What didn't work about it? You have this line just by itself: WHERE `id` = '1546' AND `id` = '1' You have to put that in an actual query. That is only part of a query, look at the example I gave you above.
  23. <?php $query = mysql_query("SELECT id FROM table WHERE id=1 and id=1546"); while ($row = mysql_fetch_assoc($query)){ echo $row['id'].'<br>'; } ?>
×
×
  • 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.