Fedora Linux Support Community & Resources Center
  #1  
Old 1st January 2011, 08:02 PM
JonEberger Offline
Registered User
 
Join Date: Nov 2005
Location: GA
Posts: 62
linuxfedorafirefox
Rookie PHP error

Everyone,

So, I'm writing a simple webpage that requires some "if-then" type logic for screen output.

A user inputs a series of values in an HTML form (with appropriate PHP variables previously declared), and depending on the values entered (given a series of if-then logic statements), a string is placed in the variable $my_string. Then, using the statement "echo $my_string;" that string is printed to the web-page.

The problem is that I would love to refresh the page so that, before a user inputs values, there is nothing printed to the page (i.e., a page with no output). But, once a user inputs his/her values, that string remains present on the page (even through a refresh).

I have tried to clear variables (using my limited PHP knowledge) and to use the session_destroy() command. I've also cleared variables. However, I cannot remove that darn string output.

Any ideas?

Jon
__________________
Registered Linux User #381610
Reply With Quote
  #2  
Old 1st January 2011, 08:18 PM
AlexDudko Offline
Registered User
 
Join Date: Mar 2007
Location: Ukraine
Posts: 381
linuxiceweasel
Re: Rookie PHP error

Isn't it a simple browser cache case?
Try to close the browser and then reopen it.

Last edited by AlexDudko; 1st January 2011 at 08:32 PM.
Reply With Quote
  #3  
Old 1st January 2011, 08:28 PM
Min Offline
Registered User
 
Join Date: Jun 2009
Location: Melbourne
Posts: 246
linuxfirefox
Re: Rookie PHP error

I don't think so. I think you need to check whether all the html form is filled using is_empty or isset (forgot the real function name). That way you can detect the first load of the page and do not display the string.
__________________
Macbook aluminum 5,1
Snow Leopard, Constantine, Seven
Reply With Quote
  #4  
Old 8th January 2011, 07:05 PM
hatstack Offline
Registered User
 
Join Date: Jan 2011
Posts: 4
windows_7firefox
Re: Rookie PHP error

Like Min said, you can use isset, but I would personally just create a separate php processing page. Then again, this sounds more like something I'd do with JS as opposed to PHP; all you really want is a dynamic web page output based on several variables, that could easily be done with JS in just a few minutes without having to access a server side program.
Reply With Quote
  #5  
Old 8th January 2011, 09:09 PM
AlexDudko Offline
Registered User
 
Join Date: Mar 2007
Location: Ukraine
Posts: 381
linuxsusefirefox
Re: Rookie PHP error

It's hardly possible to give some advice without seeing the script...
Reply With Quote
Reply

Tags
error, php, rookie

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wireless for rookie! keatonvictor Servers & Networking 17 12th August 2007 10:25 PM
Fedora rookie need your help:) eigrp Installation and Live Media 9 13th July 2006 06:08 AM
Linux Rookie! Duskywolf Installation and Live Media 2 22nd June 2006 07:26 AM
rookie - installation question juny20 Installation and Live Media 4 13th February 2006 06:08 PM
rookie needs urgent help! beebogates Using Fedora 11 1st January 2006 06:32 PM


Current GMT-time: 19:37 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat