Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 05-27-2005, 01:08 PM Flat-file help...
Average Talker

Posts: 15
Trades: 0
I'm creating a website for the movie theatre in my town. Right now I'm trying to make it easy to change the "Now Playing" and "Coming Soon" movies that are displayed on the homepage.

I'm using a flat-file to store the values for the movie title, review URL, running time, and rating. On the edit page I've been able to have the form show everything that is currently in the flat-file, except for the rating.

On the edit form I have text fields for the title, review, and time, but I have radio buttons for the rating.

Is it possible to take the rating value from the flat-file and have the corresponding radio button selected whenever the edit page is loaded?

I'm thinking that I'll have to do a lot of if and else statements, but I want to make sure there's not another way.

Thanks,
JC2
jacannon2 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-27-2005, 05:32 PM
CYH-webmaster's Avatar
Junior Talker

Posts: 4
Trades: 0
Personally, I would just generate the ratings dynamically using images (radio buttons are great for making choices, but not needed for just displaying data back)...

Say you have a "dark" star and a "highlighted" star...then you can do something like this (assuming you don't mind nesting a table):

PHP Code:
<table><tr>
<?
/* Set $rating and $maxRating before we get here
Fill in the 'bright' rating images to signify the number of stars a particular movie has received */
for ($i=0$i<=$rating$i++) {
?>
<td><img src="images/brightstar.png"></td>
<?
}
/* Fill in the rest of the dimmed rating images to show how much better
this movie SHOULD have been ;) */
for ($i=$rating+1$i<=$maxRating$i++) {
?>
<td><img src="images/dimstar.png"></td>
<?
}
print 
"</tr></table>";
/* The rest of your PHP goes down here */
?>
__________________

Please login or register to view this content. Registration is FREE

2500MB/40GB transfer per month, 100 emails, PHP,
MySQL, cPanel, crontab, and more for only $99/yr!
Why pay more to pay more often?
CYH-webmaster is offline
Reply With Quote
View Public Profile Visit CYH-webmaster's homepage!
 
Reply     « Reply to Flat-file help...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11207 seconds with 12 queries