Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. You need to remove the margins/padding for your ul tag (#mainMenuTop) within your CSS. #MainMenuTop { width:900px; height:27px; margin:0; padding:0; }
  2. yes if you set the QSA flag RewriteRule ^(.*)/(.*)/ index.php?foo=$1&foo2=$2 [L,QSA]
  3. Doesn't Windows 7 use Internet Explorer 8? IE8 has been release couple weeks back now.
  4. variables are separated by ampersands (eg &) within urls not ? marks $subm = 'y'; <td bgcolor="#FFFFFF" ><a href="xray_editpatient.php?action=edit&id=<?php echo $row['id_incr']; ?>&id2=<?php echo $subm; ?>">
  5. mysql_query does not return anything. It only returns a result resource. You need to use one of the mysql_fetch_* functions to get the results from a query. For example $result = mysql_query ("SELECT title, subtitle FROM articles ORDER BY ID DESC"); while(list($title, $subtitle) = mysql_fetch_row($result)) { echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$title'>$title</a>"; }
  6. If you want someone to write scripts for you please post in the freelance forum. Thread locked.
  7. if zzzcookie is the name of your cookie then it should be $_COOKIE['zzzcookie'] not $_COOKIE[$zzzcookie]
  8. Oops. Forgot something include('includes/{$num}right.php'); include('includes/{$num}foot.php'); Should of been include("includes/{$num}right.php"); include("includes/{$num}foot.php");
  9. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <link rel="stylesheet" href="styles.css" type="text/css"/> <title> | Prac 7</title> </head> <body> <div class="header">Prac 7</div> <?php $num = (isset($_GET['num']) && is_numeric($_GET['num'])) ? $_GET['num'] : 1; include("includes/{$num}head.php"); include("includes/{$num}left.php"); ?> <p> Select a layout:</br> <a href="index.php">Layout1</a></br> <a href="index.php?num=2">Layout2</a></br> <a href="index.php?num=3">Layout3</a> </p> <?php include('includes/{$num}right.php'); include('includes/{$num}foot.php'); ?> </body> </html>
  10. use n2br $description_full = $row["description_full"]; echo nl2br($description_full);
  11. session_register/session_is_registered are depreciated functions. They should only be used if register_globals is enabled. When setting/retrieving a session variable you use the newer $_SESSION superglobal variable.
  12. Reverse the order of your rewrite rules RewriteRule (.*).html?id=(.*)$ /site/index.php?hello=$1&id=$2 [L] RewriteRule (.*).html$ /site/index.php?hello=$1 [L]
  13. You sure you don't call the function anywhere else within your script?
  14. Where do you call the add_friend() function? If you call the function add_friend() without checking whether $_GET['ref'] is set to 'addfriend' and $_GET['mid'] is present. Then your function will always be called and executed regardless of the url. You should be calling your function like so if(isset($_GET['ref'], $_GET['mid']) && $_GET['ref'] == 'addfriend' && is_numeric($_GET['mid'])) { add_friend(); }
  15. You'd be better of using an SQL JOIN here. <?php /* FOR QUERY SEE BELOW */ $result = mysql_query($query); echo "<ul>\n"; while($row = mysql_fetch_assoc($result)) { $checked = (in_array($row['id'], explode(',', $row['selected']))) ? 'checked="checked"' : ''; echo '<li><input type="checkbox" name="involvement[]" value="'.$row['id'].'" '.$checked.'/>'.$row['value']."</li>\n"; } echo "</ul>\n"; ?> Code is untested tho EDIT Sorry the query should of been $query = "SELECT t1.ID as id, t1.TYPE as type, t1.VALUE as value, t2.CHECKBOXES as selected FROM table1 as t1 JOIN table2 as t2 ON t2.TYPE = t1.TYPE WHERE t1.TYPE='foo1'"; You'll now need to setup your table2 table as +----+------------+ | ID | TYPE | VALUE | +----+------------+ | 1 | foo1 | 1,3,5 | +----+------------+
  16. You'll have to pull their current membergroup from your database first <?php $con = mysql_connect("localhost","root","***"); if (!$con) die('Could not connect: ' . mysql_error()); mysql_select_db("forumdb", $con); if(isset($_POST['name']) && trim($_POST['name']) != '') { $name = mysql_real_escape_string($_POST['name']); $result = mysql_query("SELECT mgroup FROM ibf_members WHERE name = '$name'"); if(mysql_num_rows($result) == 1) { list($membergroup) = mysql_fetch_row($result); if ($membergroup != 3) //here the statement begins { //If member is not a member of membergroup 3 echo "Your account is either a staff account, banned account, or not validated. The process has failed. Please contact the staff."; } else { //If member is a member of the third membergroup: mysql_query("UPDATE ibf_members SET mgroup = '7' WHERE name = '$name'"); echo "Your account has been upgraded."; } } else { // User not found echo "Sorry, Please verify the username provided is correct. The Username provided was not found"; } } else { echo "Please provide username"; } mysql_close($con); ?>
  17. Yes that is possible, the technique you just described is known as a flat file database. However you wont be able to do that with Wordpress. You will have to create your own blog system to achieve this.
  18. How is $reff set? Where is it coming from?
  19. I think you ment if($userstats3['pturns'] > 1 && $userstats3['turns'] > 1)
  20. Its if($userstats3['pturns'] < 1 && $userstats3['turns'] < 1)
  21. The problem I see with your query is that your variables are not in the order of your field names $repnumber should be before $fname also $email and $password should be after $phone mysql_query("INSERT INTO `loginreg` ( `repnumber` , `fname` , `lname` , `cname` , `phone` , `email` , `username` , `password` ) VALUES ('$repnumber', '$fname', '$lname', '$cname', '$phone', '$email', '$username', '$password')
  22. What other css are you using? Applying the background to the body tag should affect the whole page. Have you modified the html tag at all? Does this happen in any other browsers?
  23. Post code the you're having issues with here. Posting just your table structure wont yield many helpful answers.
  24. Because when you dont select any checkboxes, $_POST['time'] wont exist. However when you do select a checkbox it will. mysql_real_escape_string should only be used for strings. $_POST['time'] will be an array and this is why you get an error.
  25. $sql = sprintf("SELECT Name FROM %s WHERE Name LIKE '%%%s%%'", $tableName, mysql_real_escape_string($name));
×
×
  • 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.