Jump to content

AngelicS

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Everything posted by AngelicS

  1. Try this: $get = mysql_query("SELECT * animals WHERE id='$id_post'"); You had written WHERE id=$'id_post' the "$" should be inside the ' ' And also, you should start adding `` to table and column names, like this. $get = mysql_query("SELECT * `animals` WHERE `id`='$id_post'"); Best wishes //AngelicS
  2. You can use the following code: <?php //This varaible contains a random number between 1 and 3 $rand=rand(1,3); //The switch statement will check wich number the rand variable contains. //Depending on the $rand variable value, The variable $link, and $name will get a value. //Then you use these values in the link on the bottom. switch($rand) { case 1: $link='http://www.google.com'; $name='Google'; break; case 2: $link='http://www.phpfreaks.com'; $name='PHP Freaks'; break; case 3: $link='index.php'; $name='Homepage'; break; default: echo "something went wrong"; break; } ?> <a href="<?php echo $link; ?>"><?php echo $name; ?></a> If you don't know how to use the switch statement, check the following links: PHP Manual - Switch http://us2.php.net/manual/en/control-structures.switch.php W3Schools - Switch http://www.w3schools.com/PHP/php_switch.asp Best Wishes //AngelicS
  3. I think this is your solution: Email:<a href=\"mailto {['$Email']}\"><$Email></a><br> You have to use backslashes inside the href, (or you can also use a single quote mark -> ' ), or else you will close the "echo". Note: The backslash is being removed, but you must use a backslash before both Quotation marks -> " By the way, please use code tags, since it will make it much easier to read, thanks =) Best wishes //AngelicS
  4. I don't know if this is exactly what you need, but I've fixed your code. Here you go: <?php $status=$row['print_status']; if($status==0) { ?> <a href="javascript:popWindows('print2.php?rid=<?php echo $row['id']; ?>&pid=<?php echo $_REQUEST['pid'];?>','_winName','1000','1000','scrollbars=1')" style="color:#2A9F00; font-size:12px;"> <?php echo "Print"; echo "</a>"; } else { ?> <a href="javascript:popWindows('print2.php?rid=<?php echo $row['id']; ?>&pid=<?php echo $_REQUEST['pid'];?>','_winName','1000','1000','scrollbars=1')" style="color:#2A9F00; font-size:12px;"> <?php echo "Already printed"; echo "</a>"; } ?> By the way, try using the code tags, and try posting the error(s) you get =) Best wishes //AngelicS
  5. Hmm.. try adding this on every page: <?php if(!isset($_SESSION['student'])) { //Ask the user to login. Add forms etc. } else { //Show the page that's supposed to be seen. } ?> Best wishes //AngelicS
×
×
  • 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.