Henshu Posted August 19, 2005 Report Share Posted August 19, 2005 Probleema taada, ka vaidzeetu dabuut, lai _get sadalaas pa vaardiem. Piem pieprasiijuma linkaa manam skriptam ir http://www.kautkas.lv/skripts.php?nezkas=j...20uz%20kruumiem Vai kaads vareetu pateikt kaa katru shii teikuma vaardu paarveidot par atsevishkji variabli? $visikopaa = $_get(nezkas); $var1 = $_get(jaanis); $var2 = $_get(iet); $var3 = $_get(uz); $var4 = $_get(kruumiem); Apmeeram kautkaa taa. Cerams ka saprataat domu. Vienk nekaadi nevaru izshtukot kaa to dabuut gatavu. Zinaashanas un exp pa vaaju vel pagaidaam :) Mosh kaads var izpaliidzeet? Link to comment Share on other sites More sharing options...
bubu Posted August 19, 2005 Report Share Posted August 19, 2005 $visikopaa = $_GET['nezkas']; $vars = explode(' ', $visikopaa); // tagad $vars[0] == 'jaanis' // $vars[1] == 'iet' // ... Atstarpes URLī btw ir ļoti ieteicams nelietot, bet tā vietā likt %20. php galā tās automātiski pārkonvertēsies uz atstarpju simboliem. Link to comment Share on other sites More sharing options...
Henshu Posted August 19, 2005 Author Report Share Posted August 19, 2005 bubu, milziigs Tev paldies! Viss sanaaca :) esmu tagad paarlaimiigi laimiigs. Link to comment Share on other sites More sharing options...
Henshu Posted August 23, 2005 Author Report Share Posted August 23, 2005 bubu, viena maza probleeminja palikusi sakaraa ar sho. ja piemeeram $var1 = $_get(jaanis); un pieprasiijumaa ?jaanis=janka' tad echo izvada janka kaa janka\' nevis janka' liidz ar to sanaak nepareiza atbilde uz pieprasiijumu :( kaa to vareetu izlabot? Link to comment Share on other sites More sharing options...
bubu Posted August 23, 2005 Report Share Posted August 23, 2005 php.ini failā magic_quotes_gpc uzstādi uz Off Link to comment Share on other sites More sharing options...
Henshu Posted August 23, 2005 Author Report Share Posted August 23, 2005 paldies, bubu :) echo sanaaca :( tagad tikai probleema ar mysql, jo es tos varus lieku kaa mysql insert utt nu ieksh datubaazes. pirms tam bij taa ka izvadiijaas nepareizs echo un http_post_vars tb atbilde bet datubaazee ielikaas pareizi, a tagad raada: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'jaanis','iet','uz','kruumiem')' at line 2 varbuut var uztaisiit kautkaa lai pareizi atpaziist gan tur gan tur? Link to comment Share on other sites More sharing options...
Henshu Posted August 23, 2005 Author Report Share Posted August 23, 2005 tagad php.ini staav magic_quotes_gpc On On magic_quotes_runtimeOff Off magic_quotes_sybase Off Off Link to comment Share on other sites More sharing options...
Aleksandrs Posted August 23, 2005 Report Share Posted August 23, 2005 Cits jautājums... Ja ir nepieciešams atdalīt pirmās atstarpes un pārējās sakopot. Piemēram: Vārds, uzvārds un cita info. Citi dati var saturēt vairākas atstarpes, bet jābūt vienā vērtībā tiem citi dati. Risinājums: $other_info= ''; for($i=2; $i<count($vars); $i++){ $other_data.=$vars[$i].' '; } echo $other_info; Varbūt ir labāks risinājums? Link to comment Share on other sites More sharing options...
bubu Posted August 23, 2005 Report Share Posted August 23, 2005 varbuut var uztaisiit kautkaa lai pareizi atpaziist gan tur gan tur? 21384[/snapback] Insert teikums veido šādā veidā: $query = 'INSERT INTO table (col1, col2) VALUES ("'.mysql_escape($_GET['variable1']).'", "'.mysql_escape($_GET['variable2']).'")'; Aleksandrs: skaties uz funkcijām implode() un array_slice() Link to comment Share on other sites More sharing options...
Recommended Posts