Leverkusen Posted March 22, 2014 Share Posted March 22, 2014 When i post, get white page fo no reason, what could be the problem? <?php // upis para if($_POST['tim1']!="" and $_POST['tim2']!="" and $_POST['tip']!="" and $_POST['kvota']!="" and $_POST['link']!=""){ $racun=$_SESSION['liga_user_id']; $result = mysql_query("select * from clanovi_njihovi_racuni where id='$racun';"); $row = mysql_fetch_array($result); $klikovi = $row['klikovi']; $tim1=str_ireplace(array("\"","'","<",">"),"",$_POST['tim1']); $tim2=str_ireplace(array("\"","'","<",">"),"",$_POST['tim2']); $tip=str_ireplace(array("\"","'","<",">"),"",$_POST['tip']); $kvota=str_ireplace(array(","),".",$_POST['kvota']); $link=$_POST['link']; $ip=$_SERVER['REMOTE_ADDR']; $tim1=strtolower($tim1);$tim1=ucwords($tim1); $tim2=strtolower($tim2);$tim2=ucwords($tim2); $link=str_ireplace(" ","",$link); $prvoslovo=str_ireplace("http://www.flashscore.com/","#",$link); $linkDozvola=0; $broj_po_danu = 9; $datum=curdate(); $select = mysql_query("SELECT racun FROM clanovi_njihovi_racuni WHERE datum_unosa='$datum'"); if(mysql_num_rows($select) == $broj_po_danu){ echo 'Postignut maksimalni broj parova u danu'; } else { if($prvoslovo[0]=="#")$linkDozvola=1; if($linkDozvola==1 and $kvota>1 and $kvota<100){ $result = mysql_query("insert into clanovi_njihovi_parovi set racun='$racun',ip='$ip',datum=curdate(),vrijeme=curtime(),tim1='$tim1',tim2='$tim2', tip='$tip', kvota='$kvota',link='$link';"); } else if($linkDozvola==0)echo "<script>alert('Vas link je neispravan. Link utakmice kopirajte sa www.flashscore.com .')</script>"; else if($kvota<1.01 and $kvota>99.99)echo "<script>alert('Kvota vam nije u opsegu od 1.01 do 99.99 .')</script>"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/287180-white-empty-page/ Share on other sites More sharing options...
Ch0cu3r Posted March 22, 2014 Share Posted March 22, 2014 Most likely PHP has encountered an error in your code. Add the following to the top of your script. Any errors reported? ini_set('display_errors',1); error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/287180-white-empty-page/#findComment-1473533 Share on other sites More sharing options...
Leverkusen Posted March 22, 2014 Author Share Posted March 22, 2014 Fatal error: Call to undefined function curdate() in /home/globalbe/public_html/test.php Quote Link to comment https://forums.phpfreaks.com/topic/287180-white-empty-page/#findComment-1473537 Share on other sites More sharing options...
ginerjm Posted March 22, 2014 Share Posted March 22, 2014 So - that's your error. A function you wrote? Quote Link to comment https://forums.phpfreaks.com/topic/287180-white-empty-page/#findComment-1473541 Share on other sites More sharing options...
Leverkusen Posted March 23, 2014 Author Share Posted March 23, 2014 yes but im afraid the script won't work because its supposed to show a message alert 'Postignut maksimalni broj parova u danu' (Max number of pairs reached) if $broj po danu>9 Quote Link to comment https://forums.phpfreaks.com/topic/287180-white-empty-page/#findComment-1473572 Share on other sites More sharing options...
ginerjm Posted March 23, 2014 Share Posted March 23, 2014 ??? Quote Link to comment https://forums.phpfreaks.com/topic/287180-white-empty-page/#findComment-1473576 Share on other sites More sharing options...
TOA Posted March 23, 2014 Share Posted March 23, 2014 Delete line 24 and replace line 25 with this: $select = mysql_query("SELECT racun FROM clanovi_njihovi_racuni WHERE datum_unosa=CURDATE()"); curdate() is not a php function, it's a mysql function. Quote Link to comment https://forums.phpfreaks.com/topic/287180-white-empty-page/#findComment-1473581 Share on other sites More sharing options...
Leverkusen Posted March 23, 2014 Author Share Posted March 23, 2014 <?php // upis para if($_POST['tim1']!="" and $_POST['tim2']!="" and $_POST['tip']!="" and $_POST['kvota']!="" and $_POST['link']!=""){ $racun=$_SESSION['liga_user_id']; $result = mysql_query("select * from clanovi_njihovi_racuni where id='$racun';"); $row = mysql_fetch_array($result); $klikovi = $row['klikovi']; $tim1=str_ireplace(array("\"","'","<",">"),"",$_POST['tim1']); $tim2=str_ireplace(array("\"","'","<",">"),"",$_POST['tim2']); $tip=str_ireplace(array("\"","'","<",">"),"",$_POST['tip']); $kvota=str_ireplace(array(","),".",$_POST['kvota']); $link=$_POST['link']; $ip=$_SERVER['REMOTE_ADDR']; $tim1=strtolower($tim1);$tim1=ucwords($tim1); $tim2=strtolower($tim2);$tim2=ucwords($tim2); $link=str_ireplace(" ","",$link); $prvoslovo=str_ireplace("http://www.flashscore.com/","#",$link); $linkDozvola=0; $broj_po_danu=1; $select = mysql_query("SELECT racun FROM clanovi_njihovi_parovi WHERE datum=CURDATE()"); if(mysql_num_rows($select) == $broj_po_danu){ echo 'Postignut maksimalni broj parova u danu'; } else { if($prvoslovo[0]=="#")$linkDozvola=1; if($linkDozvola==1 and $kvota>1 and $kvota<100){ $result = mysql_query("insert into clanovi_njihovi_parovi set racun='$racun',ip='$ip',datum=curdate(),vrijeme=curtime(),tim1='$tim1',tim2='$tim2', tip='$tip', kvota='$kvota',link='$link';"); } else if($linkDozvola==0)echo "<script>alert('Vas link je neispravan. Link utakmice kopirajte sa www.flashscore.com .')</script>"; else if($kvota<1.01 and $kvota>99.99)echo "<script>alert('Kvota vam nije u opsegu od 1.01 do 99.99 .')</script>"; } } ?> I dont get any error, but this is not working, i can still post Quote Link to comment https://forums.phpfreaks.com/topic/287180-white-empty-page/#findComment-1473618 Share on other sites More sharing options...
Solution ginerjm Posted March 24, 2014 Solution Share Posted March 24, 2014 1 - turn on php error checking and let us see the lines in this code. 2 - whenever you do a function call that MUST be run correctly, you should CHECK the result of it to ensure that it ran. Modify ALL of your present code to check results and echo error messages where appropriate. Do those two things and you and we will learn what your problem is. Quote Link to comment https://forums.phpfreaks.com/topic/287180-white-empty-page/#findComment-1473645 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.