CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Liste des sujets

librairie gd

linkinonline
linkinonline
Niveau 9
27 mars 2005 à 21:38:22

salut tout le monde , j´ai utilisé la librarie GD pour faire un petit programme :

le voila :

< ?
if ( isset($_POST[´ab1´]) AND isset($_POST[´ab2´]) AND isset($_POST[´or1´]) AND isset($_POST[´or2´])) {
$variable1 = $_POST[´ab1´];
$variable2 = $_POST[´ab2´];
$variable3 = $_POST[´or1´];
$variable4 = $_POST[´or2´];
}
else {
$variable1 = " ";
$variable2 = " ";
$variable3 = " ";
$variable4 = " ";
}
? >
< ?

$image = imagecreate(500,500);

$bleuclair = imagecolorallocate($image, 156, 227, 254);
$bleufonce = imagecolorallocate($image, 77, 24, 231);
$rouge = imagecolorallocate($image, 240, 88, 15);

ImageFilledRectangle ( $image, 10,10, 50, 50, $bleufonce);
ImageFilledEllipse ( $image, 85, 60, 45, 45, $rouge);
$points = array(35, 99, 199, 110, 165, 250);
$deux = array(35, 99, 25, 220, 165, 250);
$trois = array(35, 99, 220, 99, 199, 110);
$quatre = array(199, 110, 220, 99, 165, 250);
ImagePolygon ( $image, $points, 3, $rouge);
ImagePolygon ( $image, $deux, 3, $rouge);
ImagePolygon ( $image, $trois, 3, $rouge);
ImagePolygon ( $image, $quatre, 3, $rouge);
ImageLine ( $image, $variable1, $variable3, $variable2, $variable4, $bleufonce);
imagepng($image,"nomimage.png");

? >

< html>
< head>
< title> < /title>
< /head>
< body>
< img src="nomimage.png">
< form action="image2.php" method="POST">
< br>
absisse x : < input type="text" name="ab1"><br>
ordonnée y : < input type="text" name="or1"><br>
absisse x : < input type="text" name="ab2"><br>
ordonnée y : < input type="text" name="or2"><br>

< input type="submit">
< /form>

:snif2:

< /form>
< /html>

Au fait, ca doit juste faire une droite !

Sauf que quand on réentre les 4 valeurs , ca crée une autre droite et ca efface l´ancienne , donc j´ai essayé d´utilisé une base de données avec 5 champs , mais cela ne fonctionne pas :

< html>
< head>
< title> < /title>
< /head>
< body>
< ?
if ( isset($_POST[´ab1´]) AND isset($_POST[´ab2´]) AND isset($_POST[´or1´]) AND isset($_POST[´or2´])) {
$ab1 = $_POST[´ab1´];
$ab2 = $_POST[´ab2´];
$or1 = $_POST[´or1´];
$or2 = $_POST[´or2´];
mysql_connect("localhost", " root", " "); / / Connexion à MySQL
mysql_select_db("forum"); / / Sélection de la base mateo21
$sql = ´INSERT INTO `dessin` ( `id` , `ax` , `ox` , `ay` , `oy` ) ´
. ´ VALUES ( \´\´, \´$ab1\´, \´$or1\´, \´$ab2\´, \´$or2\´ ) ;´
. ´ ´;

$reponse = mysql_query(SELECT * FROM dessin where ax=´$ab1´);

while ( $donnees = mysql_fetch_array($reponse))
{
$variable_finale_un= $donnees[´ax´];
$variable_finale_deux= $donnees[´ox´];
$variable_finale_trois= $donnees[´ay´];
$variable_finale_quatre= $donnees[´oy´];

}
mysql_close(); / / Déconnexion de MySQL

}

? >

< ?

$image = imagecreate(500,500);

$bleuclair = imagecolorallocate($image, 156, 227, 254);
$bleufonce = imagecolorallocate($image, 77, 24, 231);
$rouge = imagecolorallocate($image, 240, 88, 15);

ImageFilledRectangle ( $image, 10,10, 50, 50, $bleufonce);
ImageFilledEllipse ( $image, 85, 60, 45, 45, $rouge);
$points = array(35, 99, 199, 110, 165, 250);
$deux = array(35, 99, 25, 220, 165, 250);
$trois = array(35, 99, 220, 99, 199, 110);
$quatre = array(199, 110, 220, 99, 165, 250);
ImagePolygon ( $image, $points, 3, $rouge);
ImagePolygon ( $image, $deux, 3, $rouge);
ImagePolygon ( $image, $trois, 3, $rouge);
ImagePolygon ( $image, $quatre, 3, $rouge);
ImageLine ( $image, ´$variable_finale_un´, ´$variable_finale_deux´, ´$variable_finale_trois´, ´$variable_finale_quatre´, $bleufonce);
imagepng($image,"nomimage.png");

? >

:(

< img src="nomimage.png">
< form action="image3.php" method="POST">
< br>
absisse x : < input type="text" name="ab1"><br>
ordonnée x : < input type="text" name="or1"><br>
absisse y : < input type="text" name="ab2"><br>
ordonnée y : < input type="text" name="or2"><br>

< input type="submit">
< /form>

< /form>
< /html>

Voila pour les deux il fo creer une base de donnée nommé " forum" et une table nommée " dessin"

Le premier marche mais pas le deuxieme...

attack444
attack444
Niveau 9
27 mars 2005 à 21:41:15

Pour afficher correctement tes scripts dans tes posts(sans espaces supplémentaires...): http://www.membres.lycos.fr/vgp/

linkinonline
linkinonline
Niveau 9
27 mars 2005 à 21:43:35

ca marche aps ton truc :snif2:

attack444
attack444
Niveau 9
27 mars 2005 à 21:50:40

Si prends ton code par morceaux, faut pas que ce soit trop long sinon ça ne marchera pas !

Colle donc une petite partie et clique sur ok, si tu vois que ça déconne, c´est soit que ton code est trop long soit qu´il faut que tu le recolles une 2e fois dans la zone de texte et que tu recliques sur ok !

Va voir le topic que je viens de faire, tu verras que ça marche ! ! :cool: :-)

linkinonline
linkinonline
Niveau 9
27 mars 2005 à 22:13:30

et ta pas un truc qui corrige tout les défault de mon code ? :p)

patate_violente
patate_violente
Niveau 10
27 mars 2005 à 22:21:50

essai plutot avec ce site http://rafb.net/paste/

linkinonline
linkinonline
Niveau 9
27 mars 2005 à 22:40:04

ya des gens ici?

Sous forums
  • Aide à l'achat Mac
  • Steam Deck
  • Création de sites web
  • Création de Jeux
  • Linux
  • Programmation
  • Internet
  • Macintosh
  • Hardware
La vidéo du moment