eyexro Posted January 14, 2012 Report Posted January 14, 2012 daca am codul <select><option>Alba-Iulia</option><option>Bucuresti</option><option>Cluj</option></select>cum fac ca in scriptul de comanda <form action="comanda/trimite.php" method="post">...... </form>sa imi afiseze si rezultatul acestui "SELECT" ? Quote
aelius Posted January 14, 2012 Report Posted January 14, 2012 In html:<form action="comanda/trimite.php" method="post"><select id="oras"> <option value="Alba-Iulia">Alba-Iulia</option> <option value="Bucuresti">Bucuresti</option> <option value="Cluj">Cluj</option></select></form>In 'comanda/trimite.php':<?php echo $_POST['oras'];?>ps: este doar un exemplu minimal. mare atentie la variabile, in special daca lucrezi cu interogari db. Quote
eyexro Posted January 14, 2012 Author Report Posted January 14, 2012 (edited) multumesc pentru raspuns , si nu este ceva simplu .. e o firma de promvoare si vreau sa aflu pachetul inca nu le am cu conexiunile.. p.s - daca ai niste tutoriale si poti sa imi dai si mie un link prin PM , raman dator//edit.. nu pot introduce in trimite pentru ca tot e un cod php si intra intre<?php?>....Parse error: syntax error, unexpected '<' in /.../..../..../comanda/trimite.php on line 6 Edited January 14, 2012 by eyexro Quote
aelius Posted January 14, 2012 Report Posted January 14, 2012 Pai pune doar " echo $_POST['oras'];" Eu am specificat tag-urile pentru a intelege exemplul. Daca le ai deja sau mai ai si alte astea in script, nu le mai pune iar. Quote
eyexro Posted January 20, 2012 Author Report Posted January 20, 2012 ceva tot gresesc eu...am asa in index.html<select id="pachet"><option>SEO 120</option><option>SEO 240</option><option>SEO 360</option><option>Anunturi #1</option><option>Anunturi #2</option><option>Anunturi #3</option><option>Design #1</option><option>Design #2</option><option>Design #3</option></select><br>iar in trimite.php .. am adaugat { echo $_POST['pachet'];}fata <?php si ?> si tot nu apare... Quote
aelius Posted January 20, 2012 Report Posted January 20, 2012 option value= ......... vezi in postul de mai sus. Quote
eyexro Posted January 20, 2012 Author Report Posted January 20, 2012 <select id="pachet"> <option value="Seo120">Seo120</option> <option value="Seo240">Seo240</option> <option value="Seo360">Seo360</option> <option value="Anunturi#1">Anunturi#1</option> <option value="Anunturi#2">Anunturi#2</option> <option value="Anunturi#3">Anunturi#3</option> <option value="Design#3">Design#3</option> <option value="Design#3">Design#3</option> <option value="Design#3">Design#3</option></select><br> si nimic.. e pus..toate info le primesc mai putin raspunsul la acel "quiz"... Quote
DarkyAngel Posted January 20, 2012 Report Posted January 20, 2012 Încearc? ?i cu :if(isset($_POST['pachet'])){ $pachett = $_POST['pachet']; echo $pachett;}else {echo "Nu ai selectat nimic";} Quote
eyexro Posted January 20, 2012 Author Report Posted January 20, 2012 (edited) fara rezultat.. dar alta optiune ca sa ii pun sa aleaga una din ele.. fara sa umplu content ... nu este ? Edited January 20, 2012 by eyexro Quote
DarkyAngel Posted January 20, 2012 Report Posted January 20, 2012 fara rezultat.. dar alta optiune ca sa ii pun sa aleaga o optiune ... nu este ?WTF, din poz? eu v?d c? tu ai FORM în FORM, e ?i normal s? nu trimit?, ?terge unul dintre FORM-uri.. Quote
daatdraqq Posted January 20, 2012 Report Posted January 20, 2012 p.s - daca ai niste tutoriale si poti sa imi dai si mie un link prin PM , raman datorPentru PHP Tutorial PHP - Initiere in PHP & MySQL in limba romana Quote
eyexro Posted January 20, 2012 Author Report Posted January 20, 2012 el trimite.. doar partea astea nu merge cu select Quote
DarkyAngel Posted January 20, 2012 Report Posted January 20, 2012 el trimite.. doar partea astea nu merge cu selectScoate al 2-lea FORM, ce nu în?elegi ? între tagurile <FORM ...> </FORM> nu trebuie s? existe ALT <FORM ..></FORM>, altfel , con?inutul din cel de-al 2-lea nu-l trimite, ?i asta e ?i problema ta. Quote
AhEaD Posted January 20, 2012 Report Posted January 20, 2012 TRIPPLE FACEPALM!Coaie... e HTML nu e bomba nucleara ! ! ! ! ! ! ! ! !Google + w3 schools iti dadea raspunsu instant....Cat despre html invata mai intai tagurile principale <html><head></head><body></body></html>Cum plm vrei sa faci un form daca tu nu stii nici lucrurile de baza ? Quote