Jump to content

Philip

Staff Alumni
  • Posts

    4,665
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by Philip

  1. /* build selection list for the year */ $today = time(); $startYr = date("Y", $today); //get the year from $today echo "<select name='syear'>\n"; $endYr = $startYr-90; // get the date you want to end up at for ($syear=$startYr;$syear<=$endYr;$syear--) { echo " <option value=$syear"; if ($startYr == $syear ) { echo " selected"; } echo "> $syear\n"; } echo "</select>\n";
  2. Also, are magic quotes on and you are using addslashes( ) That would put like: Then stripslashes only takes one set away:
  3. As thorpe said, you need to sanitize your input.... But the query problem lies here: `city2` = '{$_POST['city2']}, (You're missing a ' ) `city2` = '{$_POST['city2']}',
  4. Im glad you think so
  5. Would if a number is between 1 and 4 automatically knock the other 2 qualifications out? If the number is 0, its not between 1 and 4, and if the number is 3, 3 isn't greater than 750, lol By the way, if you check if that number is between 1 and 4, including 1 and 4: if($var >= 1 && $var <=4)
  6. You deleted it from the wrong location. Note: _dl, not _cats
  7. while($row_rs_multi_dl = mysql_fetch_assoc($rs_multi_dl)); } That } afterwards is not needed. Proper indenting would help
  8. Look at this line with a syntax highlighter: echo "<div class='catdetail_header'><h1 class="style1">'.ucwords($row_rs_multi_dl['category']).'</h1>" ; echo '<div class="catdetail_header"><h1 class="style1">'.ucwords($row_rs_multi_dl['category']).'</h1>' ; See the difference?
  9. http://locusmeus.com/html-css/centerexample3.html
  10. As CV suggested - just use an array and cut out the middleman while($app_info = $database->database_fetch_assoc($app)) { $app_array[] = $app_info; } You'd have to change your query a little bit (select exactly what you want) $app_query = "SELECT `user_id`,`app_info1`,`item_id`,`profile`,`name`,height`,`width`+10 as width FROM se_apps WHERE user_id='".$this->user_info[user_id]."' AND app_info2=1 AND profile=1 ORDER BY order_id ASC LIMIT 0,30";
  11. Well, I admit I made a mistake in my earlier code: <?php session_start(); if(isset($_SESSION['auth']) && $_SESSION['auth']!='yes') { session_destroy(); $_SESSION['auth']=""; // you want to set this, not compare it } header("Location: /test/project12.php"); // always redirect to home ?> should be: <?php session_start(); if(isset($_SESSION['auth']) && $_SESSION['auth']=='yes') { session_destroy(); $_SESSION['auth']=""; // you want to set this, not compare it } header("Location: /test/project12.php"); // always redirect to home ?> my apologies
  12. Look at it with syntax highlighting: $delete_sql = "DELETE FROM jos_facileforms_subrecords WHERE name LIKE \'%'.$badword.'%\' "; $delete_sql = "DELETE FROM jos_facileforms_subrecords WHERE name LIKE '%".$badword."%' ";
  13. Let's go back to the basic operators: Assignment operator: $a = 1 Assigns value 1 to variable a Equal operator: if($a==1) Check to see if variable a is equal to 1 Not equal operator (not and equal operator combined ): if($a!=1) Check to see if variable a is not equal to 1 So... <?php if (isset($_SESSION['auth']) && $_SESSION['auth']== "yes") { echo "signed in"; } else { echo "Log in please"; } ?> <?php session_start(); if(isset($_SESSION['auth']) && $_SESSION['auth']!='yes') { session_destroy(); $_SESSION['auth']=""; // you want to set this, not compare it } header("Location: /test/project12.php"); // always redirect ?>
  14. Again, you're using just 1 equal sign, instead of the comparison sign (==)
  15. if (@$_SESSION['auth'] = "yes") should be if (@$_SESSION['auth'] == "yes") And really, the whole code should be this (IMO): <?php session_start(); if(isset($_SESSION['auth']) && $_SESSION['auth']!='yes') session_destroy(); header("Location: home.php"); ?>
  16. SEO board: http://www.phpfreaks.com/forums/index.php/board,102.0.html A topic that is pretty similar: http://www.phpfreaks.com/forums/index.php/topic,213847.0.html Hopefully that helps
  17. what error ? Caused by the ticks around the 2 in the limit clause. They shouldnt be there
  18. The separator for GET vars is &, not ? foo.php?bar=something&other=5
  19. while($row = mysql_fetch_assoc($result)) { echo $row['Title']; echo $row['SubTitle']; } you're calling for Title, when it should be title - same with subtitle
  20. Or the modulus operator. Not tested, just thrown together quickly: <?php $i = 0; do { if($i%2==0) { ?> <tr> <td width="50%"><a href="http://<?php Echo $row_RS2['URL'] ?>" target="_blank" class="V12"> <?php Echo $row_RS2['employer'] ?> </a></td> <?php } else { ?> <td><a href="http://<?php Echo $row_RS2['URL'] ?>" target="_blank" class="V12"> <?php Echo $row_RS2['employer'] ?> </a></td> </tr> <?php } $i++; } while ($row_RS2 = mysql_fetch_assoc($RS2)); if($i%2>0) { echo '<td></td></tr>'; // in case of ending in an odd number of columns } ?>
  21. travellingbuttons('Y','coords','1',50,50,'1'); $GetArray = travellingbuttons(); should be $GetArray = travellingbuttons('Y','coords','1',50,50,'1');
  22. You'd use an array function someFunc( ) { $array = array('foo', 'bar'); return $array; } $myValue = someFunc(); // myValue now is an array with [0] => "foo" and [1] => "bar"
  23. I don't think putting in tags automatically would be a good solution. A simple check to see if there are code tags (<?php, <html>, etc) outside of or [php] tags, then generate a warning (much like the one that says "Warning: someone has replied blah blah"). Something like the following would suffice I think.[color=red][b]Warning:[/b] you currently have code outside of [code] tags, this will disable any formatting of the code[/color] Even so, that could get annoying when you type a short 4 line reply like: <?php session_start(); // don't forget the line above! ?> And, it most likely wouldn't be able to detect snippits without opening tags: $foo = 'bar'; echo $foo; As mentioned before, it's up to the OP. But it is super annoying viewing posts with code not in or
  24. that's the php tag
  25. I'll agree, prepared statements are pretty awesome
×
×
  • 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.