[thelist] help with project design

Matt McKeon matt at camadro.com
Tue Nov 25 15:13:06 CST 2008


Terion Miller wrote:
> I have to make a form to add text ads to a db then have those ads display in
> a table with 3 columns 1 ad per column and this little application has to
> work inside the Helios adserver, I'm stuck because at this point I can't
> even get my form working on my local server...
>
> all the code I have written thus far:
>
> <?php include("inc/dbConnOpen.php") ;   /* connect */
>
> if (isset($_POST['HREF'])){$HREF = $_POST['HREF'];} else {$HREF = "";}
>     {$errmsg = 'Please Select a LINK FOR THE AD';}
> if (isset($_POST['TITLE'])){$TITLE = $_POST['TITLE'];} else {$TITLE = "";}
> {$errmsg = 'Please Select a TITLE FOR THE AD';}
> if (isset($_POST['BLURB'])){$BLURB = $_POST['BLURB'];} else {$BLURB = "";}
> {$errmsg = 'Please enter the text for the ad';}
> if (isset($_POST['BDATE'])){$BDATE = $_POST['BDATE'];} else {$BDATE = "";}
> {$errmsg = 'Please enter the beginning date for the ad';}
> if (isset($_POST['EDATE'])){$EDATE = $_POST['EDATE'];} else {$EDATE = "";}
> {$errmsg = 'Please enter the end date for the ad';}
>
> mysql_select_db($mysql);
> $sql = "INSERT INTO textads (HREF, TITLE, BLURB,BDATE,EDATE,EXPOS) VALUES
> ('HREF',' BLURB', 'BDATE', 'EDATE', 'EXPOS')";
> mysql_query($sql) or die('Error, insert query failed');
> ?>
>   
So, are you getting errors or what's happening when you run this?

Hum, looks like you've got a lot of syntax errors.
What do these lines mean  {$errmsg = 'Please enter the text for the ad';} ?

I'm assuming they should be a part of the else? It should then look more like:
if (isset($_POST['BLURB'])) {
   $BLURB = $_POST['BLURB'];
} else {
   $BLURB = "";
   $errmsg = 'Please enter the text for the ad';
}

That should be a start since you didn't specify what you need help with.

HTH
Matt




More information about the thelist mailing list