Buying Need an approval script and newsletter script

Discussion in 'Programming' started by rebelagent, May 20, 2010.

  1. #1
    I need to meet a deadline and I can't manage to figure out how to get a multiple approve option to work.

    Just doesn't work at all. I don't get errors, but it certainly doesn't update.

    my mysql database looks like

    thestories
    -their_story
    --id
    --detail
    --approve 'Y', 'N'
    --email

    I need the ability to change approve to Y when my client checks a box and submits on the approval page.

    Name me your price (I don't have a large budget I did this job more for the sake of what it's going for than for what it's worth in my time, so be gentle with your quotes).

    I need it asap. As it was due about 20 hours ago...I know it's about 10-15 minutes for a pro and usually I can figure this stuff out but I can figure how to count and apply the checkboxes.

    here's my current code.
    <?php require('inc/dbc.php'); ?>
    <?php require('inc/head.inc'); ?>
    <?php require('inc/menu.inc'); 
    // Connect to server and select databse.
    mysql_connect("$host", "$username", "$password")or die("cannot connect");
    mysql_select_db("$db_name")or die("cannot select DB");
    
    $sql="SELECT * FROM $tbl_name";
    $result=mysql_query($sql);
    
    $count=mysql_num_rows($result);
    
    ?>
    <p>
    
    <table width="700" border="0" cellspacing="1" cellpadding="0">
    <tr>
    <td><form name="form1" method="post" action="">
    <table width="700" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
    <tr>
    <td bgcolor="#FFFFFF">&nbsp;</td>
    <td colspan="4" bgcolor="#FFFFFF"><strong>Approve multiple stories</strong> </td>
    </tr>
    <tr>
    <td></td>
    <td align="center" bgcolor="#FFFFFF"><strong>Id</strong></td>
    <td align="center" bgcolor="#FFFFFF"><strong>Story</strong></td>
    <td align="center" bgcolor="#FFFFFF"><strong>Email</strong></td>
    </tr>
    <?php
    while($rows=mysql_fetch_array($result)){
    ?>
    <tr>
    <td align="center" bgcolor="#FFFFFF"><input name="approve[]" type="checkbox" id="checkbox[]" value="approve"></td>
    <td bgcolor="#FFFFFF"><? echo $rows['id']; ?></td>
    <td bgcolor="#FFFFFF"><? echo substr($rows['detail'],0,200);?>...</td>
    <td bgcolor="#FFFFFF"><? echo $rows['email']; ?></td>
    </tr>
    <?php
    }
    ?>
    </table>
    <table><tr>
    <td colspan="5" align="center" bgcolor="#FFFFFF"><input name="approve" type="submit" id="submit" value="Approve"></td>
    </tr></table>
    
    <?
    
    $fieldcount = (int) $_POST['fieldcount'];
    echo "Number of checkboxes to process: $fieldcount </br>";
     
    // set the array to N by default
    for ( $count = 1; $count <= $approve; $count++ ) {
       $approve[$count] = "N";
    }
     
    // retrieve the values that are ON, i.e. TRUE
    $checked = $_POST['approve'];
     
    // update the array with the TRUE
    if (sizeof($checked) > 0) {
       foreach($checked as $item) {
           $approve[$item] = "Y";
       }
    }
     
     
    // at this moment you have Y or Ns in your result array
    for ( $count = 1; $count <= $fieldcount; $count++ ) {
       echo "approve[" .$count . "] = $approve[$count] </br>";
    }
    
    
    mysql_close();
    ?>
    </table>
    </form>
    </td>
    </tr>
    </table>
    
    <?php require('inc/foot.inc'); ?>
    
    PHP:

    if hired please make up a fake database and show me that it works via your website. After seeing it works I will send you payment via paypal.

    I also need a newsletter script (the submit email to mysql database, I use that database to mass email a newsletter, with html capabilities)

    I just don't have time to finish this up and need to move on to other deadlines.
     
    rebelagent, May 20, 2010 IP
  2. viral2583

    viral2583 Well-Known Member

    Messages:
    352
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    is this requirement is still open? What you will be paying for both the task?
     
    viral2583, May 22, 2010 IP