Jump to content

Ayon

Members
  • Posts

    141
  • Joined

  • Last visited

    Never

Everything posted by Ayon

  1. Nothing special in particular at the moment.. Except this.. This is just going to be something that contains useful custom php functions that I can just keep on building on as I learn new stuff or work on projects..
  2. Hi everyone! This is not exactly related to a scripting issue. Basicly what I want to do, is make a library of functions and classes that I can use later on to ease my work. But I'm trying to find a good way to do this, but still no luck. The functions are all planned out. It's the structure of the files and folders that's beeing a pain in the ass. Also I'm not sure if I should use only classes, only functions or a mix of both. I've tried doing a mix of both, but then, often I found my self unable to decide if the newly created function should be a part of a class or not... The way i've tried setting it up now is this root |-library |--class |---file.class.php |--libs |---file.lib.php |-init.php (Includes some path definition and functions to load everything needed) index.php All ideas are more than welcome Thanks in advance Greets, Ayon
  3. edit: i really don't know how i missed the solved part... *my bad*
  4. "SELECT * FROM pb where uid='".$getuser['ID']."' ORDER BY pb ASC"
  5. Does it exist an alternative to this to use on earlier PHP versions than 5.3.0?
  6. session_start(); & $_SESSION would be a good start
  7. that's for good feedback.. i finally understand the difference
  8. not sure, but you could try this: $message = htmlspecialchars($_POST['name'] . "\n" . $_POST['email'] . "\n" . $_POST['guests']);
  9. i wasn't sure where to put this, so if it's in the wrong place just kick it wherever you want Well as I stated in the topic its about PHP Application ... i'm currently working on a little framework for personal use... ive been scanning trough several frameworks to get ideas on how to set up the directories etc, and i often see a folder called something simular to "classes" and one called "lib" or something close... baisicly my question is... what's the difference between a class file and a lib file? cuz from what i've seen both "file types" contains classes.. but also, some lib files only contains only functions... I'm confused ??? Thanks in advance - Ayon
  10. cant belive how easy it was!! this i what helped me http://no2.php.net/manual/en/mysqli-stmt.bind-param.php#89171
  11. try this str_replace("\n","<br />\n",$qry[message]);
  12. baisicly i'm building the where part of the query up from an array... i pass trough the prepare() perfectly but then i get stuck... this is what i've got now.. never thought it would work but had to try it $marker = $stmt->param_count; $type=null; $values=null; for($i=0;$i<$marker;$i++) { $type .= $stmt_bind['type'][$i]; $values .= $stmt_bind['value'][$i]; if ($i<$marker-1) { $values .= ', '; } } $stmt->bind_param($type, $values); The error i expected to get and got Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]: Number of elements in type definition string doesn't match number of bind variables in C:\wamp\www\framework\pel_lib\classes\mysql.class.php on line 77 Is there a way to solve this and still be using the array setup i've got? I've checked all values and they return the right values... Thanks in advance
  13. what I've found as the easiest way for getting the extension of a file is using end(explode(".",filename.php));
  14. well i'm rewriting my mysql object now to work with prepared statements... haven't been doing this for to long. atleast not heavy stuff like this.. so my code is starting to get a little bit confusing now that i've passed 300 lines XD but i think i'm getting there very happy i'm solid on arrays
  15. could you explain the concept about a data cage? and also another question... i have made a fully custom mysql class running baisicly everything trough my own object's and methods... now i just took a really quick look at mysqli... is that baisicly a mysql object only pre-made kinda like a framework? probably a noobish question hehe
  16. you could try and use if (!in_array()) { add to array }
  17. dunno if this is the reason... but i just noticed it... your missing a ) at the end there... if (mail($to, $sender, $message, $from) {
  18. Hmm, I thought only uppercase commands were used, but i guess i'm wrong then i modifier added. But what you mean with sub array element? could you give a quick example? I guess you're talking about $_POST in your reply right? Atleast I can't see any $_GET relevant info might be me beeing stupid tho hehe And thanks for the links.. Will read and see what I understand You might get a couple of questions tho hehe @both of you..thanks for great replies! Very much appreciated!
  19. yeah i know it's just as easy to send injections trough $_POST as it is trough $_GET... but the one i posted there is only for the $_GET, and no I never send any SQL statements trough the $_GET Is it secure enough or am I missing something? as for the $_POST i only know about the htmlspecialchars() and mysql_real_escape_string()... is there anything else i should do besides those? Thanks for the reply
  20. have you tried echo'ing out the values of your variables?
  21. i'm not that good with regex but you could try preg_replace("/[a-zA-Z0-9-]+/","",$var) or something...
  22. the error message is just telling you that the function valid_email() doesn't exist
×
×
  • 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.