Fixed(read the last post.you'll laugh, I know it:) )

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Have you tried echoin all the var's during the loop?

add extra echo's at various stages so you can see the pattern/flow.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

okay.i'll look into tha tlater...but that if statement still isn't executing:-D that's the main issue:-D
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Find out if the var is being set correctly first ;)
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

here comes the results of echos at every stage of the foreach loop :-D Did I mention I love y'all for trying to help? Lord knows this is driving me mad..
HOLY HELL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
You all will NEVER believe me..never..nope.not a damn chance in hades..i put this before my include statement..

Code: Select all

echo ("workng");
just to make sureit was reading the URL for process='yes', I was curious, ya know?
well I hit refresh and holy hell the entire thing worked........I go back and take all the error checking out..still works... :: laughing his butt off because this makes no sense:: I am sorry if I frustrated anyone..I have no idea why it works..here's hte code that's working..I beieve its the same as the old code..

Code: Select all

foreach ($_POST as $key=>$value)
	  {
	  	if ($key!='Register')
		{
			if (empty($value))
			{
			  ${"form_" . $key} = "<font color='RED'>Please enter something here.</font>";
			  $Error=1;
			}
		}
	  }
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

maybe it was a weird caching problem?
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

over two computers and like 5 browsers? possible but unlikely..i'm blaming it on my host personally.. :-D
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it's possible your ISP may be caching the data, or something as well...
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

two different locations.one computer at work :oops: one at my house:-D i'm not trying to be difficult but you seem pretty knowledgable and I figure if I keep putting out replies you might come up with a reason :-D I'm curious myself. I think the fates are conspiring against me but that's just me.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

I would of guessed cache aswell.. but maybe there was a corruption with the PHP installation on the host machine, and they have fixed/reinstalled it without telling you? :p
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

We've (work colleagues) have had the most random issues like this too.

The PHP code was behaving completely differently based purely upon the position of a comment in the code :?

It's not even like we were moving to a different part of the code... we were just moving the comment like one tab into the page or one blank line down and the whole script was going crazy, giving different outputs.

We even then copied and pasted into a fresh file and were still seeing it. I can't remember exactly what was happening but it baffled the hell out of use for ages and to this day I still can't work out why it was doing it.

It's was literally like this (only in a big application):

Code: Select all

$var1 = 2;

//Set a variable to 3
$var2 = 3;

echo $var1 * $var2; //outputs something wacky like "5"

Code: Select all

$var1 = 2;

//Set a variable to 3

$var2 = 3;

echo $var1 * $var2; //outputs correct result "6"
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

d11wtq wrote:we were just moving the comment like one tab into the page or one blank line down and the whole script was going crazy, giving different outputs.
seems like special effects of a liquid plugin called Tequila Sunrise :lol:
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

so i think i'm going to chock this one up as a learning experience.. lesson learned: my host just had a hell of a lot more fun with me than anyone has rights too;)
Post Reply