PHP|Débutant :: Forums

Advertisement

Besoin d'aide ? N'hésitez pas, mais respectez les règles

Vous n'êtes pas identifié(e).

#2 Re : Forum Général PHP » envoi page courante par mail » 04-05-2010 09:27:09

daccord je suis ici pour apprendre et je ne viens que lorsque je suis bloqué;j'ai affiché unpetit  bout de code et j'ai pensé que pour des PRO ca serai tres simple de nous dire voila l'erreur il vient d'ici ou de la, sur ma specialite je te repondrai pas commeca cher ALNOSS
merci

#3 Re : Forum Général PHP » envoi page courante par mail » 04-05-2010 09:27:09

merci Alnoss C'est pour une autre application le code que tu as suprimé affiche erreur a la ligne 3 ET je vois pas la raison

#4 Re : Forum Général PHP » envoi page courante par mail » 04-05-2010 09:27:09

qq peut il revoir ce code et le corrigé

NdM : CODE SUPP - ON EST PAS LA POUR CA !!!! Fais tes essais et si tu tombes sur un soucis, expose ton soucis !! DERNIER avertissement !

#5 Forum Général PHP » envoi page courante par mail » 04-05-2010 09:27:09

SAAD207
Réponses : 10

Bonjour à tous!
En PHP, je cherche un script permettant d'envoyer la page courante affichée dans le navigateur par mail.
on voit ça partout "Envoyer cette page à un ami" mais : COMMENT CA MARCHE?
sachant que cette page est dynamique , affiche resultat d'une requete mysql
Merci d'avance à ceux qui pourront m'aider....

#6 Re : Forum Général PHP » récupérer la valeur des items d'un tableau associatif » 25-04-2010 16:18:54

merci de votre aide j'ai fini par trouvé on effet j'ai remplacé xy par $var et j'ai declaré $var=$row['reference'];
et ca marche nikel , merci de votre aide sans lui je n'aurez pas trouvez la solution

#7 Re : Forum Général PHP » récupérer la valeur des items d'un tableau associatif » 25-04-2010 16:18:54

ok


onclick=\"window.location.href='ficheupdate2.php?reference=xy';\"    \\  ici c'est ok
onclick=\"window.location.href='ficheupdate2.php?reference=<?php echo $row['reference']; ?>';\"   \\ici erreur de syntaxe

 

#8 Re : Forum Général PHP » récupérer la valeur des items d'un tableau associatif » 25-04-2010 16:18:54

oui je reprends ton code et si je met reference= XY ca donne mais si je remplace xy avec <?php echo $row['reference']; ?>" ca donne erreur de syntaxe
onclick=\"window.location.href='ficheupdate2.php?reference=xy';\"     ici c'est ok
onclick=\"window.location.href='ficheupdate2.php?reference=<?php echo $row['reference']; ?>';\" ici erreur de syntaxe
j'arrive pas a la corriger
merci de votre aide

#10 Re : Forum Général PHP » récupérer la valeur des items d'un tableau associatif » 25-04-2010 16:18:54

ok ne vous fachez  pas et n'oublier surtout pas qu'il pourrait bien s'agire d'un novice n'ayant pas l'habitude des forum et qu'il est ici pour qu'on l'aide.. merci quand meme

#11 Re : Forum Général PHP » récupérer la valeur des items d'un tableau associatif » 25-04-2010 16:18:54

merci mais  quel code va d'abors recuperer la variable reference sur onclick

#12 Forum Général PHP » récupérer la valeur des items d'un tableau associatif » 25-04-2010 16:18:54

SAAD207
Réponses : 9

apres plusieurs recherche je suis bloquer et je viens ici demander aide;j'ai un tableau cree dynamiquement suite a une requete php lorsque je clique sur une ligne je dois recuperer la valeur d'un champs appelé reference et l'envoyer vers une autre page et la je suis coincé je suis debutant en php et je demande votre aide
et j'envois la portion du code sur laquelle je dois utiliser JE PENSE recuper_id ? au besoin j'envois la totalité du code MERCI DE VOTRE AIDE

