OSDev.org

The Place to Start for Operating System Developers
It is currently Thu May 02, 2024 12:32 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re:Reading and printing in Php
PostPosted: Sun Apr 18, 2004 7:24 am 
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.


Top
  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Sun Apr 18, 2004 7:56 am 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 11:33 pm
Posts: 3882
Location: Eindhoven
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.


Yup, you use IE.

Stop using IE.

The flaw you found has been fixed by M$ and posted to windowsupdate.


Top
 Profile  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Sun Apr 18, 2004 9:26 am 
I've only accessed my guestbook through Opera :P


Top
  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Sun Apr 18, 2004 9:37 am 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 11:33 pm
Posts: 3882
Location: Eindhoven
Kon-Tiki wrote:
I've only accessed my guestbook through Opera :P


Ok, now I'm surprised. I did see a fix for IE posting empty POST replies on windowsupdate... Not that I use IE either...

Still, refreshing the page might auto-post again, not sure what opera does but it shouldn't.


Top
 Profile  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Sun Apr 18, 2004 10:25 am 
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.


Top
  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Sun Apr 18, 2004 11:51 am 
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.


Top
  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Sun Apr 18, 2004 11:55 am 
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...


Top
  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Sun Apr 18, 2004 1:15 pm 
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?


Top
  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Mon Apr 19, 2004 7:44 am 
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...


Top
  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Mon Apr 19, 2004 8:03 am 
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.


Top
  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Mon Apr 19, 2004 1:21 pm 
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 >_<


Top
  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Mon Apr 19, 2004 1:47 pm 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 11:33 pm
Posts: 3882
Location: Eindhoven
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 >_<


Are you applying the smileys after the html-fix? If so, the < and > characters are &lt; and &gt; respectively. Match them instead.


Top
 Profile  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Mon Apr 19, 2004 1:58 pm 
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:
Code:
$_POST['Comment'] = "";

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 =/


Top
  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Mon Apr 19, 2004 2:21 pm 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 11:33 pm
Posts: 3882
Location: Eindhoven
Kon-Tiki wrote:
After that and before including that file, I have this:
Code:
$_POST['Comment'] = "";

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 =/


What if you don't set it at all, and instead use
Code:
if (isset($_POST['Comment']))

?

Other option would be to use
Code:
$_POST['Comment'] = NULL;

?


Top
 Profile  
 
 Post subject: Re:Reading and printing in Php
PostPosted: Mon Apr 19, 2004 3:38 pm 
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 :-\


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group