leisure Posted July 13, 2005 Report Share Posted July 13, 2005 Izdariiju taadu lietu, kaa, kad aizpildot formu, nospiezhot submit pogu caur POST metodi padodu mainiigos, izdariiju shaadu rindinju: $post_data = $_POST; if( !is_array($post_data) ) { die(); } taga kaa buutu eertaakais veids kaa paarbaudiit, vai kaads no $post_data elementiem nawa tuk6? Link to comment Share on other sites More sharing options...
bubu Posted July 13, 2005 Report Share Posted July 13, 2005 $_POST vienmēr būs masīvs! tādai pārbaudei, kā tu uzrakstīji nav jēgas. Var piemēram, pārbaudīt vai $_POST masīvā ir vispār kāds elements (tb vai tas nav tukšs: if (count($_POST)==0) { //ir tukšs (nav padoti nekādi dati ... } Bet ja gribi pārbaudīt vai kāds elements nav tukšs tad laikam nāksies šādi: foreach($_POST as $x) { if ($x=="") { // kautkāds elements ir tukšs ... } } Link to comment Share on other sites More sharing options...
leisure Posted July 13, 2005 Author Report Share Posted July 13, 2005 Brilliant, Paldies! :) Nju oki tad to es njemu araa... Vispabaa es tur taisu registraacijas failu unj vai tas kaa es to daru ir ieteicams, ka es izmantoju tur savu $post_data...? pirmaa rindinja ir shaada: if( isset($_POST['reg_form'] && eregi('www.mans_urls.lv', $_SERVER['HTTP_REFERER']) { ... } Taaa ir ok? Vai iesaki ko labaaku (profesionaalaaku) ? Link to comment Share on other sites More sharing options...
bubu Posted July 13, 2005 Report Share Posted July 13, 2005 Nelietot regexpus, kur tos nevajag. if (isset($_POST['reg_form']) && strpos($_SERVER['HTTP_REFERER'], 'www.mans_urls.lv')!== false) Link to comment Share on other sites More sharing options...
Recommended Posts