<?php
 if($total) {
   // début du tableau
    echo '<table>'."\n";
        // affichage
        echo '<tr >';
        echo '<td bgcolor="#9191FF"><b><div align="center"><strong><font color="#FFFFFF"><strong>Type</strong></font></strong></div></b></td>';    //<td><div align="center">ok</div></td>
    echo '<td bgcolor="#9191FF"><b><div align="center"><strong><font color="#FFFFFF"><strong>Reference</strong></font></strong></div></b></td>';
    echo '<td bgcolor="#9191FF"><b><div align="center"><strong><font color="#FFFFFF">Nserie</font></strong></div></b></td>';
    echo '<td bgcolor="#9191FF"><b><div align="center"><strong><font color="#FFFFFF">Marque</font></strong></div></b></td>';
    echo '<td bgcolor="#9191FF"><b><div align="center"><strong><font color="#FFFFFF">Model</font></strong></div></b></td>';
        echo '<td bgcolor="#9191FF"><b><div align="center"><strong><font color="#FFFFFF">Annee</font></strong></div></b></td>';
    echo '<td bgcolor="#9191FF"><b><div align="center"><strong><font color="#FFFFFF">Capacite</font></strong></div></b></td>';
    echo '<td bgcolor="#9191FF"><b><div align="center"><strong><font color="#FFFFFF">Energie</font></strong></div></b></td>';
    echo '<td bgcolor="#9191FF"><b><div align="center"><strong><font color="#FFFFFF">Typemat</font></strong></div></b></td>';
    echo '<td bgcolor="#9191FF"><b><div align="center"><strong><font color="#FFFFFF">Valve</font></strong></div></b></td>';
        echo '<td bgcolor="#9191FF"><b><div align="center"><strong><font color="#FFFFFF">Volt</font></strong></div></b></td>';
    echo '<td bgcolor="#9191FF"><b><div align="center"><strong><font color="#FFFFFF">Location</font></strong></div></b></td>';
        echo '</tr>'."\n";
    // lecture et affichage des résultats , 1 résultat par ligne
 


   
    while($row = mysql_fetch_array($result)) {
     
        echo '<td >'.$row['type'].'</td>';
    echo '<td >'.$row['reference'].'</td>';
    echo '<td >'.$row['nserie'].'</td>';  //
    echo '<td >'.$row['marque'].'</td>';
    echo '<td >'.$row['model'].'</td>';
        echo '<td >'.$row['annee'].'</td>';
    echo '<td >'.$row['capacite'].'</td>';
    echo '<td >'.$row['energie'].'</td>';
    echo '<td >'.$row['typemat'].'</td>';
    echo '<td >'.$row['valve'].'</td>';
        echo '<td >'.$row['volt'].'</td>';
    echo '<td >'.$row['location'].'</td>';
    echo "</tr>";
    }
    echo '</table id=tableau>'."\n";
    // fin du tableau.
  //
}
else echo 'Pas d\'enregistrements correspondant a votre recherche';
 ?>

     SI NON AVECJAVASCRIPT PAS DE PROBLEME MAIS JE PREFERE RESOUDRE LE PROBLEME AVEC PHP
   

#13 Re : Forum Général PHP » recup_id et onclick » 27-04-2010 14:43:56

J'essaye d'eviter au maximum javascript est ce possible?

#14 Re : Forum Général PHP » recup_id et onclick » 27-04-2010 14:43:56

MERCI DE VOTRE REPONSE ,le  fichier appele par onclick est bien afficher mais je veux savoir  comment recuperer la valeur d'un champs selectionner et le transmettre a ce fichier

#15 Forum Général PHP » recup_id et onclick » 27-04-2010 14:43:56

SAAD207
Réponses : 10

