This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-02-02 14:50:52

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

PHP help again

For some reason this bit of code isn't working as it should..

Code:

<?php
$parse_date = $parse_date + 1;
print("<center>$parse_date</center>");
if($parse_date = $date_end) { 
$parse_date = "35";
}
?>

I think it is a problem with the if part not working..


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#2 2013-02-02 14:57:34

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: PHP help again

To check equality, use ==.

Offline

 

#3 2013-02-02 14:59:54

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: PHP help again

scimonster wrote:

To check equality, use ==.

lol.. Why is it so easy to fix...


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#4 2013-02-02 15:05:33

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: PHP help again

You should be happy that it's an easy fix. Just a syntax error. Of course, some people think those are the worst...

Offline

 

#5 2013-02-02 15:15:40

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: PHP help again

Their only bad if you can't find them, if there's too many of them, or God forbid, it doesn't work when you fix it.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#6 2013-02-02 15:55:03

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: PHP help again

Yea it is just annoying after searching through the code and rewriting it several times...


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#7 2013-02-02 15:56:07

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: PHP help again

henley wrote:

Their only bad if you can't find them, if there's too many of them, or God forbid, it doesn't work when you fix it.

I've had some of those.  Unexpected "$end"s, apparently.  I think it was a problem with the webhost though.


http://i.imgur.com/BAEgGDL.png

Offline

 

#8 2013-02-02 18:46:24

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: PHP help again

GeonoTRON2000 wrote:

henley wrote:

Their only bad if you can't find them, if there's too many of them, or God forbid, it doesn't work when you fix it.

I've had some of those.  Unexpected "$end"s, apparently.  I think it was a problem with the webhost though.

You usually either get those if you view a webpage while it's still FTP uploading or you forgot to close a brace set.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#9 2013-02-03 03:19:43

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: PHP help again

Another Question.
Currently i have a lot of small php scripts (about 30), is it better to re-write it all so it is one script?


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#10 2013-02-03 07:14:41

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: PHP help again

muppetds wrote:

Another Question.
Currently i have a lot of small php scripts (about 30), is it better to re-write it all so it is one script?

If all of the scripts pertain to the same group of actions (for example parts of a single webpage or all actions to do with user management) then they should have been coded together in the first place.

If they don't have anything to do with each other, it's best to keep them separate!

Offline

 

#11 2013-02-03 08:12:31

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: PHP help again

LS97 wrote:

muppetds wrote:

Another Question.
Currently i have a lot of small php scripts (about 30), is it better to re-write it all so it is one script?

If all of the scripts pertain to the same group of actions (for example parts of a single webpage or all actions to do with user management) then they should have been coded together in the first place.

If they don't have anything to do with each other, it's best to keep them separate!

Ok ill recode it (need to do it anyway)...


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

Board footer