FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Newbish here





KHO
Ok, i was wanting to play around with something that could accept some variables and process them and return a percentage. Thinking something like a text field named favnum and it would accept an integer, then it would compare it to a list that it would make that would just log all these numbers, and output a percentage of people who chose that number. Neutral

If someone oculd point me in the right direction on this, I just wanted something to start with and that seemed an easy enough example, I am just really newbish at this Neutral.
shamil
I think you are newbie to Php. It is not good idea to start learning on the forums. There are lots of tutorials online. Just google what you need. It is more useful way to apply forums for problems or questions which you can't find. Good Learning.
simplyw00x
Basically, you want a php page that looks at the $_POST or $_GET from a previous page (with the integer-entry box), opens a file with fopen, reads a value from it, prints the value and writes a new value to it. Doing this with mySQL is also a possibility but would possibly be harder. If you need more help, PM me, but remember that it is genuinely better just to go and read some tutorials than getting someone to do basic examples for you.
KHO
eh, im not 100% newbish, I used to do a bit in it, like 2 yrs ago Neutral. So I have thus earned the rank of Semi-Newbish due to my lack of use. Neutral

Thank you for the help, I think I have a general idea of what I need, but how do I get it to allow the page to write to a file? I know I will need to make and chmod the file to 888, but what code can I use to just print it out in a nice and orderly mannor? Neutral
raver
well, you can try to use the gd image library to dinamically generate stats like reports about procents. Although this may be a little harder to do.
You can try something else. Let's say you have your final results as:

a) 30%
b) 20%
c) 50%

Just create a image of a bar 1px in width, and generate it like this:
<?php
$width_a = 30;
?>
<table><tr><td background="bar.jpg" width="<? echo $width_a; ?>">&nbsp;</td></tr></table>
You get the picture Smile
Related topics
Counter-Strike!
Linux...
Gif Animator Software
Any one playing lockon (lomac)
Question on having Several websites under one hosting
Naruto: Gekitou Ninja Taisen series (GCN)
Guess who's new to FriHost?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.