| Weapon Profil: New Penguin | I've created this topic here (if any admin thinks that this is the wrong place for this topic delete it) because I've seen a few ppl asking about PHP, and no one answered. Well, now you can ask here and we help you creating your scripts. But please, don't ask anything but PHP related stuff. And remember, we HELP you, but we don't give you scripts already written by someone else. Regards, Weapon | |
vaksa Profil: Top Penguin | Very good idea! Thanks for your initiative, Weapon  | |
Weapon Profil: New Penguin | What can I say, I'm doing my best  | |
thijs Profil: New Penguin | it was my idea mibiie can i help whit the php help  go to forum php t v1 | |
Weapon Profil: New Penguin | Quote :
thijs wrote: oke dan but waopon stool use idea the *****
|
I didn't steal anything, please control your language and correct it first. I don't mean to argue here, but I just created a sepparated topic for talking ONLY PHP related stuff. I just can't figure what's the thing that bothers you...anyway...when you have to post again please write down some gramatically correct words, so we all understand what you say. Thank you. PS: What you wrote in that post it's NOT a tutorial, it's more like "hello, my name is thijs and I've come to conquer the Earth". (no offense, and the procedure you described in your "tutorial" it's concatenation ) PS2: I'm sorry if my language isn't perfect, my first language isn't english, and I'm sorry if my post sounds offensive, I really don't mean it. | |
Didas le soleil se lève avant moi, je me couche après lu Profil: God of Penguins | what's that discussion...?  you both are good in PHP, isn't it? why don't you try to work together instead of being "the only one who speaks about PHP on this forum"? creating a whole tutorial together would be a great idea, anything else is dumb. | |
Weapon Profil: New Penguin | Yes Didas, you're right, but I'm not the one who thinks himself "the PHP man of the forum", I would be glad to hear from him "let's put our minds together and create a tutorial" or "let's create a PHP scripting web site" but it seems like he knows everything and anyone else that opens a PHP discussion topic is stupid. I'm sorry for this kinda conflict, I won't reply on the same subject again. | |
Weapon Profil: New Penguin | No problem, man, I'm sorry too. Now let's try to stay on topic and start helping not arguing  | |
Didas le soleil se lève avant moi, je me couche après lu Profil: God of Penguins | thanks a lot, nice to see you 2 discussing  | |
DarK FlameS Profil: Penguin | hey nice... i think that I can help here too... it would be fine... so let the questions come | |
Weapon Profil: New Penguin | Welcome to the PHP Community, DarK FlameS. I think we have to wait some time until some people will ask something...but let's hope they will do it  | |
Didas le soleil se lève avant moi, je me couche après lu Profil: God of Penguins | as you prefer : you can wait until members have some questions to ask. or you can do a whole tutorial  "everything about PHP, from the beginning to quite harder functions" a presentation would be cool for beginners (what is it used for, what can we do with it...... and afterthat, step by step, you explain a few things with screenshots, codes, examples, etc...) what do you think about that? working all two (maybe three, if DarK FlameS also wants to help you) together  | |
DarK FlameS Profil: Penguin | yeah.. I'm here to help... but the tutorial was being made by thijs on the other topic, so I think that here we really just answer the questions.. i think that by this way it'll be better | |
Weapon Profil: New Penguin | that would be a great idea Didas, thanks for inspiring so what do you say thijs, can we do it?  here's a function that may help, if you need to generate some codes (for now, works with numbers only, I'm working on characters too, but not going on so well) CODENumber randomizing script: <?php $text_displayed=""; // initialize an empty variable to store the code into $length=6; // set the length of the randomized code $i=1; // set a counter while($i<=$length){ //check to see if the counter is invalid or not $text_displayed .= rand(0,9); // set a range for each randomized number $i++; // upgrade the counter after each number randomized } echo $text_displayed; // display the result ?> I'll be back later with a script that will randomize numbers+ low case letters+capital letters in a code integrated into an image...stay tuned! | |
thijs Profil: New Penguin | nice script didas ----------------------------------------- oke here my script a browser finder CODE<? function browser() { $g = strtolower(rawurldecode($_SERVER['HTTP_USER_AGENT'])); if(eregi('opera ([0-9]+.[0-9]+)', $g, $regs)) { $buffer = "Opera"; } elseif(eregi('msie ([0-9]+.[0-9]+)', $g, $regs)) { $buffer = "Microsoft Internet Explorer"; } elseif(eregi('opera/([0-9]+.[0-9]+)', $g, $regs)) { $buffer = "Opera"; } elseif(eregi('lynx/([0-9]+.[0-9]+.[0-9]+)', $g, $regs)) { $buffer = "Lynx"; } elseif(eregi('konqueror/([0-9]+.[0-9]+.[0-9]+)', $g, $regs)) { $buffer = "Konqueror"; } elseif(eregi('netscape6/([0-9]+.[0-9]+.[0-9]+)', $g, $regs)) { $buffer = "Netscape navigator"; } elseif (eregi('mozilla/([0-9]+.[0-9]+)', $g, $regs)) { $buffer = "Mozzila"; } else { $buffer = "Onbekend"; } return $buffer; } echo browser(); ?> <written by thijs burema> and here a example next a login systeem for download code go here | |
DarK FlameS Profil: Penguin | hey guys, nice scripts u have done... I'm not so good yet, I'm a starter, but, soon I post a script here.. see ya | |
DarK FlameS Profil: Penguin | let me see what i can do... i'll post a simple thing... just how to do a Contatc form so, let's do it CODE<? if (!$mesage) { //this is just to verify if the form has been used /*now comes the HTML, that is why I'm closing the PHP tag*/ ?> <form id="form1" name="form1" method="post" action="contact.php"> <label>name<br /> <input name="name" type="text" size="80" maxlength="80" /> </label> <p> <label>e-mail<br /> <input name="email" type="text" size="80" maxlength="30"/> </label> </p> <p> <label>Mesage<br /> <textarea name="mesage" cols="60" rows="5"></textarea> </label> </p> <input name="submit" type="submit" value="submit" /> </form></td> <? } else { // validating the e-mail (this is not made by me, I get the validate thing done) function validate_email($email) { // Create the syntactical validation regular expression $regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$"; // Presume that the email is invalid $valid = 0; // Validate the syntax if (eregi($regexp, $email)) { list($username,$domaintld) = split("@",$email); // Validate the domain if (getmxrr($domaintld,$mxrecords)) $valid = 1; } else { $valid = 0; } return $valid; } //Sending the e-mail $name = $_POST[name]; $email = $_POST[email]; $mesage = "Mesage sent by $name<br> e-mail: $email<br> Mesage: $_POST[mesage]"; //end of $mesage $mailto = "darkflames@gmail.com"; $subject = "subject of the mail"; $headers = "From: $email\nContent-Type: text/html; charset=iso-8859-1"; if (validate_email($email)) { if(mail($mailto , $subject, $mesage, $headers)) { echo "e-mail sent"; $mesage = TRUE; } else { echo "the mail can't be sent. Please try again later"; $mesage = TRUE;; } } else { echo "not valid e-mail"; $mensagem = TRUE; } } ?> NOTES: 1) - the the echo "e-mail sent"; , echo "the mail can't be sent. Please try again later"; and echo "not valid e-mail"; will apear in the body of the page, 2) - the action="contact.php" is the self page... so your script is in contact.php and you'll submit to contact.php, by that way is possible to write on the body of html the echo of the note 1 3) - if you still have doubt about this, post here see ya  | |
Bricomix Profil: Penguin Pro | Utiliser directement $mesage dans le début du script est une très mauvaise chose... Si dans la configuration de PHP, les register_globals sont désactivés (ce qui est de plus en plus le cas), ça ne fonctionnera jamais --> failles potentielles. Il faut passer par les tableaux super-globaux $_POST, $_GET, etc... Réfère-toi à la documentation PHP  De plus, si le niveau d'affichage des erreurs inclut les notices, tu obtiendras des erreurs comme quoi la variable n'existe pas. Il faut tester son existence d'abord, à l'aide de isset(var). | |
DarK FlameS Profil: Penguin | Bricomix, I jus't can't understand you... so please, can you post in english??? or someone translate his post to me???? | |
Bricomix Profil: Penguin Pro | Sorry, I think I was tired... I didn't see the language of this topic  So, I said that using $mesage directly is a very bad thing... If register_globals setting is disabled in PHP's configuration file (more and more hosts do this), it won't work ---> this is a potential security failure... You have to use superglobals... Moreover, you don't test that variables exist before using them. If error_reporting setting includes E_NOTICE, you will get errors as you are using a variable that doesn't exist. You can use isset(var) to know whether a variable is defined or not. | |
DarK FlameS Profil: Penguin | yeah I know about isset, but i just learned a few time ago... and as I said, it's just a simple one, I'm not an advanced programmer... thanks about all the advice about security... | |
| |