Mr P!nk Posted September 28, 2007 Share Posted September 28, 2007 hello im having a wierd problem with printf(""): when i upload this index page it comes up with the error Warning: printf(): Too few arguments in /home/public_html/pidgeon-house/index.php on line 112 I dont understand what i have to do for it to print :-\ any suggestions? <body topmargin="0" leftmargin="0"> <table width="800" height="614" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="27%" rowspan="3" bgcolor="#B7CA33" scope="col"><img src="images/global_nav_bg.gif" width="152" height="600" /> <div id="Layer1"> <table width="98%" border="0" cellpadding="0" cellspacing="4" class="licence"> <tr> <th scope="col"><p align="left" class="licence">Designed by Acme Art<br /> All rights reserved<br /> <a href="mailto:admin@domain.co.uk">admin@domain.co.uk</a></p> <p align="left" class="licence"><br /> <br /> Licensed to: XYZ Company</p></th> </tr> </table> </div> </td> <th height="305" scope="col"><img src="login/images/login_header.gif" alt="" width="648" height="316" border="0"></th> </tr> <tr> <td height="14"><p> </p> </td> </tr> <tr> <td height="252"> <form method="post" action="index.php"> <p> </p> <?php // if login/pass exists if($isAuth && isset($submit)){ printf("<div id=\"system\">You have logged in successfully. <a href=\"layout.php\">Go to Layout selection</a></div>"); } // if login/pass does not exist else if(!$isAuth && isset($submit)){ printf("<div id=\"system\">Login unsuccessful. Check your details and <a href=\"index.php\">try again</a></div>"); } // if not logged in if(!isset($submit)){ printf(" <table width=\"33%\" height=\"101\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"2\"> <tr> <td height=\"58\" scope=\"col\"><p align=\"center\">Username <input name=\"username\" type=\"text\" class=\"loginText\" id=\"username\" size=\"15\" maxlength=\"15\" /> <br /> <br /> Password <input name=\"password\" type=\"password\" class=\"loginText\" id=\"password\" size=\"15\" maxlength=\"15\" /> </p></td> </tr> <tr> <td scope=\"col\"><div align=\"center\" ><img src=\"login/images/login_btn.gif\" width=\"126\" height=\"29\" /></div></td> </tr> </table>" ); // Line 112 <--------------------------------------------------------- } ?> </form> </td> </tr> <tr> <td height="19" bgcolor="#B7CA33"> </td> <td> </td> </tr> </table> </body> Thanks P!nk Quote Link to comment https://forums.phpfreaks.com/topic/71034-solved-printf-arguments/ Share on other sites More sharing options...
darkfreaks Posted September 28, 2007 Share Posted September 28, 2007 try using echo or print Quote Link to comment https://forums.phpfreaks.com/topic/71034-solved-printf-arguments/#findComment-357163 Share on other sites More sharing options...
Mr P!nk Posted September 28, 2007 Author Share Posted September 28, 2007 why i did not think of that in the first place, i will never know! thanks for pointing out the obvious. (in a non sarcastic way) but what would be great is if you/someone could explain as to why it was throwing me that error? once again thankyee darkfreaks Quote Link to comment https://forums.phpfreaks.com/topic/71034-solved-printf-arguments/#findComment-357196 Share on other sites More sharing options...
darkfreaks Posted September 28, 2007 Share Posted September 28, 2007 because it returns a value of a string like $string= 1223456; it would return 1223456 you only have html syntax so your looking for a simple echo or print, now can we hit solved? Quote Link to comment https://forums.phpfreaks.com/topic/71034-solved-printf-arguments/#findComment-357208 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.