Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. have a look at your html source and make sure echo $email_address is actually echoed out correctly... I suspect a register_globals issue or you have neglected to set something before the form is output.
  2. look for the SMTP setting in your php.ini file it will be set to localhost... all you need to do is set it to the smtp of your ISP and it will all work fine (he says ;))
  3. Check boxes and radio buttons are thopse little oddities that are NOT set if they are unchecked... In your script where you look to set the values sent by these elements simply use.. $val = isset($_POST['chkbx1') ? $_POST['chkbx1'] : 'default'; you can then have set your default to whatever value you like and NOT kill the query.
  4. IF you use the field `id` as the unique or primary key then do this. Adapted the example in the manual for your needs [code] <?php $qry = "SELECT * FROM `atable` WHERE `id` = $id"; $qry = mysql_query($qry); // generate field names.. $fields = "("; $i = 0; while ($i < mysql_num_fields($qry)) { echo "Information for column $i:<br />\n"; $meta = mysql_fetch_field($qry, $i); if (!$meta) {   echo "No information available<br />\n"; } if ($meta->primary_key == 1) {   $pripos = $i; } $fields .= strcomp($fields,'(') == 0 ? "`" . $meta->name . "`" : ", `" . $meta->name . "`"; $i++; } $fields .= ")"; That is your string... Now the values... $row = mysql_fetch_assoc($qry); $vals = "("; $i = 0; foreach($row as $key => $val) { if ($i == $pripos) {   $vals .= strcomp($vals,'(') == 0 ? "NULL" : ", NULL" ; } else {   if (is_null($vals))   {    $vals .= strcomp($vals,'(') == 0 ? "NULL" : ", NULL" ;   }   else   {   $vals .= strcomp($vals,'(') == 0 ? "'" . $vals . "'" : ", '" . $vals ."'" ;   } } } $vals .= ")" $qry = "INSERT INTO `atable` " . $fields . " VALUES " . $vals . ""; $qry = mysql_query($qry); ?> [/code] Try that....
  5. max-execution time shoudln't be an issue. The script timing doesn't start until the uploads have completed.
  6. You would have to select a record then insert a new record with all the fields except the unique id.
  7. $string = $_POST['usrnm']; if (preg_match('/[^0-9a-zA-Z]/',$sting) === true){ // no you can't boyo!!!! }
  8. you can 'force' the font to be downlaoded! Now I tried this a while back and it only worked in IE at the time but some reading did indicate that other browsers would take it up..... You will need to get the MS WEFT tool ([url=http://www.microsoft.com/typography/web/embedding/weft3/]http://www.microsoft.com/typography/web/embedding/weft3/[/url]) create an .eot file from teh font you need. in your css put the following @font-face { font-family: "New Font"; src: url(http://www.ursite.com/font/newfont.eot); } New Font can be anything you want of course - you will define that.... NOW any text on your site that you wish to use that font on ( example here is a title header) the html.... <h1 id="title">YOUR TITLE</h1> the css... h1#title { font-family: "New Font", Verdana, sans-serif; } When a user visits the page and the don't have 'New Font' the page will display in the next font in the list BUT as soon as the font has been downloaded the page will refresh with your new font - and shoudl be cached for the next time they visit....
  9. use ajax so you don't have to reloafd the entire page...
  10. what you need to do is replace those characters in the url to be directed to. A browser would recognize as a variable by the &x=y. So replace & with somthing trivial like || and = with | so your link would look like this http://mydomain.com/link.php?e=i&link=index.php?foo|bar||user|happy Then in your redirection page you can do this.... $find = array( '/\|\|/', '/\|/' ); $rep = array( '&', '=' ) $link = pregreplace($find,$rep,$_GET['link']); This would yield: $link = 'index.php?foo=bar&user=happy'; you may even want to do similar with the '?' in the link variable....
  11. If you don't want the space left where that element was then display: none; is the option for you.
  12. worked on one previously and didn't suffer that much in terms of performance - the only problem being if the script hung. BUT I have seen a asp app (think it was in c#) that had an object monitor - this only kicked in when something changed in another object so would be a far more useful tool in this situation - haven't seen anything similar in php yet.
  13. why store all that in the database? Just echo out the link as jenk suggests...
  14. is $messages empty? if not then yoru form won't be popluated
  15. alter the sleep to 18 instead fo 20. or what ever value you need! I personally would loop just twice and leave sleep at 30.
  16. for security reasons you shoudl always opt for the latest version on general release (not neccessarily the latest version that is!). If your wensite has any OOP driven elements then stick with 4, update your scripts on a testing machine so they work in php5 then upgrade, if not upgrade to 5 straight away.
  17. Where did I say you were wanting them to insetr mysql? I sadi you shoudl not let them - by that I mean your code shoudl be such that youare protected against injection.... So I will accept your apology before you offer it  ;) There is no point in reasearching what regex you will need to perform thsi task - it will be less efficient and less effective than the already availbe, built for purpose functions.
  18. If you are familiar with AJAX then the only thing you need to consider is if the user has js turned off. Ajax in most cases can significantly reduce the load on the server so I do use when possible - but always make sue the sites/scripts degrade nicely when js is off.
  19. you should not be allowing users to inject mysql! any data you process from a form should be checked to see if they are trying to inject - using mysql_escape_string or mysql_escape_real_string are what you need.
  20. have you defined it? the actual global you are looking for is $_SERVER['PHP_SELF'] so unless you have done... $PHP_SELF = $_SERVER['PHP_SELF']; it will fail.
  21. pointless exercise. You can disable the menu altogether when opening a pop-up with js BUT one of the browsers I use (avant) keeps thes menus availoabel at all times. The only option you have is something driven by javascript and people can turn that off - so I woudl not bother trying. Some busineses that did not want the html stealing designed entire sites in flash.....
  22. UPDATE phone_tariffs SET Name = '$name', Tariff = '$tariff', Image = '$image'; BUT if you just did that it woudl up date EVERY record in you database so make sure you use the WHERE cluase if you only want to update certain records. UPDATE phone_tariffs SET Name = '$name', Tariff = '$tariff', Image = '$image' WHERE Id = '$id' Will ensure you only update the row(s) where Id = the ste value.
  23. Tell Miek to pay me and I'll help you ;) Christ its only $100
  24. Write one! it would be quicker to help you out with the errors you are getting than to point you to any scripts that you would have to customize......
×
×
  • 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.