jcbones
Staff Alumni-
Posts
2,653 -
Joined
-
Last visited
-
Days Won
8
Everything posted by jcbones
-
Your query should be: $query = "SELECT username, charactername, id, style_id AS style FROM `efed_bio` WHERE bio.username = '$username'";
-
Change your query to: $result = mysql_query($query) or die($query . '<br />' . mysql_error());
-
Your query is failing
-
Sorry, add an extra bracket ( } ) on the end of what I just gave you.
-
Replace the top block with: <?php if(isset($_GET['username']) && $_GET['username'] != '') { $username = $_GET['username']; $query = "SELECT bio.username AS username, bio.charactername AS charactername, bio.id AS id, bio.style_id AS style FROM `efed_bio` AS bio ON bio.id = ebw.bio_id WHERE bio.username = '$username'"; $result = mysql_query($query); if(mysql_num_rows($result) > 0) { $row = mysql_fetch_assoc($result); $row = array_map('cleanquerydata',$row); extract($row); } ?> Un-tested, so make sure you make a backup of your current script.
-
It seems that it is picking up getBioMenu() now. But not getHistory(); Nor $charactername,$type,$style,$page,$site_url, or $username. You need to make sure those variables are available to your page. Either through an include, or declaring.
-
Mail gets junked via Hotmail (PHP's Mail function)
jcbones replied to ChrisMartino's topic in PHP Coding Help
Hotmail will send you emails to the junk folder if a lot of people are sending them to junk on receiving them. Not advising, advertising, or etc. This just explains the process Hotmail uses. Any action taken by you, is your business. -
Your query is hosed, you are using ON syntax (which is used for table JOINS) on a single table. Try taking out: ON bio.id = ebw.bio_id And see if it works. PS. getBioMenu() is not a function in your build. Make sure you have spelt the function name right.
-
Straight forward multidimensional array question
jcbones replied to Vettel's topic in PHP Coding Help
I had a feeling that was the case. -
<?php require_once('inc/config.inc.php'); $sql = "SELECT `turns` FROM `exodus_users` WHERE 1 LIMIT 0, 30 "; $result = mysql_query($sql); if(mysql_num_rows($result) > 0) { while($r = mysql_fetch_assoc($result)) { echo $r['turns'] . '<br />'; } } else { echo 'No rows returned from the query.'; } ?>
-
Straight forward multidimensional array question
jcbones replied to Vettel's topic in PHP Coding Help
<?php $arr1 = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23); $i = 0; $n = 0; foreach($arr1 as $v) { $arr2[$n][] = $v; $n = ($i < ? $n : ++$n; $i = ($i >7) ? 0 : ++$i; } echo '<pre>'; print_r($arr2); echo '</pre>'; ?> -
So you are checking an actual date, against seconds? And, it doesn't work?
-
echo the query to make sure the variables are defined as you think they should be. This is one reason to set the query in it's own variable. $sql = "SELECT last_login_date FROM Member WHERE last_login_date BETWEEN '$time' AND '$current_time'"; $sql_members_online = mysql_query($sql) or die('Error: ' . $sql . '<br />' . mysql_error());
-
echo date('m/d/Y h:i:s A',strtotime('-10 minutes'));
-
I already advised that way also, but the OP stated that wasn't what he wanted. The only other way is CSS.
-
That is exactly what you are trying to do with your site. If you click on the different designs, you are getting the exact same data applied in different ways BAM like that. You could set your site up just as fluid with CSS. This is the ONLY way to do it without making templates for each design (maintenance intensive). This way, a new design is just a CSS file away.
-
Unless you are talking about holding down control while highlighting to highlight different text to copy. I don't think you can set the clipboard to append.
-
The slashes as advised are de-limiters, any non-alphanumeric character can be a de-limiter. Such as ~,!,@,%,etc. Just remember, a de-limiter that is used inside the expression, must be escaped.
-
Or, use a class for what it is designed for. To group aggregate functions that serve a similar purpose, and that all relate to one another. Writing a class for sanitation that has functions that cover queries, output, file uploads, file traversals, etc. is a perfectly legit project.
-
So you want the user to drag the menu/div's to where they want it displayed?
-
I suppose your system is template driven? You could set a cookie(or database) to tell which template to display.
-
Here is my test, again PHP 5.3.0 PS. This would help if you would post ALL relevant code. <?php$date_begin = new DateTime('2010-10-12 14:00:23');$date_end = new DateTime('2010-10-13 18:00:23');define('DATE_FORMAT', 'm/d/Y h:i:s A');echo "<BR/><BR/>LOOPING - BEFORE begin: " . $date_begin->format(DATE_FORMAT) . " end: " . $date_end->format(DATE_FORMAT); $date_begin->add(new DateInterval('P1D')); $date_end->add(new DateInterval('P1D')); echo "<BR/>LOOPING - AFTER begin: " . $date_begin->format(DATE_FORMAT) . " end: " . $date_end->format(DATE_FORMAT);?> Output.
-
Not a complete list, but I would start with the following. Stop directory traversal. Stop MySQL comments. Stop B64 encoded. Remove null characters (to stop sandwiching between ascii characters). Validate standard ascii/UTF 16 characters (make sure there is a semi colon). Decode URLs. Make sure there are no tabs and/or spaces between words like j a v a s c r i p t, vb script, etc. Make xml/php tags safe, by converting to html entities. Remove any disallowed javascript (esp. if they are in links), as well as javascript event handlers. Remove naughty HTML elements (or change to html entities). Remove naughty PHP function calls (like eval). Of course you could put some checks in there for the proper data. Such as strlen, numeric only, alpha numeric, or alpha only.
-
I ran a quick test. This code: <?php $time = '10:20:33 Jan 02, 2010 PDT'; echo date('Y-m-d H:i:s',strtotime($time)); ?> Output this data: 2010-01-02 12:20:33 Note, my server is EST.
-
Problem with delete.php?id= - PARSE ERROR???
jcbones replied to colleyboy's topic in PHP Coding Help
Alternately, a shorter way would be. echo "<br />"; echo "<br />"; echo "<B><U><I><a href='delete.php?id=".$row['id']."' onClick=\"return confirm('Are you sure you wish to delete this record?');\">DELETE</a></U></I></B>"; echo "<br />"; echo "<br />"; echo $row['CarTitle'];