NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page [resolved] php things have suddenly stopped working, and I have no idea why

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 11-07-2007, 09:14 AM THREAD STARTER               #1 (permalink)
Munky Designs
Join Date: May 2005
Posts: 996
Albino is a jewel in the roughAlbino is a jewel in the roughAlbino is a jewel in the rough
 



[resolved] php things have suddenly stopped working, and I have no idea why


ok, this is crazy, and driving me insane!

as of two days ago, everything worked fine.

Now, things are messing up for no reason.

I have a key check function, it makes a key on one page, and then checks it on the next. here is a bit of it:

Code:
        $keyCheck = $user->checkKey('loginKey');
        echo $keyCheck." is keyCheck<br />";
	if ($keyCheck != 1){
		echo $keyCheck." You are doing something naughty!!!!";
		exit();
	}
now, If I echo $keyCheck before it gets to the if, then I get 1, but when I echo it from inside the if, it comes up blank. So $keyCheck is definitely working, but the if statement still catches it! This only started happeneing 2 days ago, and for the life of me I canlt figure it out. I haven;t even touched the code for it for over a week. Also, the same fuction works fine on a different page.

Second thing, I have a register function, which sends out a validation email. I haven't touched the code in there for 2 weeks, now though, no email is sent. the data is saved to the db, everything echos ok, just no email being sent (and no, it is not in my junk folder ).

The code for it is here:

Code:
$b = "click this link to validate<br /><a href=\"http://munkydesigns.co.uk/Scripts/validatelogin.php?u=$u&v=$v\">Click here</a>";
		$b = @nl2br($b);
		$headers = "Content-Type: text/html";
		if (!mail($e, "You have registered, click to validate", $b, $headers)) { 
			echo "something went wrong!";
			exit();
		 }
		 
		echo "Welcome ".$u.", you are now registered.<br />However, the account is not yet live, an email has been sent
				to the address you supplied, click the link to validate!";
		exit();
This also worked fine until 2 days ago, when it now just stopped.
????: NamePros.com http://www.namepros.com/programming/393196-resolved-php-things-have-suddenly-stopped.html

Please, someone tell me im not going insane, and that there is a really obvious mistake I am making
Last edited by Albino; 11-12-2007 at 03:43 PM.
Albino is offline  
Old 11-07-2007, 09:44 AM   #2 (permalink)
Danltn.com
 
Daniel's Avatar
Join Date: May 2007
Location: Danltn.com / Nottingham, UK
Posts: 1,201
Daniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond repute
 


Ethan Allen Fund Ethan Allen Fund
Things don't just 'stop' working. Did your host upgrade, did you change anything? That sort of info would be great.
Daniel is offline  
Old 11-07-2007, 09:57 AM THREAD STARTER               #3 (permalink)
Munky Designs
Join Date: May 2005
Posts: 996
Albino is a jewel in the roughAlbino is a jewel in the roughAlbino is a jewel in the rough
 



I haven't changed anything, which is why this is confusing me so much.

I'll ask the host if they have upgraded, but if they have, why would one function which works fine on one page, not work on another (even though they are exactly the same).
Albino is offline  
Old 11-07-2007, 10:32 AM   #4 (permalink)
NamePros Member
Join Date: Sep 2006
Posts: 99
Bruce_KD will become famous soon enoughBruce_KD will become famous soon enough
 



The most common thing I could suggest is check for globals...
eg did you assume $_SESSION['var'] automatically became $var
The host may have changed this, so you'd need to use $_SESSION['var'] (Its a huge security risk the first way)
The other possibility is something happened to your session().start


Bruce
Bruce_KD is offline  
Old 11-07-2007, 11:59 AM THREAD STARTER               #5 (permalink)
Munky Designs
Join Date: May 2005
Posts: 996
Albino is a jewel in the roughAlbino is a jewel in the roughAlbino is a jewel in the rough
 



globals are on, but I never assume things like $_SESSION['var'] = $var.

also, session_start is in a global file, required_once at the top.

its never failed before, I haven't changed anything in it, it just started happening 2 days ago
Albino is offline  
Old 11-12-2007, 03:42 PM THREAD STARTER               #6 (permalink)
Munky Designs
Join Date: May 2005
Posts: 996
Albino is a jewel in the roughAlbino is a jewel in the roughAlbino is a jewel in the rough
 



ive copied and pasted everything to a new directory, bit by bit, and it al works. I haven't changed a thing.

how weird!

thanks everyone for the help though
Albino is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 11:11 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger