Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. ok this is fairly nice to... you are going to use html arrays for your radio buttons and they are all going to use the id of teh image as there index.... so below will be the markup for the vote buttons for images with id of 12, 67 and 82... <tr> <td><input type="radio" name="vote[12]" value="1" /></td> <td><input type="radio" name="vote[12]" value="2" /></td> <td><input type="radio" name="vote[12]" value="3" /></td> <td><input type="radio" name="vote[12]" value="4" /></td> <td><input type="radio" name="vote[12]" value="5" /></td> <td><input type="radio" name="vote[12]" value="6" /></td> <td><input type="radio" name="vote[12]" value="7" /></td> <td><input type="radio" name="vote[12]" value="8" /></td> <td><input type="radio" name="vote[12]" value="9" /></td> <td><input type="radio" name="vote[12]" value="10" /></td> </tr> <tr> <td><input type="radio" name="vote[67]" value="1" /></td> <td><input type="radio" name="vote[67]" value="2" /></td> <td><input type="radio" name="vote[67]" value="3" /></td> <td><input type="radio" name="vote[67]" value="4" /></td> <td><input type="radio" name="vote[67]" value="5" /></td> <td><input type="radio" name="vote[67]" value="6" /></td> <td><input type="radio" name="vote[67]" value="7" /></td> <td><input type="radio" name="vote[67]" value="8" /></td> <td><input type="radio" name="vote[67]" value="9" /></td> <td><input type="radio" name="vote[67]" value="10" /></td> </tr> <tr> <td><input type="radio" name="vote[82]" value="1" /></td> <td><input type="radio" name="vote[82]" value="2" /></td> <td><input type="radio" name="vote[82]" value="3" /></td> <td><input type="radio" name="vote[82]" value="4" /></td> <td><input type="radio" name="vote[82]" value="5" /></td> <td><input type="radio" name="vote[82]" value="6" /></td> <td><input type="radio" name="vote[82]" value="7" /></td> <td><input type="radio" name="vote[82]" value="8" /></td> <td><input type="radio" name="vote[82]" value="9" /></td> <td><input type="radio" name="vote[82]" value="10" /></td> </tr> now the lovely bit... you can now use the indices of your array to contruct just one query on the database. <?php $qry = "INSERT INTO `upc_votes` (`photo_id`, `user_id`, `chlng_id`, `voter_rating`) VALUES "; foreach ($_POST['vote'] as $key => $val) { $qry .= "('$key', '$user_id', '$chlng_id', '$val') ,"; } $qry = substr($qry, 0 , -1); $res = mysql_query($qry); ?>
  2. it is a permissions thing - can you run ANY exec command on the server? if you can't then contact your server dude and ask them allow php to do so. To check just use exec to call anothe php file that sends you an email or something - that'll let you know if exec is avaialbel to you. If it is then you'll have to ask server dudes why you can't run ffmpeg.
  3. I have a file placed behind teh root of the site I require_once in any page requireing the connection. that way you only have to manage one file... but in your case if you run your page and its showing the username and password details then it sounds like php is not running properly - none of your source code should be available to view in the browser when you run a page. If it is doing then the installation has not been successful.
  4. that should work... replace that line of code with this little snippet and hopefully you'll see whats going on... <?php echo "<p>POST['test'] = " . $_POST['test'] . "</p>"; $test = empty($_POST['test']) ? 1 : $_POST['test']; echo "<p>test = " . $test . "</p>"; ?>
  5. try this... <?php $tvar = &$item['housingpayment']; // temp var with short name just for reuse in switch pass by reference to auto update.... switch(true) { case $tvar < 500: // minimun value not met $tvar = 'ERROR'; break; case $tvar < 1000: $tvar = 750; break; case $tvar < 1500: $tvar = 1250; break; default: $tvar = 1750; break; } echo $item['housingpayment']; ?>
  6. what do you mean you don't give it a variable name???? any files uploaded will be available in the $_FILES super global - to grab the file you want you'll need $_FILES['tmp_name'].
  7. try outline: none; or outline: 0; (can't remember which one it should be...)
  8. javascript... http://www.javascript-page.com/clock.html
  9. absolute positioning is awesome - provided you know what you're doing... the reason your div moves around is because your absolute positioning is doing exactly what it should. left:24%; will change (as in 24% of a smaller value) once the parent containers width has changed...
  10. apologies - yes my original post should have been "petID['.row[0].']" you can set what ever value you like - all you need to do is check whick keys (if you use array_keys($_POST['petID']) - you'll get them!) have been passed... radio buttons and check boxes are slightly different in that they are only set when they have been checked - unlik such things as text inputs which are still set but have an empty value if no text were entered...
  11. <?php echo "<tr><td><input type=checkbox name=".$row[0]."><img src=http://whimpsters.net/pets.php/".$row[0]."></td>"; ?> change to... <?php echo '<tr><td><input type="checkbox" name="'petID.$row[0].']"><img src="http://whimpsters.net/pets.php/'.$row[0].'"></td>'; ?> the in your processing script you can check against $_POST['petID'] which will be an array of all the IDs you have checked. use print_r($_POST['petID']) to see what's in the array...
  12. sometimes there are - sometimes however you just say well ie doesn't support the nice css I am using but it still looks really good so I am not going to bother with the extra markup or the hack or even the javascript that might make IE ball ball a litle better... Just a thought for those progessive enhancement slackers out there...
  13. you can use ajax to change portions of your page without a full http_request habing to be re-rendered... framea are a thing of the past - and for good reason...
  14. firefox has such a tool in teh web developer add-on - any graphics package will do the same. an just for good measure there are tool sout there that will generate markup for you - you use yoru image and click the areas on it you want for the hit area and it does the rest - http://www.linkedresources.com/tools/cimm/cimm_v0.45b2.html (there must be better ones out there but I can't do your searchig for you...)
  15. better to have one image where you just shift the background position... stops the unsightly blank space on first load.
  16. Presentational aspects should be covered by presentational code - so use css to do your bidding. DON'T go adding extra markup to get these images in. Style a plain old button and use css properties for rounded corners - ie won't see it but so what?
  17. OR - if you are going for the old progressive enhancement you could use css3 - and wait for the browsers to catch up. http://www.css3.info/preview/colored-border/ I do stuff like this because I don't consider the presentational layer to be anywhere near as important as the content and its unrealistic to expect exactly the same results in each browser. Use the technology available and don't worry too much that ie6 doesn't see it - so long as what it does render looks good - looking good doesn't have to mean looking the same!!!!
  18. <option value="green" selected="selected">Green</option> so you'd need some server side code to decide which option to apply the selected on...
  19. autocomplete="off" - but its not universally supported.
  20. print your post array - you will see that some browsers (I always get them the wrong way around so I'm going to refrain from saying which does what) have the coordinates of the image that was clicked others just treat the image input as a normal submit button.
  21. yes - you'd have to call a javascript function form flash. that function should then find the object tag by its id and then remove it from its parent element.
  22. this is all down to matching up your { and } also if(IsLoggedIn()) { echo '<a href="#">Logout[/url]'; } { echo '<a href="#">Login[/url]'; } is missing an else...
  23. No it isn't. You should have NO need for php to generate a css file ever - the beauty of cs files is that they are cached and hence speed up the rendering of your site... The ONLY situation where I use php to control anything to do with my presentational layer would be to generate inline styles - and then I'll only use it to put background-image: url(/path/to/image); in something like a product list... Use css well and you don't end up with reams of css to manage - the technique I gave earlier in this thread is very much the way you should build your presentational layer.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.