naatsu and 19 unknown users

 Word :   Username :  
 
 Page :  1  2
Previous 
Author
 Thread :

PHP ONLY!

 
n°22209
Weapon
Profil: New Penguin
Avatar
profil
Posted on 01-12-2006 at 01:07:50 AM  
 

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

answer
mood
GoogleAds
profil
Posted on 01-12-2006 at 01:07:50 AM  
 

answer
n°22210
vaksa
Profil: Top Penguin
Avatar
profil
Posted on 01-12-2006 at 01:11:11 AM  
 

Very good idea! :cool: Thanks for your initiative, Weapon :wink:

answer
n°22212
Weapon
Profil: New Penguin
Avatar
profil
Posted on 01-12-2006 at 04:17:53 AM  
 

What can I say, I'm doing my best  :lol:

answer
n°22213
thijs
Profil: New Penguin
Avatar
profil
Posted on 01-12-2006 at 12:24:20 PM  
 

it was my idea mibiie can i help whit the php help :penguin:
go to forum php t v1

answer
n°22215
Weapon
Profil: New Penguin
Avatar
profil
Posted on 01-12-2006 at 01:24:56 PM  
 

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  :cool: )
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.

answer
n°22216
Didas
le soleil se lève avant moi, je me couche après lu
Profil: God of Penguins
Avatar
profil
Posted on 01-12-2006 at 01:45:09 PM  
 

what's that discussion...? :xeyes:

 

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.

answer
n°22217
Weapon
Profil: New Penguin
Avatar
profil
Posted on 01-12-2006 at 03:22:35 PM  
 

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.

answer
n°22218
thijs
Profil: New Penguin
Avatar
profil
Posted on 01-12-2006 at 06:06:36 PM  
 

oke sorry my en is very bat  :tuxout:  :wink2:  :wink2:

answer
n°22219
Weapon
Profil: New Penguin
Avatar
profil
Posted on 01-12-2006 at 06:59:53 PM  
 

No problem, man, I'm sorry too. Now let's try to stay on topic and start helping not arguing :smile:

answer
n°22220
Didas
le soleil se lève avant moi, je me couche après lu
Profil: God of Penguins
Avatar
profil
Posted on 01-12-2006 at 07:17:12 PM  
 

thanks a lot, nice to see you 2 discussing :great:

answer
n°22221
thijs
Profil: New Penguin
Avatar
profil
Posted on 01-13-2006 at 02:01:06 PM  
 

:party:  :party: oke lets go .. :smile:

answer
n°22222
DarK FlameS
Profil: Penguin
Avatar
profil
Posted on 01-14-2006 at 02:12:16 AM  
 

hey nice... i think that I can help here too... it would be fine... so let the questions come

answer
n°22223
Weapon
Profil: New Penguin
Avatar
profil
Posted on 01-14-2006 at 02:55:52 AM  
 

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 :smile:

answer
n°22224
Didas
le soleil se lève avant moi, je me couche après lu
Profil: God of Penguins
Avatar
profil
Posted on 01-14-2006 at 03:42:44 AM  
 

as you prefer :
you can wait until members have some questions to ask.

 

or you can do a whole tutorial :idea:

 

"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? :smile:
working all two (maybe three, if DarK FlameS also wants to help you) together :penguin: :penguin: :penguin:

answer
n°22225
DarK FlameS
Profil: Penguin
Avatar
profil
Posted on 01-14-2006 at 04:06:48 AM  
 

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

answer
n°22226
Weapon
Profil: New Penguin
Avatar
profil
Posted on 01-14-2006 at 04:10:13 AM  
 

that would be a great idea Didas, thanks for inspiring :biggrin: so what do you say thijs, can we do it? :tongue:

 

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!

answer
n°22227
thijs
Profil: New Penguin
Avatar
profil
Posted on 01-14-2006 at 10:01:24 AM  
 

nice script didas :cool:  :cool:

 

-----------------------------------------

 

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 :penguin:  :penguin:  :penguin:

 

for download code http://thijs.th.funpic.de/img/tar.png go here

answer
n°22228
DarK FlameS
Profil: Penguin
Avatar
profil
Posted on 01-14-2006 at 02:26:38 PM  
 

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

answer
n°22230
DarK FlameS
Profil: Penguin
Avatar
profil
Posted on 01-23-2006 at 11:11:09 PM  
 

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  :he:

 

see ya :cool:

answer
n°22231
Bricomix
Profil: Penguin Pro
Avatar
profil
Posted on 01-23-2006 at 11:16:12 PM  
 

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 :tongue:
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).

answer
n°22234
thijs
Profil: New Penguin
Avatar
profil
Posted on 01-24-2006 at 03:24:27 PM  
 

oke  :lol:  :lol:  CODEphp 4$ ever :mdr:  :mdr:

answer
n°22237
DarK FlameS
Profil: Penguin
Avatar
profil
Posted on 01-28-2006 at 08:12:47 PM  
 

Bricomix, I jus't can't understand you... so please, can you post in english??? or someone translate his post to me????

answer
n°22238
Bricomix
Profil: Penguin Pro
Avatar
profil
Posted on 01-28-2006 at 10:15:50 PM  
 

Sorry, I think I was tired... I didn't see the language of this topic :he:

 

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.

answer
n°22239
DarK FlameS
Profil: Penguin
Avatar
profil
Posted on 01-29-2006 at 12:45:29 AM  
 

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...

answer
n°22243
thijs
Profil: New Penguin
Avatar
profil
Posted on 02-18-2006 at 12:39:18 PM  
 

soon more scripts herer :smile:  :smile:  :smile:  :smile:

answer
 Page :  1  2
Previous 
Top 

Go to:
Add a reply