Jump to content

harristweed

Members
  • Posts

    346
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by harristweed

  1. echo what's being received from the posted forms, that will point you in the right direction.
  2. the variable $options will contain whatever was selected on the form. If you want $options to be specifically option 5, all I can suggest is change: $options = $_POST['theoptions']; to $options = 5
  3. <?php $directory="..\yourdirectory"; $dir="$directory"; $dp=opendir($dir); while($file = readdir($dp)){ if($file != '.' && $file != '..' ){ $insert=" insert into table ( file_name_table ) values ( '$file')"; mysql_query($insert,$link_id); } } ?>
  4. Possibly because the javascript file is external! <script type="text/javascript" src="imnothere.js"></script>
  5. Dyslexia rules KO! if($errors > 0) DOH!
  6. this is a bit 'cor blimmey' but a simple way is with a flag. $errors=0; // add flag to all error checks if (!$_POST["user"] | !$_POST["pass"] | !$_POST["email"] ) { echo "<div class='error'>Please fill in the required fields</div>"; $errors=1; } // then test the flag before putting data into database if ($flag < 1){ // add data }else{ //show error message }
  7. you need some content between a set of tags...... <?php $xml=simplexml_load_string ('<?xml version="1.0" encoding="utf-8"?><title>where is the content?</title>'); print_r($xml); ?>
  8. To verify, use the font in MsWord or other program, and try the characters. If that is the problem you can solve it easily. Buy the full version: http://www.fonts.com/FindFonts/detail.htm?pid=414225
  9. My point is: can that font display those characters? The problem is the font not PHP
  10. Are these characters available in the font? Can you display them in any other application?
  11. Happens to me all the time in Crome. I use Firefox for dev work. Not a PHP issue!
  12. I suspect that you don't have a connection to the database. Try echoing $connection.
  13. I don't believe this worked on any server! #selects all data from table and displays it in textfields. If failed, it will display the error $sql = "SELECT * from tblquotes ORDER BY Rand() LIMIT 1"; Does not select all data, it is LIMITED to one row! And $result = mysql_query($sql,$connection); if($result = mysql_query($sql ,$connection)) { runs twice $result = mysql_query($sql,$connection); and I suspect this will move the record pointer on so that the one row you have retrieved is not displayed.
  14. ...form here ... <input name="total" type="text" class="field text medium" id="total" tabindex="20" value="<?php echo $_POST['total'];?>" maxlength="255" /> </form><?php $total=$_POST['total']; ?>
  15. why not if(empty($cost))$cost="0" ?
  16. of course it does! doh! <?php $rss_file = "http://www.uefa.com/rssfeed/news/rss.xml"; $rss_feed = simplexml_load_file( $rss_file ); $count=1; foreach( $rss_feed->channel->item as $item ) { echo"<a title='$item->title' href='$item->link'> $item->title</a>"; $count++; if($count >10)continue; } ?>
  17. <?php $rss_file = "http://www.uefa.com/rssfeed/news/rss.xml"; $rss_feed = simplexml_load_file( $rss_file ); $count=0; foreach( $rss_feed->channel->item as $item ) { while($count<10){ echo"<a title='$item->title' href='$item->link'> $item->title</a>"; $count++; } } ?>
  18. http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html
  19. Well MrAdam just shows you should never assume!
  20. http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff
  21. <input type="checkbox" value=" yes" name="checkbox" <?php if($_POST['checkbox']=="yes")echo " checked = \"checked\" ";?> >
  22. if ($email <> "" and !ereg("^[^@ ]+@[^@ ]+\.[^@ \.]+$", "$email")) { echo"Not ok"; }else{ echo"Yippee"; }
  23. I agree but have found that separate scripts are easier to manage but that just a personal preference.
  24. If the page is refreshed then the data will update again. Therefore I suggest have the form access a script, the update script is held in a separate file, after a successful update redirect back to the form then refresh of the form will refresh that page and not the update script!
×
×
  • 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.