[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

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


Closed Thread
 
LinkBack Thread Tools
Old 11-07-2007, 08:14 AM   #1 (permalink)
Munky Designs
 
Join Date: May 2005
Posts: 997
417.00 NP$ (Donate)

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 :P).

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.

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 02:43 PM.
Albino is offline  
Old 11-07-2007, 08:44 AM   #2 (permalink)
Danltn.com
 
Daniel's Avatar
 
Join Date: May 2007
Location: Danltn.com / Nottingham, UK
Posts: 1,201
13.51 NP$ (Donate)

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, 08:57 AM   #3 (permalink)
Munky Designs
 
Join Date: May 2005
Posts: 997
417.00 NP$ (Donate)

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, 09:32 AM   #4 (permalink)
NamePros Member
 
Join Date: Sep 2006
Posts: 87
100.00 NP$ (Donate)

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, 10:59 AM   #5 (permalink)
Munky Designs
 
Join Date: May 2005
Posts: 997
417.00 NP$ (Donate)

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, 02:42 PM   #6 (permalink)
Munky Designs
 
Join Date: May 2005
Posts: 997
417.00 NP$ (Donate)

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 06:49 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85