randombob Posted August 27, 2007 Share Posted August 27, 2007 I'm fairly new to this kinda stuff and I'm trying to get this to work. To explain; what I'm doing is comparing if information from a form post has data within it, if it doesn't run another script to generate a random code which is then inserted into the DB, but my syntax is all over the place... The basic logic which is being inserted into the database is if POST EMPTY THEN RUN PRODUCT NUMBER GENERATOR AND CREATE CATNUMBER - IF NOT EMPTY ENTER THE ACTUAL POST INTO THE DATABASE (hope this makes sense)... here's what I've actually got.... (its not working) if (empty($_POST['product_number']); { include "prodnumgen.php"; $catfunction = $mynumber; } else { $catfunction = $_POST["product_number"); } Any idea's would be gratefully recieved as I'm loosing hair by the minute. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/66952-if-else-help/ Share on other sites More sharing options...
randombob Posted August 31, 2007 Author Share Posted August 31, 2007 To explain a little clearer. There are 3 things involved; the Post (coming from a product entry page) the if else and the product number generator. I've double checked both the Post and the Product number generator and both are returning the correct values. The method behind it is to simple say: if the post is empy, run the script to produce the random number, else (hense the post having data within it so post the data) Hope this is a little clearer. Any help would be gratefully recieved. - Cheers everyone! Quote Link to comment https://forums.phpfreaks.com/topic/66952-if-else-help/#findComment-338441 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.