Reading and printing in Php
Re:Reading and printing in Php
No way of doing that in php? :-\
Oh, and found another slight flaw. It takes refreshing the page as an input too, leaving the guestbook with empty entries from time to time.
Oh, and found another slight flaw. It takes refreshing the page as an input too, leaving the guestbook with empty entries from time to time.
Re:Reading and printing in Php
Yup, you use IE.Kon-Tiki wrote: Oh, and found another slight flaw. It takes refreshing the page as an input too, leaving the guestbook with empty entries from time to time.
Stop using IE.
The flaw you found has been fixed by M$ and posted to windowsupdate.
Re:Reading and printing in Php
Ok, now I'm surprised. I did see a fix for IE posting empty POST replies on windowsupdate... Not that I use IE either...Kon-Tiki wrote: I've only accessed my guestbook through Opera
Still, refreshing the page might auto-post again, not sure what opera does but it shouldn't.
Re:Reading and printing in Php
No, only part of it is in JavaScript, the one which adds the smilies into the textbox when clicking on the buttons. You could as well have people just type :) into the textbox, the rest is handled with PHP.
Re:Reading and printing in Php
I could do that list of smilies in pure html too, through a drop-down menu (like the color dropdown menu in this board) which has img-tags instead of text... I hope... if it's even possible to add img-tags in those things.
Re:Reading and printing in Php
Yes, but it must be added to the textbox too, if you don't include this function, it kind of beats the purpose of having a list at all...
Re:Reading and printing in Php
Can't I have it so that it adds code to the textbox, like *:)*, then it looks those codes up and replaces them with img-tags, all done in php and hmtl?
Re:Reading and printing in Php
Searching them and replacing them is written in PHP, but you can't just add them to a textbox with normal HTML. Of course you could have a list of buttons which will send the message away to a PHP-script which will add the smiley to it and show the message using the VALUE attribute of the textbox, but it would be pointless...
Re:Reading and printing in Php
Alrighty. I won't try to understand that piece of code as much as the others, because it's not php, but I'll use the javascript part.
Re:Reading and printing in Php
Ok, smilies work, except for three. They have >, < or both in their code (like you have :*) as code for - but without the * - ) Any ideas on how to fix this? To view what could be wrong, this is my code.
Edit:And crap, that bugfix for the reloading bug isn't really working >_<
Edit:And crap, that bugfix for the reloading bug isn't really working >_<
Re:Reading and printing in Php
Are you applying the smileys after the html-fix? If so, the < and > characters are < and > respectively. Match them instead.Kon-Tiki wrote: Ok, smilies work, except for three. They have >, < or both in their code (like you have :*) as code for - but without the * - ) Any ideas on how to fix this? To view what could be wrong, this is my code.
Edit:And crap, that bugfix for the reloading bug isn't really working >_<
Re:Reading and printing in Php
YAAAAAAAAAH! They work ;D ;D ;D Now one more fix and I'm settled. I'm trying to get that refreshing bug out by adding a check for $_POST['comment'], seeing if it's NULL or not. If it's not, it starts writing everything to a file, if it is, it doesn't. After that and before including that file, I have this:
It's supposed to set $_POST['Comment'] to NULL, so that it won't pass that check at a reload, but it doesn't work =/
Code: Select all
$_POST['Comment'] = "";
Re:Reading and printing in Php
What if you don't set it at all, and instead useKon-Tiki wrote: After that and before including that file, I have this:It's supposed to set $_POST['Comment'] to NULL, so that it won't pass that check at a reload, but it doesn't work =/Code: Select all
$_POST['Comment'] = "";
Code: Select all
if (isset($_POST['Comment']))
Other option would be to use
Code: Select all
$_POST['Comment'] = NULL;
Re:Reading and printing in Php
The if(isset($_POST['comment'])) doesn't work. It has the same effect as no if at all.
Now for testing the $ = NULL; thingy...
Nope, still doesn't work :-\
Now for testing the $ = NULL; thingy...
Nope, still doesn't work :-\