Bonjour,
Bonjour,
j'ai deja posté auparavant pour ce probleme encore inresolu j'ai cherché pendant des jours en vain.... voici mon probleme apres mon code je veut faire une redirection automatique que j'ai mis en gras ds mon code presentement j'en ai une mais je doit passer par un bouton intermediaire je veut envoyer ma variable par l'url ou autres facon j'ai essayé la fonction header mais elle ne fonctionne pas
donc la question est comment faire une redirection automatique
voici mon code
<div id="publicite">
<p align="center">Publicité</p></div>
<p>*REQUIS</p>
<?
//connextion a la base de donnee
mysql_connect('localhost', 'aaa', 'aaaaa');
mysql_select_db("aaaaa37_auto");
$id = $_GET['id']; // recuperation de l'id a modifier
if(is_numeric($id) && $id) {
$sql="SELECT * FROM alouernonpubliee WHERE id='$id';";
$req=mysql_query($sql) or die(mysql_error());
while($row=mysql_fetch_array($req)) {
$id=$row['id']; $typedannonce=$row['typedannonce']; $marque=$row['marque']; $autres=$row['autres']; $modele=$row['modele']; $prix=$row['prix']; $annee=$row['annee']; $carburant=$row['carburant']; $climatisation=$row['climatisation']; $audio=$row['audio']; $telephone=$row['telephone']; $email=$row['email']; $message=$row['message'];
}
}
if(isset($_POST['envoyer'])) {
$typedannonce=$_POST['typedannonce'];
$marque=$_POST['marque'];
$autres=$_POST['autres'];
$modele=$_POST['modele'];
if($_POST['prix'] == null){
$prix = "S/O";
} else {
$prix = $_POST['prix'];
}
$annee=$_POST['annee'];
if($_POST['carburant'] == null){
$carburant = "S/O";
} else {
$carburant = $_POST['carburant'];
}
if($_POST['climatisation'] == null){
$climatisation = "S/O";
} else {
$climatisation = $_POST['climatisation'];
}
if($_POST['audio'] == null){
$audio = "S/O";
} else {
$audio = $_POST['audio'];
}
if($_POST['telephone'] == null){
$telephone = "S/O";
} else {
$telephone = $_POST['telephone'];
}
$email=$_POST['email'];
$message=$_POST['message'];
$date= date('d-m-Y');
$i=0; $v=0; for($j=0; $j<5; $j++) { $image[$j]=''; $fn[$j]=''; }
for($nbi=1; $nbi<=5; $nbi++) {
if(!empty($_FILES['image'.$nbi]['tmp_name'])) { $image[$i]=$_FILES['image'.$nbi]; $i++; }
}
//AJOUT DES IMAGES
for($j=0; $j<$i; $j++) {
list($width, $height, $type, $attr)=getimagesize($image[$j]['tmp_name']);
if($image[$j]['size']>524288 && !$image[$j]['error']) { $error="un fichier ne dépassant pas 500ko!!"; }
if(empty($error)) {
unlink('photos/alouernp/'.$id.'-'.$v.'.jpg');
if(move_uploaded_file($image[$j]['tmp_name'], '/home/auto7837/public_html/photos/alouernp/'.$id.'-'.$v.'.jpg')) {
$fn[$v]=$id.'-'.$v.'.jpg';
$v++;
}
unset($image[$j]['tmp_name']);
}
}
//on modifie les images la requete
$sql= "UPDATE alouernonpubliee SET typedannonce='{$typedannonce}', marque='{$marque}', autres='{$autres}', modele='{$modele}', prix='{$prix}', annee='{$annee}', carburant='{$carburant}', climatisation='{$climatisation}', audio='{$audio}', telephone='{$telephone}', email='{$email}', message='{$message}', image1='{$fn[0]}', image2='{$fn[1]}', image3='{$fn[2]}', image4='{$fn[3]}', image5='{$fn[4]}' WHERE id='{$id}';";;
mysql_query($sql) or die(mysql_error());
echo "cliquez ici pour visualiser votre annonce<a>" ;
echo " <form action='alouerprevisualisation1.php' method='post'>
<input type='submit' value='envoyer'>
<input type='hidden' name='id' value='$id'></form>";
}
else{
?>
<form id="form_id" name="form_id" method="post" enctype="multipart/form-data" action="" onsubmit="return veriForm();" />
<input type="hidden" name="form_id" value="form_id" />
<table border="0" cellpadding="2" cellspacing="2">
<tr>
<td width="226" valign="top">*Type D'annonce :</td>
<td width="467"><p>
<input type="text" size="20" name="id" style="display:none" value="<?=$id;?>" />
<label>
<input type="radio" name="typedannonce" value="Je loue" id="typedannonce_0" <? if ($typedannonce == "Je loue") echo "checked";?> />
Je loue</label>
<br />
<label>
<input type="radio" name="typedannonce" value="Je cherche" id="typedannonce_1" <? if ($typedannonce == "Je cherche") echo "checked";?>/>
Je cherche</label>
<br />
</p></td>
</tr>
<tr>
<td>Téléphone:</td>
<td><label for="telephone"></label>
<input type="text" name="telephone" size="20" value="<?=$telephone;?>" /></td>
</tr>
<tr>
<td>*Email</td>
<td><label for="email"></label>
<input type="text" name="email" size="20" value="<?=$email;?>" /></td>
</tr>
<tr>
<td>*Marque (si autre veuillez préciser):</td><td><select onchange="if(this.selectedIndex == 65) document.getElementById('autres').style.display = 'block';
else document.getElementById('autres').style.display = 'none';" name="marque">
<option>Sélectionnez</option>
<option <? if ($marque == "Acura") echo "selected";?>>Acura</option>
<option <? if ($marque == "Alfa Romeo") echo "selected";?>>Alfa Romeo</option>
<option <? if ($marque == "AMC") echo "selected";?>>AMC</option>
<option <? if ($marque == "Aston Martin") echo "selected";?>>Aston Martin</option>
<option <? if ($marque == "Audi") echo "selected";?>>Audi</option>
<option <? if ($marque == "Bentley") echo "selected";?>>Bentley</option>
<option <? if ($marque == "BMW") echo "selected";?>>BMW</option>
<option <? if ($marque == "Bugatti") echo "selected";?>>Bugatti</option>
<option <? if ($marque == "Buick") echo "selected";?>>Buick</option>
<option <? if ($marque == "Cadillac") echo "selected";?>>Cadillac</option>
<option <? if ($marque == "Chevrolet") echo "selected";?>>Chevrolet</option>
<option <? if ($marque == "Chysler") echo "selected";?>>Chrysler</option>
<option <? if ($marque == "Daewoo") echo "selected";?>>Daewoo</option>
<option <? if ($marque == "Daihatsu") echo "selected";?>>Daihatsu</option>
<option <? if ($marque == "Datsun") echo "selected";?>>Datsun</option>
<option <? if ($marque == "Dodge") echo "selected";?>>Dodge</option>
<option <? if ($marque == "Eagle") echo "selected";?>>Eagle</option>
<option <? if ($marque == "Ferrari") echo "selected";?>>Ferrari</option>
<option <? if ($marque == "Fiat") echo "selected";?>>Fiat</option>
<option <? if ($marque == "Ford") echo "selected";?>>Ford</option>
<option <? if ($marque == "Geo") echo "selected";?>>Geo</option>
<option <? if ($marque == "GMC") echo "selected";?>>GMC</option>
<option <? if ($marque == "Honda") echo "selected";?>>Honda</option>
<option <? if ($marque == "Hummer") echo "selected";?>>Hummer</option>
<option <? if ($marque == "Hyundai") echo "selected";?>>Hyundai</option>
<option <? if ($marque == "International Harvester") echo "selected";?>>International Harvester</option>
<option <? if ($marque == "Isuzu") echo "selected";?>>Isuzu</option>
<option <? if ($marque == "Jaguar") echo "selected";?>>Jaguar</option>
<option <? if ($marque == "Jeep") echo "selected";?>>Jeep</option>
<option <? if ($marque == "Kia") echo "selected";?>>Kia</option>
<option <? if ($marque == "Lamborghini") echo "selected";?>>Lamborghini</option>
<option <? if ($marque == "Land Rover") echo "selected";?>>Land Rover</option>
<option <? if ($marque == "Lexus") echo "selected";?>>Lexus</option>
<option <? if ($marque == "Lincoln") echo "selected";?>>Lincoln</option>
<option <? if ($marque == "Lotus") echo "selected";?>>Lotus</option>
<option <? if ($marque == "Maserati") echo "selected";?>>Maserati</option>
<option <? if ($marque == "Maybach") echo "selected";?>>Maybach</option>
......
je ne peut ecrire la suite c est trop long :)
Afficher la suite
11 août 2010 à 22:20
12 août 2010 à 21:36
Tu place en haut de page, dnas l'en tete de page.
Refresh te raffraichi la page, et t'envoi a http://tonadresse.fr
Bon courage !