-
Posts
1,842 -
Joined
-
Last visited
Posts posted by marcus
-
-
Looks awesome, great job.
-
This isn't a PHP problem. Avoid using the same ID multiple times. You have "#image_rotate" used twice, jQuery is going to confuse itself. If you want to use a layer multiple times make it a class. I would suggest renaming both IDs to something like.
<ul id="gallery1">
and
<ul id="gallery2">
Then you should be able to use
$('#gallery1, #gallery2')
in your jQuery script.
-
Looks like you have a MIME type problem. It's not recognizing the .php file extension as a PHP document.
-
-
Just starting the path with a forward slash puts you in the root directory. So the full path would be something like:
/home/user/public_html/path/to/assets/init.inc.php
-
perhaps trying doing
public $yourarray = array($_POST);
Not sure if that would work or not.
$_POST
is global by default. -
When dealing with multiple where clauses you need to use AND and/or OR to separate each clause.
$sql = "DELETE FROM `x` WHERE `y`='z' AND `z`='y'";
-
I concur with the above statements.
-
1814400 = 3600 * 24 * 21 = 3 weeks in seconds.
-
$ASLconfirm = date("l, F j", strtotime($ASLdate) - 1814400);
-
Is it not obvious? You're passing testvar, but looking for testurl.
-
To get the
?url=<blah>
from your code you use the superglobal $_GET and index it withurl
. So on the second page you just have$url = $_GET['url']; if(isset($url)){ echo $url; } else { echo "sorry dude"; }
-
You don't have a name to your submit button.
<input type="submit" name="Submit" value="Query" />
You should also look into using a switch statement.
switch($_POST['query']){ case 'add_status': // code break; // etc default: // if no option is selected }
-
This isn't really a relevant PHP question, more-so JavaScript. I made a mock-up of an idea you might want: http://jsfiddle.net/DLVzN/
If you click on a number it highlights all the numbers less than or equal to it, else it keeps it blank. So you could add more attributes to the span if you wanted to include the movie ID and use
var rating
as the rating. -
Why don't you just do
if(!$_SESSION['currentMember']){ // redirect }
-
Ok, well in your if statement you're doing an assignment, not a comparison.
if($a = $b)
is not the same asif($a == $b)
-
Functions are public without any cast.
class A { public $user; public function __construct(){ $this->user = 'apple'; } function getApple(){ return $this->user; } } class B { public $user; public function __construct(){ $a = new A(); $this->user = 'b' . $a->getApple(); } function getApple(){ return $this->user; } } $b = new B; echo $b->getApple();
This code would return
bapple
.If the getApple() method in A was private, B would not be able to access A's getApple() method. However, if A's getApple() method was protected, and class B extends A, then you would be able to access A's getApple() method.
-
Is
$this->collection->findOne(array("Username" => $this_username))
supposed to be returning a username, or an object? -
array(min($player->hp + $healspell, $whatEverYourMaxHPValueIs), 'etc....')
-
function findIndex($array, $value){ if(count($array) > 0){ $i = 0; foreach($array AS $val){ // check if val is equal to value, if it is return $i // increment $i } } return -1; }
Alternatively you could use a for loop
$count = count($array); for($i = 0; $i < $count; $i++){ // if array position at $i equals your value, return $i }
-1
is used to indicate the value was never found. So when using the function$index = findIndex($array, $value); if($index < 0){ // not found }else { // found at $index }
-
SELECT CONCAT_WS('~',x,y,z) AS xyz FROM table
CONCAT_WS is a mysql function for concatenating fields with a separator. So when you execute your query you would be able to use
$row['xyz']
as x~y~z -
$cur = "2012-04-20 14:25:50"; echo date("m/d/Y H:i", strtotime($cur));
-
you would do (inside your while loop)
$sel = ($_SESSION['type_of_work_id1'] == $rowt['id']) ? " SELECTED" : ""; echo "<option value=\"".$rowt['id']."\"".$sel.">".stripslashes($rowt['title'])."</option>\n";
-
Well for one... get rid of the selected in the first option value that says "Please select..."
while($rowt = mysql_fetch_assoc($rst)){ $sel = ($_SESSION['type_of_work_id1'] == $rowt['type_of_work_id']) ? " SELECTED" : ""; // $rowt['type_of_work_id'] is what i'm assuming, change if not // rest of code }
Updating Date Column Not Working!
in PHP Coding Help
Posted
Put the
$datetoset
in quotes in your$sql
variable.So: