Jump to content

bh

Members
  • Posts

    238
  • Joined

  • Last visited

About bh

  • Birthday 02/10/1987

Contact Methods

  • Website URL
    http://b3ha.blogspot.com/

Profile Information

  • Gender
    Male
  • Location
    Budapest, Hungary

bh's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. @silkfire: "to check an input to make sure it only consists"
  2. hi, had you about http://php.net/manual/en/book.pcre.php? what is the type of the input? float? than maybe http://www.php.net/manual/en/function.is-float.php
  3. hi, heres an example: $sql = "SELECT * FROM content WHERE page = '$page'"; $res = mysql_query($sql) or die (mysql_error()); if (0 === mysql_num_rows($res)) { // page not found // send a header and exit } while($row = mysql_fetch_assoc($res)){
  4. and you want to get $_POST['file'] ??? are you sure? update: try to get $_FILES['file'] // var_dump($_FILES['file']);
  5. hi, so becouse not all user agent set this value, you have to check whether this property is exists or not. try to debug it (eg output the referer)
  6. If you have a small code its worthless. Rather enterprise level worth separate app and business logic. Your application with template system enhance readability, servicing... you can simply change templates (eg. other color schemes...), designers work easily on templates
  7. Hi, you should query in the minimal content u can. If your parts in anywhere in the body get the entiry body and run the search loop in it. If those in a div get that div... Anyway regexp is not a fast method. You can use str pos in a loop, with the handy offset paramterer.
  8. Yep, youre right. And popular frameworks has template system, yes. Imho its ugly cuz theres <?php ?> tags in your template. Extra language to learn at elementary level is almost nothing. Overhead at now with Smarty 3 (based on PHP 5 - 100% rewrite) also a bit (if you use eg APC its almost nothing to). But if you use smarty (and you choose the tiny overhead) youve got some extra feature which smarty add to you (block, functions, modifiers...).
  9. Yep, as i sad theres an other problem at the and of your code. Put a bracket after echo... echo (" <td align='center' height='30'><form name='myForm' method='post' action='event_details.php'><input type='hidden' name='event_id' value='" . $row["id"] . "'><input type='image' src='images/btn_event_details.jpg' align='absmiddle' height='30' alt='View Full Event Details'></form></td> </tr> </table> <br>"); }
  10. sry, i forgot the bracket: <tr>"); if ($row['cancel'] == 1) {
  11. Use template system (like Smarty) to do that. From PHP you can assing variable to your template. In your template you can use html, js, css and your application code will be separated from your presentation code.
  12. <tr>" if ($row['cancel'] == 1) { -> <tr>"; if ($row['cancel'] == 1) { And theres one more at the end of your code in echo statement. At the beginning of echo you dont use bracket, but at the end as finish you use it.
  13. Hi, heres the mysql manual mysql_manual_delete DELETE FROM answer WHERE Ans_Answer1 = 1 AND ...
  14. Hi, you always get 0..10 rows: $sql="SELECT * from sp_users,sp_schools where sp_users.user_id=sp_schools.school_id ORDER BY school_name LIMIT 0, 10"; Send the actual offset (now 0) and length (now 10) to the next page (if someone click next or previous) eg in a hidden input. At next page you can get your previous page's hidden inputs. After that you can calculate it (eg show the next 10 rows - set offset to 10)
  15. Hi, you need a delimiter such as / preg_replace("/youtube/","test",$relatedVideo->watchURL);
×
×
  • 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.