buconine Posted December 2, 2006 Share Posted December 2, 2006 hello, i'm trying to view a pdf file off a form and got the form working, but when you submit the form i just get the html from the page, no php. here is the code. any ideas?[code]<?php if (!$_POST['submit']) { ?> <form action = "<?=$_SERVER['PHP_SELF'] ?>" method = "post"> Image Number <input type = "text" name = "img_num"> <input type = "submit" name = "submit" value = "search"> </form> <?php } else $img_num = ($_POST['img_num']); echo '<img src= /home/images/$img_num.pdf >'; ?> [/code]and the cron question is: i have a cron running twice a day on my host. it sends an email once a criteria is met. unfortunatly it keeps sending the email. is there a way to have it only email that address once then skip it next time it checks the database?thanks for the help. i am just learning sql/php and it is pretty challenging to a newb! Quote Link to comment Share on other sites More sharing options...
fert Posted December 2, 2006 Share Posted December 2, 2006 PHP is server side so any php code in a file will be run and replaced with any output the code generates. Quote Link to comment Share on other sites More sharing options...
buconine Posted December 2, 2006 Author Share Posted December 2, 2006 ok, but the code isn't generating anything but a blank screen. any ideas? i've tried adding {} after else and the echo, no difference. i'm stuck. is the way i'm doing it just wrong completely? is there another way to view a pdf file thru a form? Quote Link to comment Share on other sites More sharing options...
buconine Posted December 3, 2006 Author Share Posted December 3, 2006 hmm, now i am getting errors with my cron. the error is: Warning</b>: mysql_num_rows(): supplied argument is not a valid MySQL result resource for this line of code: if (mysql_num_rows($result) > 0) { being used in a select statement which in my books should be a legal statement.any ideas? 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.