PHP - Get Values For The Subject That Has Been Selected
I have created a query to show the subject name as a drop down box now I would like to you use value to compare what module available in the database.
For now I can disaplyed all the module that is avilable for all the subject. But i would like to use the drop down box to gather which subject they have chosend then use this information to gather the module $query=("SELECT Tes_Name FROM User u, Subject s, Test t WHERE u.Use_ID = '{$_SESSION['ID']}' AND s.Sub_ID=t.Sub_ID "); <Html> <?php session_start(); $Value1 = mysql_real_escape_string(trim($_POST['myselect'])); $_SESSION['myselect'] = $Value1; //echo $Value1; include '../Database/connection.php'; ?> <body> <form action="Previousq_Module2.php" method="post"> <?PHP include '../Database/Module_Exsit.php'; $result=mysql_query($query) or die ("Unable to Make the Query:" . mysql_error() ); echo "<select name=select>"; while($row=mysql_fetch_array($result)){ echo "<OPTION VALUE=".$row['Tes_ID'].">".$row['Tes_Name']."</OPTION>"; } echo "</select>"; ?> <input type="submit" value="submit"/> </form> </body> </html> Similar TutorialsHi, I have a form for news articles. It has a title and a body which is fine. I also have a search box that allows the user to search for a memeber and click their name when it appears. This moves a div with a data-id into another div. The purpose of this is to tag them in the article. I am able to post all of the simple stuff but how would i post these value. I am assuming that i would need to create an array of said values but i am struggling to get them showing in post at all. Here is the code i have so far <?php function searchForPeople($searchVal, $exclude = '0'){ $sv1 = $searchVal; $sv2 = $searchVal; include 'includes/dbconn.php'; $out =""; $stmt = $conn -> prepare(" SELECT fname, lname, id FROM person WHERE id NOT IN (".implode(',', array_map('intval', $exclude)).") AND (fname LIKE CONCAT('%',?,'%') OR lname LIKE CONCAT('%',?,'%')) "); $stmt -> bind_param('ss', $sv1, $sv2); $stmt -> execute(); $stmt -> bind_result($fn, $ln, $pid); while($stmt -> fetch()){ $out .= "<div class='btn btn-primary m-1 tagInArticle' name='taggedPerson[]' data-id='$pid'>$fn $ln</div>"; } return $out; } ?> ...... <div id="searchResultsHere"> <!-- ajax content here --> </div> <hr> <div id="taggedInArticleContainer"> <!-- ajax content here --> </div> ....... <div class="col-lg-2"> <button type="submit" name="PublishNewNews" class="btn btn-primary w-100 mb-3">Publish</button> <button class="btn btn-primary w-100">Save</button> <hr> <div class="btn btn-warning w-100 mb-3">Private</div> <input type="hidden" name="howVisible" value="Private"> <hr> <p class="text-justify">Private news articles will only be avilable to logged in users</p> </div> ....... <script> $('#searchResultsHere').on('click', '.tagInArticle', function tagInArticle(){ var tagButton = $(this); tagButton.appendTo('#taggedInArticleContainer') }); $('#searchForPeopleBox').keyup(function(){ var searchVal = $(this).val() var tagged = '0' var tagged = $('#taggedInArticleContainer').find('.tagInArticle').map(function(){ return $(this).data('id'); }).get(); $.ajax({ type: 'post', data: {"ajax" : 'one', "val" : searchVal, "exclude" : tagged}, success: function(resp){ $('#searchResultsHere').html(resp) } }) }); </script> I hope this is enough to go on. I am sure it is simple but i just cant get it. Thanks all in advance. Hi all.
how can i make the values show like a list. I tried html line break "<br>" and php \n but all to no avail. It just show all the values in one straigth line.
example of what i want is for the values to appear like this:
1234567890
0987654345
4567890675
instead of :
1234567890 0987654345 4567890675
Thanks
<form data-abide method="post" action=""> <div> <select name=""> <option value="name"> <?php $stmt = $pdo->query("SELECT acct_num FROM table order by id desc"); while ( $row = $stmt->fetch(PDO::FETCH_ASSOC) ) { echo $row['acct_num']; } ?> </option> </select> </div> <div> <label>New Password <small>required</small></label> <input type="password" name="password" id="password" required> <small class="error">New password is required and must be a string.</small> </div> <div> <label>Confirm New Password <small>required</small></label> <input type="password" name="password2" id="password2" required> <small class="error">Password must match.</small> </div> <input name="submit" type="submit" class="button small" value="Change Password"> </form> Edited by Mr-Chidi, 13 November 2014 - 01:34 AM. I have several drop down boxes. When submit is clicked it execute query on another page. Problem is when submit is clicked selected values are return to defaults. Is it possible for the values to be remembered after submitting them? Part of the drop down code: Code: [Select] <?php $result = mysql_query("SELECT * FROM product GROUP BY Rim"); ?> <select id="Rim" name="Rim" selected="selected" style="width:158px;position:static;z-index:-1;"> <option value="rim" selected="selected"><?php echo "Rim"; ?></option> <?php while ($row = mysql_fetch_array($result)) { echo "<option>" . $row['Rim'] . "</option>"; echo "<br />"; } ?> </select> Hello, I have a datepicker that when a date is selected, the post to a php file will get the sum values for that selected day, month, and year. I have the "by day" working with this... <?php $choice = (isset($_POST['choice'])) ? date("Y-m-d",strtotime($_POST['choice'])) : date("Y-m-d"); $con = mysql_connect("localhost","root","xxxxxxxxxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("inverters", $con); $sql = "SELECT sum(power/1000) AS choice FROM feed WHERE date = '".$choice."' group by date"; $res = mysql_query($sql) or die('sql='.$sql."\n".mysql_error()); $row = mysql_fetch_assoc($res); echo $row['choice'].'<br />'; ?> But by month and year are not clicking... Help Please Alan Hi everyone, I am having trouble passing/displaying the values inside of a selected list. I created a add/remove list using Jquery and I tried to display the values passed using foreach and for loops but it is still not working. The values I am trying to get are $existing_mID[$j], which is inside of the option value attribute. Please kindly let me know what should I do in order to get the values and I really appreciate your help. <?php $selected = $_POST['selectto']; if(isset($selected)) { echo "something in selected<br />"; for ($i=0;$i<count($selected);$i++) echo "selected #1 : $selected[$i]"; foreach ($selected as $item) echo "selected: item: $item"; } ?>This is the form To generate the stockroom drop down list function einv_generateStockrmSelectDropdown($Stockrm,$field,$dropdown) { //connect to database base_connectDatabase(); echo "<select id=\"stockrm\" name=\"".$field."[]\" multiple=\"multiple\" style=\"align:left\" class=\"form-control\">"; if (isset($Stockrm) && ($Stockrm != "")) { $stockrmname = einv_getStockrmDetail($Stockrm); echo "<option value=\"". $Stockrm ."\">". $stockrmname['einv_stockrm_name'] ."</option>"; } else { $Stockrm = 0; } $getStockrmSQL = base_executeSQL("SELECT * FROM einv_stockroom WHERE einv_stockrm_id<>" . $Stockrm . " ORDER BY einv_stockrm_name"); while ($Stockrmdata_row = base_fetch_array($getStockrmSQL)) { if (base_num_rows($getStockrmSQL)!= 0) { echo "<option value=\"".$Stockrmdata_row['einv_stockrm_id']."\">".$Stockrmdata_row['einv_stockrm_name']."</option>"; } } echo "</select>"; echo "<script src=\"../terms_base/js/jquery.multiple.select.js\"></script>"; //Input some codes to split the dropdown and make it into the setSelects. By default, the first time = AutoSelectAll if(isset($dropdown) && ($dropdown != "")) { //dropdown = 1;2;3 $SDDArrays = explode(";", $dropdown); $countTrap0 = count($SDDArrays); $drop = "$('#stockrm').multipleSelect(\"setSelects\", ["; $counting = 1; foreach ($SDDArrays as &$value) { if ($countTrap0 != $counting) { $drop .= "'". $value . "',"; } else { $drop .= "'". $value . "'"; } $counting++; } $drop .= "]);\n"; } elseif (isset($dropdown)) { //dropdown= $drop = "$('#stockrm').multipleSelect(\"uncheckAll\")"; } else { // $drop = "$('#stockrm').multipleSelect(\"checkAll\")"; } echo "<script>\n"; echo "$(function() {\n"; echo "".$drop.""; echo "});\n"; echo "$(\"#stockrm\").multipleSelect({ onClose: function() { document.getElementById('search').click(); }});\n"; echo "$(\"#stockrm\").multipleSelect();\n"; echo "</script>"; //close the database base_closeDatabase(); }add stockroom function //This function is use to add new stock room //code = stock room code //name = stock room name //desc = stock room description //remark = stock room remark //cat = stock room category function einv_addStockrm($code,$name,$desc,$remark,$cat) { //connect to database base_connectDatabase(); $User = base_getUserDetail($_SESSION['uID']); base_executeSQL("INSERT INTO einv_stockroom (einv_stockrm_code, einv_stockrm_name, einv_stockrm_desc, einv_stockrm_remark, einv_stockrm_cat) VALUES ('" . $code . "', '" . $name . "', '" . $desc . "', '" . $remark . "', '" . $cat . "')"); base_addTransactionLog('Manage Stock Room', 'Add', " Stock Room Code = " . $code . " || Stock Room Name = " . $name . " || Stock Room Description = " . $desc . " || Stock Room Remark = " . $remark . " || Stock Room Category = " . $cat . " "); //go to stock room page echo '<script type="text/javascript">' . "\n"; echo 'window.location="../einventory/stockrm_list.php";'; echo '</script>'; //close the database base_closeDatabase(); } Edit stockroom function einv_editStockrm($srid,$code,$name,$desc,$remark,$cat) { //connect to database base_connectDatabase(); $User = base_getUserDetail($_SESSION['uID']); $Stockroom = einv_getStockrmDetail($srid); base_executeSQL("UPDATE einv_stockroom SET einv_stockrm_code='" . $code . "', einv_stockrm_name='" . $name . "', einv_stockrm_desc='" . $desc . "', einv_stockrm_remark='" . $remark . "', einv_stockrm_cat = '" . $cat . "' WHERE einv_stockrm_id=" . $srid . ""); base_addTransactionLog('Manage Stock Room', 'Edit', " Stock Room Code = " . $code . " || Stock Room Name = " . $name . " || Stock Room Description = " . $desc . " || Stock Room Remark = " . $remark . " || Stock Room Category = " . $cat . " "); //go to stock room page echo '<script type="text/javascript">' . "\n"; echo 'window.location="../einventory/view_stockrm.php?id='. $srid .'";'; echo '</script>'; //close the database base_closeDatabase(); } I have a dropdown list named **Stockroom** where it displays an array of values. Example: **Stockroom** 1. [A] 2. [b] 3. [C] When user clicks on [A], it will display relevant data fields that [A] possess (appears below stockroom ddl). And as user clicks on [b], there is an onchange function that will then show [b] data fields (fields in A is deleted and replaced with B). I am able to add the initial values however, as i want to edit and change the stockroom from [A] to [b] which will result in a whole new data to be stored, i am unable to do so. Any ideas? I believe i have to amend my edit stockroom function where i require a set of coding such as If the array is selected, i have to delete existing data and add new data in accordance to the selected ID. Edited by mac_gyver, 14 January 2015 - 07:05 AM. code tags around posted code please I have an audio mix submitting form on my website. The first part of the form takes the details from the user and inserts a new row in the first table 'mix', auto incrementing to generate a mix_id primary key. The second part then uses a series of check boxes to select which genres the mix contains and a foreach for the resulting array to insert, into the 2nd table 'genres_for_mix', a new row for each genre id (foreign key for the genres table) that is selected and the mix_id that it concerns. Now I'm starting to think this is a bad way to do this because: 1. I don't know how to echo this out when a user edit's the mix to make all the relevant checkboxes selected. 2. When a user deselects a choice, it would be quite long winded to delete the nessesary row. So instead I'm thinking that it would be much wiser to user the serialise functions to put the array into the database However, I still don't know how to make the right checkboxes selected when I echo out the edit form. Do I use something like inarray()? If so how? Also, it's really important that I can query the database for mixes that are associated with a specific genre. Without unserialising the array and therefore echo'ing out all the results, I don't know how to query this. Would I just use a 'WHERE genre_field LIKE 'genre_id'? Can anyone help me with this please? Hello, any help would be greatly appreciated. I have two dropdowns with 2 options in each. Customer picks one option from each dropdown and the form gets emailed to addresses from the two selections. The code below gives and error. My form: <form method="POST" action="quote.php" onsubmit="return checkform(this)"> <input type="hidden" name="agent" value="recipient_1,recipient_2"> <input type="hidden" name="office" value="recipient_3,recipient_4"> <select name="agent" id="agent"> <option value="recipient_1">Agent1 </option> <option value="recipient_2">Agent2 </option> </select> <select name="office" id="office"> <option value="recipient_3">Location1 </option> <option value="recipient_4">Location2 </option> </select> <input type="submit" name="submit" value="Submit"> </form> quote.php is below: $recipients = array( 'recipient_1' => 'email_1@yahoo.com', 'recipient_2' => 'email_2@yahoo.com', 'recipient_3' => 'email_3@yahoo.com', 'recipient_4' => 'email_4@yahoo.com', ); $exploded_recipients = explode(",",$_REQUEST['agent']); foreach($exploded_recipients as $value) { $my_email = $recipients[$value]; $success = mail($my_email, $Subject, $Body, "From: <$EmailFrom>"); } Thanks in advance Folks, I have a dropdown, once values are selcted, these values should be put in a URL structure so that it matches with the one MoD_rewrite rule in my .htaccess. Here is my Mod_Rewrite Rule: RewriteRule ^(.*)/([^/]*)\.html$ search.php?q=$1&sc=$2 [QSA,L] Here is my Dropdown Code: <div id="search" > <form id="searchform" method="get" action="search.php"> <label>Search By Brand/ Manufacturer: </label> <select name="q"> <option value="SelectBrand">Select Brand</option> <?php if(isset($this->search->options)): ?> <?php foreach($mfg as $lolachild): ?> <option value="<?php echo $lolachild; ?>"><?php echo ucwords($lolachild); ?></option> <?php endforeach; ?> <?php endif; ?> </select> <select name="sc"> <option value="All"><?php eprint(LangAll); ?></option> <?php if(isset($this->search->options)): ?> <?php foreach($this->search->options as $cat): ?> <option value="<?php echo $cat->value; ?>"><?php echo $cat->name; ?></option> <?php endforeach; ?> <?php endif; ?> </select> <input type="submit" value="<?php eprint(LangSearch); ?>" /> </form> </div> Problem is, upon Submit, it goes to this link structu http://mydomain.co.uk/search.php?q=fisher&sc=302 It should rather be: http://au2.co.uk/fisher/302.html What am i missing or doing wrong? Cheer Natasha Hi Can anyone see why $this->subject is not working? I have a class that is going to send an email. All the variables are set and contain values. How ever, I'm getting an error if I try to use the subject variable inside a method? Error: Fatal error: Using $this when not in object context in /home/p/o/powtest/web/public_html/includes/admin_emails.php on line 36 Line 36 is: $subject = $this->subject; Code: [Select] protected static $table_name="admin_emails"; protected static $db_fields = array('id', 'name', 'subject', 'body_content', 'from_name', 'from_email'); public $id; public $name; public $subject; public $body_content; public $from_name; public $from_email; public function send_notification($sendTo, $name){ $to_name = $name; $to = $sendTo; $subject = $this->subject; $message =<<<EMAILBODY {$this->body} EMAILBODY; $message = wordwrap($message, 70); $from_name = $this->from; $from = $this->from_email; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "localhost"; $mail->Port = 25; $mail->SMTPAuth = false; $mail->FromName = $from_name; $mail->From = $from; $mail->AddAddress($to, $to_name); $mail->Subject = $subject; $mail->Body = $message; $result = $mail->Send(); return $result; } Any help or pointer would be great. Thanks Hi, I'm trying to run an api from upcdatabase.com. I works fine but some barcodes are 8digits or 13digits, i need those barcodes to be changed by adding in zero's if 8 or subtracting 1 zero if 13. It needs to do this before being sent to the sever. Your help is really appreciated this should be simple but has got be stumped i don't know where to even put the code... here's what i've got so far. THANKYOOUUU FOR YOUR TIME! <?php extract($_GET); if(isset($upc)) { ?> <form method="get" action="<?php print $_SERVER[PHP_SELF]; ?>"> <p><input type="text" name="upc" value=""/></p> <p><input type="submit" value="Search"/></p> </form> <?php require_once 'XML/RPC.php'; $rpc_key = 'c737eb5b608f31e5fa022718860f1578cf2cc2a6'; // Set your rpc_key here // Setup the URL of the XML-RPC service $client = new XML_RPC_Client('/xmlrpc', 'http://www.upcdatabase.com'); // Construct the entire parameter list (an array) for the call. // The array contains a single XML_RPC_Value object, a struct. // The struct is constructed from a PHP associative array, and each // value needs to be an XML_RPC_Value object. $params = array( new XML_RPC_Value( array( 'rpc_key' => new XML_RPC_Value($rpc_key, 'string'), 'upc' => new XML_RPC_Value($_REQUEST['upc'], 'string'), ), 'struct')); // Construct the XML-RPC request. Substitute your chosen method name $msg = new XML_RPC_Message('lookup', $params); $upc_count = count($upc); If ($upc_count == 7){ echo '0000'.$upc; } elseif ($upc == 13) { echo '000'.$upc; } else { echo 'incorrect number of digits'; } //Actually have the client send the message to the server. Save response. $resp = $client->send($msg); //If there was a problem sending the message, the resp will be false if (!$resp) { //print the error code from the client and exit echo 'Communication error: ' . $client->errstr; exit; } //If the response doesn't have a fault code, show the response as the array it is if(!$resp->faultCode()) { //Store the value of the response in a variable $val = $resp->value(); //Decode the value, into an array. $data = XML_RPC_decode($val); //Optionally print the array to the screen to inspect the values echo "<pre>" . print_r($data, true) . "</pre>"; echo '<p>'.$data['status'].'</p>'; echo '<p>'.$data['upc'].'</p>'; echo '<p>'.$data['description'].'</p>'; }else{ //If something went wrong, show the error echo 'Fault Code: ' . $resp->faultCode() . "\n"; echo 'Fault Reason: ' . $resp->faultString() . "\n"; } } else { ?> <p>Enter a 12 digit UPC Barcode</p> <form method="get" action="<?php print $_SERVER[PHP_SELF]; ?>"> <p><input type="text" name="upc" value=""/></p> <p><input type="submit" value="Search"/></p> </form> hello, im using the php mailer, working nicely but I need to put 3 values in my from fields in subject, now I have just 1 field $mail2->Subject = ($_POST['name']); I need to include in the subject email, commas and a message, I tried the following, but not working (noob learning!) $mail2->Subject = ($_POST['name'] "," $_POST['email'] "," "confirmation mail" ); thank you so much! Hi guys, I wonder if anyone could help me. I have a string of data pertaining to images that is being passed from an ajax function. It is full of ID:VALUE pairs like this- title1:something,caption1:blah blah blah,align1:left,width1:100,height1:100,title2:something else,caption2:more blah blah,align2:right,width2:300,height2:100 etc. (The digit after each id relates to the image- a crude way of data stuffing..) I've exploded this string by means of the comma separator into the $field_values array, so that it's now arranged like this- $field_values[0] = 'title1:something' $field_values[1] = 'caption1:blah blah blah' $field_values[2] = 'align1:left' ...etc. With me so far? Right, so now I'm going to extract the id and value from each pair and put it into a new array of $image_data, where the first array key of $image_data is the no. of the image..like this- foreach($field_values as $pair){ if(substr($pair['id'], -1) == '1'){ $field_id = substr($pair['id'],0,-1); $image_data[1][$field_id] = $pair['value']; } } ... And then I'd do the same for all the id:value pairs for image no.2. HOWEVER... I'd like to speed things up so that when I'm searching the $field_values array for the 2nd and 3rd image ID:VALUE pairs, it's not wasting time by cycling through all the pairs that I've already identified and put into the $image_data array. I thought I could use unset(), but I'm not sure quite how to implement it here. I hope that my question is intelligible, and that somebody might be able to help me..? Many Thanks! Does anyone know why this isn't working? $body = " Dear ".if ($row['customertitle'] != '') {echo $row['customertitle'].' '.$row['customerlastname'];} else (echo $row['customerfirstname'];}." <BR> This is a test. ".$_SERVER['SERVER_ADDR']." <BR> ".echo $accessinformation." "; Hi there,
I am getting this in a PHP generated email:
ACWA Member/Subscriber: Melody’s Children’s Service
The line of code in the php is:
$subject = "ACWA Member/Subscriber: $membername";
I have tried htmlentitiies, html_entity_decode, htmlspecialchars but nothing seems to work.
I haven't used htmlentities anywhere else in the code for this variable.
Any suggestions?
All advice gratefully received.
please help, here is all my code: <div id='div_phone_big'> </div> <head> <script type="text/JavaScript"> function getChoice(val) { yesNo = new Array("Yes", "No"); var getsel = document.contactus.yesnolist.value; var e = document.getElementById("yesnolist"); var strUser = e.options[e.selectedIndex].value; if (strUser == "no") { //alert('lakjdlakjsdlajd'); window.location.href = "http://www.rainbowcode.net/index.php/util/faq"; //document.write(window.location.href); window.location('http://www.rainbowcode.net/index.php/util/faq'); } else { document.contactus.emailreply.value = ""; document.contactus.commtext.value = ""; document.contactus.message.value = ""; document.contactus.commlist.value = ""; } return strUser; } function getCommChoice(x) { comm = new Array("Compliment","Complaint","Feedback","Suggestion","Billing Query","Other"); var getsel = document.contactus.commlist.value; document.contactus.message.value = comm[getsel]; return document.contactus.message.value; } function sayThanks() { alert("Thank you for submitting"); return true; } </script> </head> <body> <form name = "contactus" method="post" onSubmit="return sayThanks()"> <table class='table_format_content_rbc' border='0'> <div> <span class='spn_big_lightblue_rbc'>RAINBOW</span><span class='spn_big_black_rbc'>CODE: CONTACT US </span> <td colspan='3' align='left' class='small_header_rbc'> <h3>Problems and general queries</h3> <li>Phone our call centre on 086 110 6472 ( Available 8am-5pm from monday-friday ) or</li> <li>Email us at <a href="mailto:helloise@pagesalive.co.za">feedback@miranetworks.net</a> </li> </td> </div> <div> <tr></tr> <tr></tr> <tr> <td colspan='3' align='left' class='small_header_rbc'> <h3>Frequently Asked Questions</h3> <li>Please take a moment to read the Frequently Asked Questions as the solution to your query could be waiting for you there!</li> <li>Have you read the <?php echo link_to('FAQ','util/faq') ?> ? <select id="yesnolist" onChange="getChoice(this.value)"> <option value="yes" selected="selected">Yes</option> <option value="no">No</option> </select> </li> </tr> <tr></tr> <tr></tr> </div> <div> <tr> <td colspan='3' align='left' class='small_header_rbc'> <h3>Feedback and Suggestions</h3> </select> </li> <textarea name="message" rows="10" cols="20"></textarea> <br /><br /> <?php $to = "helloise@pagesalive.co.za"; $subject = $_REQUEST["commlist"]; $email = $_REQUEST["emailreply"]; $message = $_REQUEST["message"]; $headers = "From: $email"; mail($to, $subject, $message, $headers); ?> <input type="submit" value="Send"> <input type="reset" value="Reset"> </td> </tr> </div> </table> <table class='table_format_content_rbc' border='0'> <tr> <td colspan='3' align='left' class='small_header_rbc'> <br/> </td> <tr> </table> </form> </body> and also set the php.ini file portion: ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path sendmail_path = /usr/sbin/sendmail -t and also ran: $ sudo echo "test" | mail -s "test" helloise@pagesalive.co.za The program 'mail' can be found in the following packages: * heirloom-mailx * mailutils please help?? <option value="feedback">Feedback</option> <option value="suggestion">Suggestion</option> <option value="billquery">Billing Query</option> <option value="other">Other</option> </select> </li> <textarea name="message" rows="10" cols="20"></textarea> <br /><br /> <?php $to = "helloise@pagesalive.co.za"; $subject = $_REQUEST["commlist"]; $email = $_REQUEST["emailreply"]; $message = $_REQUEST["message"]; $headers = "From: $email"; mail($to, $subject, $message, $headers); ?> <input type="submit" value="Send"> <input type="reset" value="Reset"> </td> </tr> </div> </table> <table class='table_format_content_rbc' border='0'> <tr> <td colspan='3' align='left' class='small_header_rbc'> <br/> </td> <tr> </table> </form> </body> and also set the php.ini file portion: ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path sendmail_path = /usr/sbin/sendmail -t and also ran: $ sudo echo "test" | mail -s "test" helloise@pagesalive.co.za The program 'mail' can be found in the following packages: * heirloom-mailx * mailutils please help?? Hi I would like to add a subject <select> field to my contact form, where the user can select from certain subjucts or enter his/her own subject. What I have so far is: Code: [Select] <select name="client_subject"> <option value="">Select...</option> <option value="Option 1">Option 1</option> <option value="Option 2">Option 2</option> <option value="Option 3">Option 3</option> <option value="Option 4">Option 4</option> <option value="Custom Subject"><input type="text" value="" size="40"></option> </select> This is only the select part of the form. When I use it like this, I get the input text field outside the dropdown list. I would like it to be inside the dropdown list as an option, and once selected, give you the input text field where you can enter your own custom subject to be added to the email that will be sent. Hello sir, My name is Soji. I'm working on a php project on result transcript processing. I got to a stage where i need to rank student based on their score (Subject Position) and also Overall Position. I have tried all i could but i still don't get it I have a table called Subject position where with field (id, studentregNo, subjectid, levelid, armsid, yearid, total). what i want is if there is 3 student in a class and the first student score 50 in english and the second student score 45 and the third score 40. i want the system to tell me that the first student position in English is 1st and the second student position in English is 2nd and third student position in English is 3rd. So all this will be applicable to all subjects that the students in a particular level are offering.
Moreover, I need Rank student in a subject in that class, And this will work with each subject for each student in that class. I have this loop on a shorturl website i own that selects domains from my website and lists them in a dropdown list where users can select one domain to use as url shortener. The problem is that when a users selects and entry from the dropdown list this created only the [[[main_url]]] entry from the database table bellow can be used. When someone selectes "coolartistname.site.com the submit button cannot be pressed. in other words it's not adding the SELECTED attribute other than the [[[main_url]]] domain. Can anyone see on the code bellow why this would happen?
**Index.php** // get base urls $shortUrlDomains = getShortUrlDomains(); <?php foreach ($shortUrlDomains AS $k => $shortUrlDomain) { // active domains only if (($shortUrlDomain['premium_only'] !== '1') && ($shortUrlDomain['premium_only'] !== $Auth->id)) { continue; } echo '<option value="' . (int)$k . '"'; if (isset($_REQUEST['shortUrlDomain'])) { if ($k == (int)$_REQUEST['shortUrlDomain']) { echo 'SELECTED'; } } echo '>'; echo $shortUrlDomain['domain']; if ($disabled == true) { echo ' (' . safeOutputToScreen(t('unavailable', 'unavailable')) . ')'; } '</option>'; } echo '</optgroup>'; ?> FUNCTIONS.PHP function getShortUrlDomains() { // if we already have it cached if(defined('_SETTINGS_SHORT_URL_DOMAINS')) { return unserialize(_SETTINGS_SHORT_URL_DOMAINS); } // get connection $db = Database::getDatabase(true); // load from database $domains = $db->getRows("SELECT id, domain, premium_only, status FROM url_domain ORDER BY premium_only ASC, id ASC"); // organise and replace site url $rs = array(); foreach($domains AS $domain) { if($domain['domain'] == '[[[main_url]]]') { $domain['domain'] = _CONFIG_SITE_FULL_URL; } $rs[$domain{'id'}] = $domain; } **MYSQL DATABASE** url_domain (id, domain, premium_only, status, date_created, owner) VALUES (1, '[[[main_url]]]', 0, 'enabled', '2019-03-02 08:13:00', 1) (14, 'coolartistname.site.com', 6, 'enabled', '2020-04-18 19:21:59', 6);
|