Tevocis Posted April 27, 2013 Report Share Posted April 27, 2013 (edited) veidoju failu ar kuru lietotajs var izmainit savu info piemeram vardu epastu u.t.t bet nezin kāpec nedarbojaas itka tur kur es to vsu ar echo izmetu ara ari vis ir ta ka vajag bet lidz datubaazei ta ari netiek. varbut varat palidzet parabaudiju ar dažiem validatoriem bet vis itka okay. <?php $vards = $_POST['vards']; $uzvards = $_POST['uzvards']; $vecums = $_POST['vecums']; $bilde = $_POST['bilde']; $epasts = $_POST['epasts']; $id = $_SESSION['Memberid']; echo "UPDATE members SET Username='$vards',uzvards='$uzvards',Vecums='$vecums',bilde='$bilde',Email='$epasts' WHERE Memberid = '$id' "; if(isset($_POST['submit'])) { mysql_query("UPDATE members SET Username='$vards',uzvards='$uzvards',Vecums='$vecums',bilde='$bilde',Email='$epasts' WHERE Memberid = '$id' ") or die('Neizdevas labot tavu profilu!!!'); echo 'Profils veiksmigi labots'; header("location: index.php"); } ?> <form action="" method="post"> <ul> <li> Vārds: <br> <input type="text" id="vards" name="vards" value="<?php echo $_SESSION['Username'] ; ?>"> </li> <li> Uzvārds: <br> <input type="text" id="uzvards" name="uzvards" value="<?php echo $_SESSION['uzvards'] ; ?>"> </li> <li> Vecums: <br> <input type="text" id="vecums" name="vecums" value="<?php echo $_SESSION['Vecums'] ; ?>"> </li> <li> Bilde: <br> <input type="text" id="bilde" name="bilde" value="<?php echo $_SESSION['bilde'] ; ?>"> </li> <li> E-Pasts: <br> <input type="text" id="epasts" name="epasts" value="<?php echo $_SESSION['Email'] ; ?>"> </li> <li> <INPUT type="submit" class="btn btn-primary" tabindex="3"> </li> </ul> </form> Edited April 27, 2013 by Tevocis Quote Link to comment Share on other sites More sharing options...
404 Posted April 27, 2013 Report Share Posted April 27, 2013 lai visi interneta dievi stav klat tam klientam kurs reiz iegadasies so risinajumu bet par lietotaja pusi saja gadijuma nav jauztraucas jo lietotaji pasi viens otra datus pielabos pec vajadzibas kad padosi post datos ari id bet par problemas aprakstu vis ir ta ka vajag bet lidz datubaazei ta ari netiek visticamak ir saistits ar nepilnibām skripta!!! Quote Link to comment Share on other sites More sharing options...
Tevocis Posted April 27, 2013 Author Report Share Posted April 27, 2013 nuuu nevar but nepilniba jo datus izvelk ta ka man to vajag bet kad prasu lai to visu updeito uz jaunu infu tad to neizdara es prasu ko man vajadzeetu dairit nevis gudrus textus nevajag ari gatavu risinajumu.un kodu parskatiju vairakas reizes kļudas itka nav Quote Link to comment Share on other sites More sharing options...
404 Posted April 27, 2013 Report Share Posted April 27, 2013 Nu visadi gadas man ta bija ka prasiju updeitot bet nedara man teica ka update kverijam ir jabut pareiza formata un jadebugo googlejot pec piemeriem var atrast kludu bet ja saki ir ok tad jaraksta mysql supportam ticketu ^^ Quote Link to comment Share on other sites More sharing options...
Tevocis Posted April 27, 2013 Author Report Share Posted April 27, 2013 tur jau ta lieta ja es to kveriju izmetu ar echo ara zem visa man info izmet taadu kurs darbojas ieks pasa phpmyadmin bet no konkreeta faila uz prieksu nepadod Quote Link to comment Share on other sites More sharing options...
anonīms Posted April 28, 2013 Report Share Posted April 28, 2013 jēga no echo, ja pēc tam uzreiz ir header's? Quote Link to comment Share on other sites More sharing options...
nikidijs Posted April 28, 2013 Report Share Posted April 28, 2013 Moš tam pēdējam input'am arī iešķieb kādu name. Citiem elementiem esi iedevis, bet pēdējo nabagu apdalijis. šķiet, ka tas pats name="submit" bus tīri labs :) Quote Link to comment Share on other sites More sharing options...
draugz Posted April 29, 2013 Report Share Posted April 29, 2013 Pamēģini, visiem saglabājamiem datiem sākumā šādi. $vards = $_POST['vards']; Aiztāt ar $vards = mysql_real_escape_string( $_POST['vards'] ); Un, ja parādīsies kaut kāds exception vai error, tas nozīmē, ka tev nav aktīvas mysql konecijas (mysql_connect ); Quote Link to comment Share on other sites More sharing options...
Val Posted April 30, 2013 Report Share Posted April 30, 2013 piemeram nezin kāpec nedarbojaas itka varbut kļudas itka nav okay[/color]kas nedarbojas? saglabā post datus, bet attēlo sesiju? Quote Link to comment Share on other sites More sharing options...
Tevocis Posted May 2, 2013 Author Report Share Posted May 2, 2013 (edited) amm vis darbojas datus izvelk ta ka vaja. bet tad kad spiež pogu submit man neaiziet uz datubāzi jaunais info. atrisinaju problemu ar to ka ieliku iekš submit ari name="submit" Edited May 2, 2013 by Tevocis Quote Link to comment Share on other sites More sharing options...
gurudev Posted May 2, 2013 Report Share Posted May 2, 2013 Pag, pag, kur ir savienojums ar datubāzi? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.