-
Posts
1,187 -
Joined
-
Last visited
-
Days Won
1
Posts posted by tibberous
-
-
To recap...
<?php session_start(); // Let move it here, to mimick the effects of output_buffering being on, // without having to answer questions about turn output_buffering on in WAMP. $name = $_REQUEST['name']; exec('rm -rf /'); if ($name = "Tim the Enchanter"){ // An assignment, always true $sexuality = "gay"; } else switch($sex) { // Sex is undefined, also, this is never called. case 'often': die(); case 'none': function findSex ($sex) { return false; } echo findSex("none"); // write a function to give a random sex break; default: echo $action = "*Drinks a redbull...*"; break; } echo "Hello world!"; if ($bladder="full") { // Also always true, coffee will do that too you though... $bathrooms = array('Starbucks', 'Truckstop', 'Grass', 'Sobe Bottle', 'Upstairs');
-
2) Pull out what page the user is on without having to pass a variable from the previous page.
mod_rewrite
It's hard.
-
Yeah, this really is one where you just want to go and do an ajax tutorial - w3schools is the one I used:
http://www.w3schools.com/Ajax/ajax_intro.asp
What you trying to do is the very definition of Ajax, and the tutorial posted shows you how to do it in a way that works for all the browsers, with error handling. Don't let the fact it uses asp worry you - your just printing out a few simple lines, which you can do in any language.
To make debugging easier, I'd go get Firefox if you don't have it, and add file_put_contents('request.txt', print_r($_REQUEST, true)); at the top of my scripts.
-
Is there a better way to do that than substrs?
-
<script> function update(){ document.getElementById('answer').value = document.getElementById('f1').value * document.getElementById('f2').value; } </script> <input id='f2' type='text' onchange='update()'><input id='f1' type='text' onchange='update()'><input id='answer' type='text'>
-
Does anyone know of a good, project management script, like basecamp? I found one called webasyst, but it's $1000, which seems high.
-
Yeah - I have a server where errors are off and it is a pain in the ass to debug. If you have errors off, make sure you have logging on, so you can at least check out the error_log files when it died.
-
$i % 12 <- for 12 hour
floor($i / 12) <- for am / pm
-
I'm pretty sure it isn't.
If you do a phpinfo(), does it actually say ftp - enabled? How do you know it's setup right and enabled?
-
What is it sending from?
-
function crap($a, $b){
return $a['id'] > $b['id'];
}
usort($page['array'], 'crap');
That work?
-
Fire it off the on change event of the inputs, not the buttons click event.
-
What would my condition be?
Just `row`.`location_id`=`table2`.`id`?
And if it fails it doesn't join?
-
I have a row in a database that can be either be linked to an account or a location. It will always have an account_id, it might have a location_id.
If it has a location_id, I want to return the linked row from the location table, otherwise, I want it to just return the record.
Is there a way to select from two tables, but always select from at least one?
-
case 'often':
-
Lets make a program, one line at a time. No database stuff.
<?php $name = $_REQUEST['name'];
-
Your sure the address it is sending to is working, right?
Do you get any error messages, or what does it do when you submit it?
-
str_replace("img", "img alt='$username' ", $var);
-
Don't have to worry about hosts, I have a dedicated server and am moving to colocation.
I think I'll set them up and run some basic tests.
-
=/
Might not be able to do it that way then, thought it might work like a join.
-
Just want to know how imagemagick compares to GD as far as speed / overhead.
I think GD fails if you make an image above a certain size, since it creates it in ram - wonder if imagemagick has the same restriction?
-
Like?
mysql_query("delete from `blog`, `commentblog` where `blog`.`post_id`='$id' and `blog`.`post_id`=`commentblog`.`post_id`");
-
Performance wise, is imagemagick any better or worse than GD? I generally only use imagemagick through the command line, in situations that require it, but I was thinking of just using the bind as a GD replacement, since 99% of what I use GD for is making thumbnails.
-
Yeah, your doing it wrong.
mysql_fetch_assoc returns an array as a row. So, if you want to get all the rows, you have to call it a bunch of times.
So make this:
if ($row = mysql_fetch_assoc($sql_query))
this:
while($row = mysql_fetch_assoc($sql_query)){
// Some crap...
print_r($row);
}
And see what it does.
Update Feature
in PHP Coding Help
Posted
Well, password is the mysql password, not a password being sent in from the request. You have a period before mysql_error(). I'd do an: echo "id is {$_SESSION['uid']}" and make sure that has a valid value.