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!
i'm having a problem with the includes file. i did a slight change with adding a cookie to track if you're logged (specifically, but i'm thinking of checking username and pw and then if they match something have you noted as logged in)
i tried changng the cookie back to no avail. can anyone tell me why the previous one worked and the one from the function doesn't?
previous one (part of the begining of most pages, was near the top once the html started)
You are never ending your HEREDOC. The END must be on a line by itself, with no whitespate before it. Plus I would move the if/elses
to before the HEREDOC and combine it just to one HEREDOC.
althougth there's a few before that and i think there's a space before the END call. i should probalby fix them as well. i decided to use them in the includes because for future editing it's easier to go $variable than <?php echo $variable; ?> and someone posted that it's actually faster than popping in and out of php.
since i've noticed you've actually corrected some of them on other things, do you know if there's any truth to that?
as you can tell i'm moving to that. it displays rapidly enough on the p1 pre mmx / 166 mhz that once the db is added the slow will be the db, so i'm not concerned.
what does concern me is that this problem merely changed here it is...
it's got to be the call to the cookie, because i changed it to this and it's still giving me the same error and the line changed to where the call to the cookie ie. i don't understand why though.
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/joshua/includes/fyd.unifunc.php on line 103
this happens to be the 4th function done with that type of echo (and there's no other issue in that file. the issue for the other file is that it's calling a function from that one)
line 103: if(isset($_COOKIE['login'])){ $login=$_COOKIE['login']; } # you've got a cookie
as nielsene said. As for the error - what's happening on the lines above the error line? It's probably an issue with a function before it that's causing the issue for nav().
i din't get a chance to come back last night. that was the 4th and final function and second one called.
i figured since xemacs kept sticking it in that it's still the first thing, but tried moving them after i made that post. putting them on the next line in that file worked fine, so i'm guessing it's a combo between the fact xemacs insisted on indenting it (first time the indenting has ever worked against me) and the fact there were three previous functions that were incorrect as a result
YES! all the PHP-mode syntax highlighters act very funny with heredocs... I've submitted bug reports to about four different sets of maintainers, but none seem to think its a big deal... I guess they don't use heredocs.....
it's literally the only proble i've had with xemacs. my guess is that if i were to try in emacs it'd also have the issue...because they're both opensourrce and come from the same initial source.. diff is the two that started emacs wanted to take diff paths at some point, so they each took a copy and set up a healthy competition between the two. i prefer the x interface better.
if you wanted you could always make a patch and send it to them.i'd think about it but i want a job more. so it'd be something to do AFTER i get a job
Yeah, I normally use "regular" emacs, so yes it has the same problem.
Yes I could write a patch, or I could just decide to move all my heredocs to a phrasebook pattern as I've been chatting about in the Adv forum and leave them in either raw html/sql format and not worry about the funny indenting.... The latter sounds like a better s/w design anways....
nielsene wrote:YES! all the PHP-mode syntax highlighters act very funny with heredocs... I've submitted bug reports to about four different sets of maintainers, but none seem to think its a big deal... I guess they don't use heredocs.....
I sent an e-mail to the author of EditPlus about this since it's the one thing that irritates me about the program - I asked if it would be possible to set up another PHP delimeter (<<<END and END; alongside <? and ?>) to allow Edit+ to treat stuff in heredocs as simple HTML (and give me syntax highlighting). The answer I got back was:
twig: have you ever tried xemacs or emacs? i know those would respond back "would you please create the plug it? then we'll incorporate it in the future"