Jump to content

if else HELP!


randombob

Recommended Posts

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.  :)

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.