apres plusieurs recherche je suis bloquer et je viens ici demander aide;j'ai un tableau cree dynamiquement suite a une requete php lorsque je clique sur une ligne je dois recuperer la valeur d'un champs appelé reference et l'envoyer vers une autre page et la je suis coincé je suis debutant en php et je demande votre aide
et j'envois la portion du code sur laquelle je dois je pense utiliser recuper_id et au besoin j'envois la totalité du code MERCI DE VOTRE AIDE


 $gris = false;  
    while($row = mysql_fetch_array($result)) {
      if ($gris) $gris=false; else $gris=true;  
            if ($gris) {echo "<tr bgcolor='#E8E8E8'  onclick=location.href='ficheupdate2.php'  style=\"cursor:pointer;\"  onMouseover=\"this.style.backgroundColor='#99FF99'\"  onmouseOut=\"this.style.backgroundColor=''\" >";}
      else {echo "<tr bgcolor='#F8F8F8'    onclick=location.href='ficheupdate2.php'  style=\"cursor:pointer;\" onMouseover=\"this.style.backgroundColor='#99FF99'\"  onmouseOut=\"this.style.backgroundColor=''\"> ";}
 

#17 Re : Forum Général PHP » PROBLEME ONCLICK » 23-04-2010 17:09:40

OUI c'est corrigé;
Parse error: syntax error, unexpected '=' in C:\PERSONNEL\EasyPHP-5.3.2\www\search1.php on line 76

#18 Re : Forum Général PHP » PROBLEME ONCLICK » 23-04-2010 17:09:40


<?php require_once('Connections/enqf.php'); ?>
<?php
//
if (isset($_POST['type'])) $avance_type = $_POST['type'];
if (isset($_POST['reference'])) $avance_reference = $_POST['reference'];
if (isset($_POST['capacite'])) $avance_capacite = $_POST['capacite'];
if (isset($_POST['energie'])) $avance_energie = $_POST['energie'];
if (isset($_POST['marque'])) $avance_marque = $_POST['marque'];
if (isset($_POST['annee'])) $avance_annee = $_POST['annee'];
if (isset($_POST['nserie'])) $avance_nserie = $_POST['nserie'];
if (isset($_POST['valve'])) $avance_valve = $_POST['valve'];
if (isset($_POST['location'])) $avance_location = $_POST['location'];
if (isset($_POST['model'])) $avance_model = $_POST['model'];
if (isset($_POST['volt'])) $avance_volt = $_POST['volt'];
if (isset($_POST['typemat'])) $avance_typemat = $_POST['typemat'];
mysql_connect("127.0.0.1","root","");
mysql_select_db ("enaf");
$select ="SELECT * FROM infos_tbl WHERE   type LIKE '%$avance_type%' AND  location LIKE '%$avance_location%'   AND marque LIKE '%$avance_marque%'  AND volt LIKE '%$avance_volt%' AND annee LIKE '%$avance_annee%' AND capacite LIKE '%$avance_capacite%' AND energie LIKE '%$avance_energie%' AND reference LIKE '%$avance_reference%' AND nserie LIKE '%$avance_nserie%' AND model LIKE '%$avance_model%' AND valve LIKE '%$avance_valve%' AND  typemat LIKE '%$avance_typemat%' ";
$result=mysql_query($select)  or die(mysql_error());
$total = mysql_num_rows($result);
 mysql_close();
?>
<table width="100%"  border="0">
  <tr>
    <td width="1%" height="102"> </td>
    <td width="33%" bgcolor="#FFFFFF"><div align="right"><img src="logo.JPG" width="256" height="89"></div></td>
    <td width="47%"><p> </p>
    <table width="353" border="0" bordercolor="#0000FF" bgcolor="#0000FF">
      <tr>
        <td bgcolor="#FFFFFF"> <div align="center"><strong> Articles répondants aux critères recherchés </strong></div></td>
      </tr>
    </table>    </td>
    <td width="19%"> <table width="100%"  border="0">
      <tr>
        <td nowrap bgcolor="#FFFFFF"><div align="right"> </div></td>
        <td bordercolor="#FF0000" bgcolor="#FFFFFF">  </td>
      </tr>
    </table>
    <div align="left">
      <p>Nombre<span class="Style1">:<?php echo $total ?></span></p>
      </div></td>
  </tr>
</table>
<table width="100%" border="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
  <tr>
    <td height="1" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> </td>
  </tr>
</table>
<table width="80%"  border="1" align="center" cellspacing="1" bordercolor="#0000FF" bgcolor="#ffffff">
  <tr>
    <td align="center" valign="middle" bordercolor="#FFFFFF" bgcolor="#FFFFFF"><div align="center">
  <link rel="stylesheet" href="2col_rightNav.css" charset="ISO-8859-1" type="text/css"/>
  <?php
 if($total) {
   // début du tableau
    echo '<table>'."\n";
        // affichage
        echo '<tr >';
    echo '<td bgcolor="#3737FF"><b><div align="center"><strong><font color="#FFFFFF"><strong>id</strong></font></strong></div></b></td>';    //<td><div align="center">ok</div></td>
        echo '<td bgcolor="#3737FF"><b><div align="center"><strong><font color="#FFFFFF"><strong>Type</strong></font></strong></div></b></td>';    //<td><div align="center">ok</div></td>
    echo '<td bgcolor="#3737FF"><b><div align="center"><strong><font color="#FFFFFF"><strong>Reference</strong></font></strong></div></b></td>';
    echo '<td bgcolor="#3737FF"><b><div align="center"><strong><font color="#FFFFFF">Nserie</font></strong></div></b></td>';
    echo '<td bgcolor="#3737FF"><b><div align="center"><strong><font color="#FFFFFF">Marque</font></strong></div></b></td>';
    echo '<td bgcolor="#3737FF"><b><div align="center"><strong><font color="#FFFFFF">Model</font></strong></div></b></td>';
        echo '<td bgcolor="#3737FF"><b><div align="center"><strong><font color="#FFFFFF">Annee</font></strong></div></b></td>';
    echo '<td bgcolor="#3737FF"><b><div align="center"><strong><font color="#FFFFFF">Capacite</font></strong></div></b></td>';
    echo '<td bgcolor="#3737FF"><b><div align="center"><strong><font color="#FFFFFF">Energie</font></strong></div></b></td>';
    echo '<td bgcolor="#3737FF"><b><div align="center"><strong><font color="#FFFFFF">Typemat</font></strong></div></b></td>';
    echo '<td bgcolor="#3737FF"><b><div align="center"><strong><font color="#FFFFFF">Valve</font></strong></div></b></td>';
        echo '<td bgcolor="#3737FF"><b><div align="center"><strong><font color="#FFFFFF">Volt</font></strong></div></b></td>';
    echo '<td bgcolor="#3737FF"><b><div align="center"><strong><font color="#FFFFFF">Location</font></strong></div></b></td>';
        echo '</tr>'."\n";
    // lecture et affichage des résultats , 1 résultat par ligne

  function recup_id()
  {location.href=('update2.php?id='+id); }
 
  $gris = false;  
    while($row = mysql_fetch_array($result)) {
      if ($gris) $gris=false; else $gris=true;  
          if ($gris) {
        echo "<tr bgcolor='#E8E8E8' onclick=""\"'.recup_id($row['id']).'"\" style=\"cursor:pointer;\"  onMouseover=\"this.style.backgroundColor='#99FF99'\"  onmouseOut=\"this.style.backgroundColor=''\" >";}
      else {
      echo "<tr bgcolor='#F8F8F8' onclick="\"'.recup_id($row['id']).'"\"  style=\"cursor:pointer;\"  onMouseover=\"this.style.backgroundColor='#99FF99'\"  onmouseOut=\"this.style.backgroundColor=''\"> ";}
    echo '<td >'.$row['id'].'</td>';
        echo '<td >'.$row['type'].'</td>';
    echo '<td >'.$row['reference'].'</td>';
    echo '<td >'.$row['nserie'].'</td>';
    echo '<td >'.$row['marque'].'</td>';
    echo '<td >'.$row['model'].'</td>';
        echo '<td >'.$row['annee'].'</td>';
    echo '<td >'.$row['capacite'].'</td>';
    echo '<td >'.$row['energie'].'</td>';
    echo '<td >'.$row['typemat'].'</td>';
    echo '<td >'.$row['valve'].'</td>';
        echo '<td >'.$row['volt'].'</td>';
    echo '<td >'.$row['location'].'</td>';
    echo "</tr>";
    }
    echo '</div></table id=tableau>'."\n";
    // fin du tableau.
  //
}
else echo 'Pas d\'enregistrements correspondant a votre recherche';
 ?>

    <p> </p>
   
  </div></table>
 

#19 Re : Forum Général PHP » PROBLEME ONCLICK » 23-04-2010 17:09:40

DESOLE de tout ce derangement en effet il ya a peine 10jours que j'ai commencer a bidouiller avec le php je dois retourner apprendre un peu le cours
merci pour votre aide

#20 Re : Forum Général PHP » PROBLEME ONCLICK » 23-04-2010 17:09:40

portion de code /

    function recup_id()
  {location.href=('update2.php?id='+id); }

    $gris = false;   
    while($row = mysql_fetch_array($result)) {
            if ($gris) $gris=false; else $gris=true;   
                    if ($gris) {
              echo "<tr bgcolor='#E8E8E8' onclick=""\"<?php lafonctionici ;?>"\" style=\"cursor:pointer;\"  onMouseover=\"this.style.backgroundColor='#99FF99'\"  onmouseOut=\"this.style.backgroundColor=''\" >";}
            else {
            echo "<tr bgcolor='#F8F8F8' onclick="\<?php lafonction ;?>"\"  style=\"cursor:pointer;\"  onMouseover=\"this.style.backgroundColor='#99FF99'\"  onmouseOut=\"this.style.backgroundColor=''\"> ";}

#21 Re : Forum Général PHP » PROBLEME ONCLICK » 23-04-2010 17:09:40

merci ALNOSS pour ton complement concernant le chariot, cependant je suis toujours bloquer pour mon prb

#22 Re : Forum Général PHP » PROBLEME ONCLICK » 23-04-2010 17:09:40

je vous refile le code entier et essaye de me dire ou je dois inserer votre ligne:
1.onclick="<?php echo recup_id('.$row['id'].');?>";

voila mon code [NdM : Supprimé pour la lisibilité car reprends le meme code qu'au premier post]

#23 Re : Forum Général PHP » PROBLEME ONCLICK » 23-04-2010 17:09:40

je suis debutant et j'aimerai bien desactivé le java mais est ce que je peut m'ensortir avec le seul  php? je teste ton code et je te repond tout de suite merci

#24 Re : Forum Général PHP » PROBLEME ONCLICK » 23-04-2010 17:09:40

je suis tjs bloqué:
function recup_id(id)
{ location.href=('update2.php?id='+id); }

onclick="recup_id('<?php echo $row['id'];?>')"


MAIS CA DONNE RIEN

Pied de page des forums

Propulsé par FluxBB