Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
nods, No problem.
Yea, the (!$var) and ($var) thing also works in C.
I didn't know that by default it is off,
I just know it used to work for me, these days for me,
the whole CGI part for PHP is either disabled or enabled.
phpinfo() will show all of the varibles for CGI working in
PHP. But not in my scripts, or future scripts that I write.
I must have something in Apache or PHP enabled that breaks PHP's
CGI varibles.
On Sun, 7 Sep 2003, yoda wrote:
> > I don't know away to improve it, but I can
> > point out a thing or 2.
> >
> > instead of using $_POST["comments"], and if
> > your address is like,
> > http://mad.chickenkiller.com/blogtest/blog.php?comments=cdtgfgytfgyytgtu
> > PHP creates a varible called $comments, so you can just use
> > fwrite($fp,$comments);
>
> As I understood it, it was the GET method that tacked the variables onto the
> URL. That's actually why I chose POST. Also, I read that variables like
> $comments are 'external variables', and that they are off by default in PHP4.
> Unless I'm mistaken, this is now the preferred way of accessing them.
>
> > Also, technically, I haven't looked up "ab" yet, but with
> > $fp = fopen($filename,"w");
> > If the file doesn't exist, it should created it, but if
> > you're reading a file and it doesn't exist, you should
> > be able to get by with...
>
> a is 'append,' so it begins writing after the content that's already there, and
> b is 'binary,' which is the default in PHP4, but is recommended for portability.
> Also, I'm not ever planning to have anyone commenting on a file that doesn't
> exist, which is why I tested for file_exists() first.
>
> > if(!$fp = fopen($filename,"r")) {
> > printf("ERROR: file %s does not exist\n",$filename);
> > return;
> > }
>
> I didn't know using (!$foo) was valid PHP. Thank you. That'll make all
> my '$foo == NULL' parts look much cleaner.
>
> I do thank you very much for taking the time to take a look at it.
>
> > And that's basicly the same thing as if File does not exist.
> >
> > On Sun, 7 Sep 2003, yoda wrote:
> >
> > > Hey, all. I wanted to play with some interactivity on my site, so I figured I'd
> > > start toying with PHP. I looked up a bunch of stuff, and wrote a little page for
> > > my journal that allows comments. It's pretty basic, but I was wondering if
> > > someone would be willing to skim the code quickly and see if there's anything I
> > > could improve (with respect to security, efficiency, etc.) on it. Thanks to
> > > anyone who's willing to help.
> > >
> > > I've added .txt to the end so you can download it without preprocessing:
> > > http://mad.chickenkiller.com/blogtest/blog.php.txt
> > > You can see it in action at:
> > > http://mad.chickenkiller.com/blogtest/index.php
> > >
> > > ------------------------------------------------------
> > > It's GNU/Linux damnit.
> > > http://www.gnu.org/gnu/linux-and-gnu.html
> > > _______________________________________________
> > > members mailing list
> > > EMAIL:PROTECTED
> > > http://mlug.missouri.edu/mailman/listinfo/members
> > >
> > _______________________________________________
> > members mailing list
> > EMAIL:PROTECTED
> > http://mlug.missouri.edu/mailman/listinfo/members
> >
> _______________________________________________
> members mailing list
> EMAIL:PROTECTED
> http://mlug.missouri.edu/mailman/listinfo/members
>
_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members