-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
nope. notepad is fine. for shits and grins i actually physically tried the code and it works fine for me. so you are telling me you don't have anything else in your script. what about this part? [code] <?php $day = date(z); $counter = 1; echo $day; echo $day - $counter; ?> [/code] where is that?
-
so you don't have anything before that <?php ? no blank lines? is this included in another file?
-
it would help if you actually showed your code. But based on your error, you are attempting to output html before sending header information. You can't do that. Not even a blank line. headers must come before any html output. If you absolutely have to have html output before headers in your code, use ob_start() at the very beginning of your script and ob_end_flush() at the end. This will create a buffer for your html code so that the header info can be parsed first.
-
note that sessions will only work for as long as the user's browser is open. if you are looking for a more permanent solution, you need to look into storing the number in a flatfile or a database, retrieving the # from there, and updating it when you click on it.
-
or [code] $badwords = array('badword1','badword2','badword3'); $needle = 'blah'; if (in_array($needle,$badwords)) { // badword found code } else { // badword not found code } [/code]
-
i forgot some )'s. sorry: [code] if((!substr($cont,"http://")) && (!substr($cont,"www"))) { [/code]
-
well AND doesn't really matter unless he's mixing operators cuz AND and && has a different order of precedence. In this particular condition (and in most conditions) it really doesn't matter. i think what you are really trying to do in this condition is for instance this: [code] if ($action == "add") { if((!substr($cont,"http://") && (!substr($cont,"www")) { // add stuff here } else { // is spam } } [/code]
-
as in, that's the google keyword you want to use. image verification.
-
you should sanitize $login before using it in your query. [code] function clean_var($value){ if (get_magic_quotes_gpc()) { stripslashes($value); } if (!is_numeric($value)) { mysql_real_escape_string($value); } return $value; } . . $login = clean_var($_POST['login']); [/code] also, this isn't really a security issue , but you can combine these 2: [code] // combine these 2: $sql = mysql_query("SELECT * FROM `login_users` WHERE `login` = '$login'"); $result = $sql or die(mysql_error()); // like so: $result = mysql_query("SELECT * FROM `login_users` WHERE `login` = '$login'") or die(mysql_error()); [/code]
-
LoL, why do you want to put the local weather on the board? or is it some other smf board.
-
echoing $receiver or $query shows what it should have?
-
is your file being included into some other file? you need to put it in [i]that[/i] file. The point is, it needs to be the very first thing php sees.
-
okay, i see that you have ob_start() and ob_end_flush() inside a function, which means that the script you have provided is part of a larger script. ob_start() has to be at the beginning of the entire script and ob_end_flush() has to be at the end of the entire script.
-
please make some kind of effort to name your topics appropriately, not just "help please."
-
dynamic URL /script needed for query display help/advice needed
.josh replied to slashpine's topic in PHP Coding Help
well you can't use the post method in a url link. Also, I'm not sure what you mean by "get 2 vars from the same record." I don't see how that really ties into your post vs. get problem. do you mean passing more than 1 variable? target.php?value1=somevalue&value2=someothervalue -
"Get the number of rows that $checkCookie looks up." has no // before it
-
repost your code.
-
[quote] but I think my like statement is wrong. [/quote] why do you think it's wrong? Are you getting any errors? Is the 'wrong' thing returning? Is anything returning at all? Do you even have error reporting on, or displaying errors? Have you echoed out $query and tried inserting it directly into your database and see if it works? In short, simply telling us you think something is 'wrong' does not help us help you whatsoever.
-
^expanded: = is the assignment operator. == is the equality operator. But i'm sure you knew that, and it was just a typo.
-
dynamic URL /script needed for query display help/advice needed
.josh replied to slashpine's topic in PHP Coding Help
you could make a form with a dropdown of the cities and submit it using post method. Or make a form for each city and the only element in each form is the submit button and you could do like [code] <form action = 'target.php' method = 'post'> <input type = 'submit' value = 'city1' name = 'city'> </form> <br/> <form action = 'target.php' method = 'post'> <input type = 'submit' value = 'city2' name = 'city'> </form> . . . [/code] -
at the top of your script put ob_start(); at the bottom put ob_end_flush();
-
you cannot have any html output before your setcookie function call. no echos, no blank lines above your php tags, no nothing. or you can look into [url=http://us2.php.net/ob_start]ob_start()[/url] if you need to have html output before it.
-
it only saves the last one because you keep over-writing the same variable. change it to [code=php:0] $_SESSION['forum_id'][] = $line['forum_id']; [/code] this will make an array of session forum_id to be accessed later on like so: [code=php:0] echo $_SESSION['forum_id'][0]; // echo 1st one echo $_SESSION['forum_id'][1]; // echo 2nd one echo $_SESSION['forum_id'][2]; // echo 3rd one // you get the picture [/code]
-
a) visual basic costs lots of money. b) you don't get anywhere near as much control over your app as with c++ or even java. c) it's windows only. So unless your host is using a windows server, you can't make a server/client app with it. I think. There may be immulators out there. But that's assuming your host will allow you to install/run that.