-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
[SOLVED] Suggestions for compiling ANSI C under Windows
.josh replied to GingerRobot's topic in Miscellaneous
I too will vouche for VS being very user un-friendly and non-intuitive. I've used bloodshed a couple times in the past without any problems, so I guess I have nothing to add :/ -
Anything that generates text. Including extra blank lines and spaces.
-
Yep. You've got output before the header call, and probably have error reporting turned off so it's not screaming at you. Look into ob_start() for a bandaid fix or rethink your script to not have output before a header call for a better solution.
-
Awesome. Credit goes to Barand though; he posted before me, saying the same thing.
-
do you have error reporting turned on? Because you are echoing stuff before a header call. That should be giving you a "headers already sent" error.
-
I assume (without looking at the class, only going by the method description) that $stmtx->rowCount() tells you how many rows were returned in the query. If more than 0 rows were returned, and your while loops condition is to execute while there's more than one row returned, then you end up creating an infinite loop. You probably need to be doing somethingalong the lines of while($stmx->fetchRow()) { or whatever is in that class. edit: whoops. yeah, what barand said.
-
header("Location: http://www.blah.com");
-
my guess is that when you throw on some error reporting you'll find msql screaming at you about using "date" as a column name. If you want to use reserved words as column names, you need to wrap them up in backticks like so: `date` ... but you shouldn't do that because that only really works for mysql and also it's bad programming practice to use reserved words as column names. but i could be wrong. Not about the whole backtick thing; about the problem.
-
as r-it said, declare it as global in the main program. Example: <?php global $something; function a() { echo $something; } function b() { echo $something; } ?> But that is bad programming practice. The better programming practice would be to specifically pass it to the function and return it, or else pass it by reference. The better better programming practice is to follow PFMaBiSmAd's advice.
-
You do not have to explicitly use serialize for passing arrays or objects through a session, as of like, v4.2. This: page1.php <?php session_start(); $fruit = array('a' => 'apple','b' => 'orange','c' => 'banana'); $_SESSION['blah'] = $fruit; print_r($_SESSION['blah']); ?> <a href = 'test2.php'>page2.php</a> page2.php <?php session_start(); print_r($_SESSION['blah']); ?> will output the expected result of: Array ( [a] => apple [b] => orange [c] => banana )
-
dunno what you really need this grid for, but perhaps just using the gd library to generate an image would work?
-
ob_start() may work but it's more of a bandaid than a fix and used for that is not really good coding practice. Make sure there is no output before your session_start() not even lines or whitespace. Check your config.php as well. Check the top and bottom of config.php since it's being required the ending whitespace/lines would be thrown in before your session_start().
-
posted code isn't really that efficient, but it looks functional, so what does register-form.php look like? do you have session_start() in there? Are you echoing $_SESSION['ERRMSG_ARR'] somewhere in it? p.s.- Please use code tags when posting code. Or he could just remove the $errflag = true; in all his conditions and do if($errmsg_arr) { // make session var and header } since the array is only created if there's an error.
-
[SOLVED] calling a function in the middle of non-php code block
.josh replied to qhiiyr's topic in PHP Coding Help
Well, we're going to have to move from example code to your real code to figure that one out, because as it stands right now in the example code, the echo is already happening right after the whole str_replace/foo() thing. -
[SOLVED] calling a function in the middle of non-php code block
.josh replied to qhiiyr's topic in PHP Coding Help
foo would be called first. Then str_replace will be parsed and the result assigned to $code. Then whatever the result is will be echoed. -
The only plausible explanation for thousands and thousands of sightings being indiscriminately swept under the rug is that there really are UFOs. As far as whether it's alien, or just advanced top secret technology? That's a much bigger gray line. But one would think that if it was man-made and just top secret tech, they wouldn't be so careless about being sighted.
-
Then maybe you should be more specific with your question here, because you asked "How do I verify an email address?" and typing in "php email verification" into google yields an untold number of results.
-
while($status == "Middle Man") { = is assignment == is comparison
-
google login script tutorials it's the same principle.
-
google email verification.
-
log in with the same account, or log in under multiple accounts?
-
There are several comments in the array_unique entry on php.net that tackle getting the duplicate ones.
-
Buy real beans. All you got to do is throw the beans in water and let it simmer a couple hours and you're good to go. Pretty damn cheap and 1 bag goes a long way.
-
I buy lots of ramen when I'm broke