Jump to content

j.g.

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

j.g.'s Achievements

Member

Member (2/5)

0

Reputation

  1. OK, I got the dropdown on the page, now I just need to know how to, IF CHECKED, show another link in another row under it... <tr> <td> <span class="plain_sub_head"> <span class="formlabel">* Link Page:</span> </span> </td> <td> <select name="url" onChange="show_offsite()"> foreach( $urls as $page => $location) { //echo "<option>loc: ".$location; //echo "url: ".$url."</option>"; echo "<option "; if( $url == $location ) { echo "SELECTED"; } echo " VALUE=\"".$location."\">".$page."</OPTION>\n"; } </select> <input type="checkbox" name="add_link"> Add Another Link </td> </tr> Thanks much! -j.g.
  2. Hi All- I have a page that I want to give the user to add more than one link to... right now the default page has a title and one dropdown for a link: <form name="frm" method="post" action="<?php echo $PHP_SELF;?>"> <INPUT TYPE="HIDDEN" NAME="resource_id" VALUE="<?php echo $resource_id;?>" SIZE="50"> <INPUT TYPE="HIDDEN" NAME="operation" VALUE="<?php echo $operation; ?>"> <INPUT TYPE="HIDDEN" NAME="type_id" VALUE="<?php echo $type_id; ?>"> <h1>Add / Update Resources</h1> <table class="box_content" width="80%" border="0" cellpadding="0" cellspacing="0" > <tbody> <tr> <td class="contentnovertical"> <div style="padding: 5px;"> <table border="0" cellpadding="0" cellspacing="5" width="100%"> <tbody> <tr> <td>* Title:</td> <td><input name="title" value="<?php echo $title; ?>" size="50" type="text"></td> </tr> <tr> <td> <span class="plain_sub_head"> <span class="formlabel">* Link Page:</span> </span> </td> <td> <select name="url" onChange="show_offsite()"> foreach( $urls as $page => $location) { //echo "<option>loc: ".$location; //echo "url: ".$url."</option>"; echo "<option "; if( $url == $location ) { echo "SELECTED"; } echo " VALUE=\"".$location."\">".$page."</OPTION>\n"; } </select> </td> </tr> <tr> <td> <span id="offsite_label" style="display: none;">Offsite Link:</span> </td> <td> <span id="offsite_text" style="display: none;"> <input type="text" size="40" maxlength="100" name="offsite_url" value="<?php echo $offsite_url;?>"> </span> </td> </tr> <tr> <td align='center' colspan='2' class="box_heading"> <?php echo $section_heading;?> ( * - required field )</td> </tr> </tbody> </table> </div> </td> </tr> <tr> <td class="contentnovertical"> <div style="padding-top: 5px; padding-bottom: 5px;" nowrap="" align="center"> <input type="submit" class="submit_button" value="<?php echo $operation; ?>" > <A HREF="resources_updater.php?type_id=<?php echo $type_id;?>"><span class="content_text">Cancel</span></A> </div> </td> </tr> </tbody> </table> </form> <script type="text/javascript"> show_offsite(); function show_offsite() { if (document.frm.url.value == 'offsite') { document.getElementById("offsite_text").style.display = "inline"; document.getElementById("offsite_label").style.display = "inline"; } else { document.getElementById("offsite_text").style.display = "none"; document.getElementById("offsite_label").style.display = "none"; } } </script> What I'd like to do is put a checkbox next to the current dropdown asking 'Add Another Link' -- and if this box is checked, show another dropdown under it.... All help will be greatly appreciated! So, I need to add the box, and if it is checked, show another dropdown under it. Please let me know if I need to provide any additional information for you to help me solve this problem. Thanks! -j.g.
  3. Yes! -- I think I can use the function I created and posted w/ my initial post should work to accomplish this, but it's not...
  4. Sorry. Everything is working (file uploads, save title, description, etc) except for the 'Visible' part... I cannot get the dropdown to work correctly. If you're on the page to enter data, the dropdown is visible, but blank - you can either select 'Yes' or 'No' from it -> but if I select 'No', then save it, and click 'Update' on the same record, all the info I've entered is there, but the dropdown is blank (Not saving the 'No'). And, the same with the 'Yes' --> and if it's set to 'Yes' I want to display it on another page, which I'll worry about after getting this issue resolved....I just want to get this backend stuff working first... I just first need to get this value to be saved and then able to switch the values (if 'Yes', change it to 'No', etc). What other information can I provide to help you help me? Thanks again! -j.g.
  5. OK - thanks. Here's my code to Save it to the db: if ($_POST['save'] == 'Save') { $current->processPost($_POST); $current->setParent($parent_id); if ( (strlen($_FILES['FILE']['tmp_name']) > 0) && $_FILES['FILE']['error'] == 0) { $file = new File(); $file->readInFile($_FILES['FILE']['tmp_name'], $_FILES['FILE']['name'], $_FILES['FILE']['name']); $current->addFile($file); } header("Location: govt_relations_faq_updater.php?msg=".urlencode("'".$current->getTitle()."' Saved.")); exit; } My db col's/types pertaining to this: content_id - int(11) unsigned visible - tinyint(1) unsigned Is there any additional info that I'm missing that I could provide? If so, just let me know. Thanks! -j.g.
  6. Hello All! I have a page that asks if the data input by the user should be visible or not -- if yes, it appears on the page, if no, don't show it. I was using a checkbox for this, but discovered that if the user tries to change it from checked to unchecked, it wasn't working correctly; so, I'm now trying a new dropdown function for this -- problem is, it's not saving the choice for each record now...and when you go in to update a record, the drop down is always blank vs. 'Yes' or 'No', depending on what the user selects... How can I fix this? Here's the call to the function in my form: <?= true_false_dropdown('visible', ($current->getVisible() == 1)); ?> And here's my function: // true / false dropdown function true_false_dropdown($name, $default="", $on_change="") { $tf = array ( "false" => "Yes", "true" => "No" ); return (array_dropdown($tf, $name, $default, true, $on_change)); } If anyone could tell me how to fix this, I'd be most appreciative. Thanks for your time and help! -j.g.
  7. Sorry to ask, but could you please provide an example of what you're describing? I'm not sure I understand -- this is all so new to me! :-\ Thanks. -j.g.
  8. Thanks for the reply. I tried making tsize an array and storing the selections in there, but am still getting the same results. Thoughts? Thanks! -j.g.
  9. Thanks for the help! So if anyone else runs into this same issue, this was resolved by tweaking the 'AddAttachment' line: $mail->AddAttachment($_FILES["file_name"]["tmp_name"],$_FILES["file_name"]["name"]); Hope that helps someone else in the future! -j.g.
  10. Hello List! I could really use some help here...I've almost got this working, but need some answers... I have a program that allows users to select a 'New Graduate' membership, and for each one selected, they get a free tshirt. I've got that working using a 'is_new_grad' function that I created. So, if they select 2, they see 2 dropdowns to select the sizes of them. It then sends an email w/ the membership info and the shirt sizes selected. However, when the email is being sent, it's only returning the size of the LAST item selected in from the drop-downs. Example: if I sign up for four of these memberships and select four different tshirt sizes (1 Medium, 1 Lg, 1 XL, and 1 XXL), the info in the email is all XXL: New Graduate T-Shirt Size (included): XXL New Graduate T-Shirt Size (included): XXL New Graduate T-Shirt Size (included): XXL New Graduate T-Shirt Size (included): XXL Here's my code for showing the drop-down boxes: if( is_new_grad() ) //If joined as a 'New Graduate', ask for the T-Shirt size - 1 for each 'New Graduate' membership { while(list($product_id, $quantity) = each($_SESSION["cart_items"])) { for( $count = 1; $count <= $quantity; $count++) { $shirt_sizes = array("M" => "Medium (M)", "L" => "Large (L)", "XL" => "Extra Large (XL)", "XXL" => "Extra Extra Large (XXL)" ); <TR BGCOLOR=#CCCCCC> <TD CLASS="bodytext"><FONT COLOR=#961039>Select T-Shirt Size (included):</font></TD> <TD> </TD> <TD COLSPAN=5 ALIGN=RIGHT> <SELECT NAME="tsize"> <OPTION VALUE="">--Select--</OPTION> foreach( $shirt_sizes as $key => $value ) { echo "<OPTION VALUE='".$key."' "; if( $tsize == $key ) { echo " SELECTED "; } echo " >".$value."</OPTION>\n"; } </SELECT> </TD> </TR> } //end of for loop }//end of while }//END if( is_new_grad() ) And here's the code for sending the email: if( is_new_grad() ) //If joined as a 'New Graduate', ask for the T-Shirt size { while(list($product_id, $quantity) = each($_SESSION["cart_items"])) { for( $count = 1; $count <= $quantity; $count++) { if( $_POST["tsize"] ) { echo "\tNew Graduate T-Shirt Size (included): ".$_POST["tsize"]."\n"; } } } } Please, any solutions and ideas for solving this would be greatly appreciated!! Thank for your time and help!! -j.g.
  11. I've even tried referring to the file directly by using it's 'tmp' value, but still not attaching the file... $mail->AddAttachment($_FILES["file_name"]["tmp"]); Does anyone see what I'm doing wrong? ??? Thanks again! -j.g.
  12. Thanks for the replies! I ended up going the phpmailer route; but, am still at the same spot -- sending email w/ name, phone, and email, but file is not attached. Here's my line for it (what's wrong w/ it??): $mail->AddAttachment($_FILES["file_name"]["name"]); And here's my input field for the file: <div align="left">Attach Resume <input TYPE='FILE' NAME='file_name' "SIZE='40'/> </div> Entire php code: session_start(); require_once("$DOCUMENT_ROOT/includes/form_functions.php"); require_once("$DOCUMENT_ROOT/includes/form_processor.php"); //set up the emailer require_once("$LIBRARY_ROOT/class.phpmailer.php"); $mail = new PHPMailer(); $mail->From = 'info@xxx.com'; $mail->FromName = 'info@xxx.com'; $mail->Subject = 'Employment Form Submission'; $items = array('name', 'email', 'phone', 'resume file'); $required = array(); if( $_POST["submit"] == "Submit" ) { $required = array( "name" => "text", "email" => "text", "phone" => "text" ); $error_msg = form_processor( $required, $_POST, $num_results = 1 ); if( !$error_msg ) { $body = ''; foreach($items as $i => $item) { $body .= ucfirst($item).": ".$_POST[$item]."\n\r"; } $body .= "Sent: ".date('Y-m-d h:i:s')."\n\r"; //send the email $mail->Body = $body; $mail->AddAddress('xxx@xxx.net'); $mail->AddAttachment($_FILES["file_name"]["name"]); if ($mail->Send()) { header ("Location: /thankyou.php"); exit(); } else { "There has been an error sending your email to TERM Billing.<br>"; } } } require_once("header.php") Thanks much! -j.g.
  13. Hello List- This is my first time attempting this; but I'd like to add a file selected by the user to the email that is sent to the recipient... I've got the basics done where it's allowing the input for the name, email, phone, and browsing to select a file; and it's sending an email w/ the name, email, and phone in it, but I don't know how to incorporate the attaching of the email to this email. Here's my code: session_start(); require_once("$DOCUMENT_ROOT/includes/form_functions.php"); require_once("$DOCUMENT_ROOT/includes/form_processor.php"); $to = 'xxx@xxx.net'; $headers = 'From: info@xxx.com' . "\r\n" . 'Reply-To: info@xxx.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $subject = "Employment Form"; $items = array('name', 'email', 'phone', 'resume file'); $required = array(); if( $_POST["submit"] == "Submit" ) { $required = array( "name" => "text", "email" => "text", "phone" => "text" ); $error_msg = form_processor( $required, $_POST, $num_results = 1 ); if( !$error_msg ) { $message = ''; foreach($items as $i => $item) { $message .= ucfirst($item).": ".$_POST[$item]."\n\r"; } $message .= "Sent: ".date('Y-m-d h:i:s')."\n\r"; if (mail($to, $subject, $message, $headers)) { header ("Location: /thankyouform.php"); exit(); } } } require_once("header.php") Any help or direction that you could give me to get this working is greatly appreciated b/c I just cannot get this working! Thanks, -j.g.
  14. But, if the user enters '80,000', that's what I'm storing. And, I also noticed that if I enter a # w/ both a comma and period, it's really messed up -- enter: 1,888.88 --> outputs $1.00 vs. $1,888.88 ???
  15. Well, this function is still returning $80.00, even though 80,000 is in the db -- I'm assuming it has to do w/ the non-numeric comma, as just pointed out... What do I need to change to get the $80,000.00 output instead of $80.00? function format_money($dec, $prefix='$') { return("$prefix".sprintf("%01.2f",round($dec, 2))); } Any ideas? -j.g.
×
×
  • 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.