No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
TomatoCMS, an open source PHP CMS powered by Zend Framework, jQuery and 960grid
7 Posted Topics
Re: Name the form elements as array by using [] at the end of name property. 1) Form: [CODE=php] <?php while (&row=mysql_fetch_array($reclooptbl)) { ?> <tr> <td><input type="text" name="ratings[]" /></td> <td><input type="text" name="courseIds[]" value="<?php echo $row['courseid']; ?>" /></td> </tr> <?php } ?> [/CODE] 2) Process form when user click on submit button: … | |
![]() | Re: Try this: [CODE=sql] UPDATE your_table SET age_field = IF(age_field < DATEDIFF(DATE_FORMAT(now(), '%Y-%m-%d'), created_date), DATEDIFF(DATE_FORMAT(now(), '%Y-%m-%d'), created_date), age_field); [/CODE] |
Re: Check the length of the field you want to insert. If length of this filed is 2, so it should insert "on" instead of full string as "On Process". | |
Re: [code=php] $answers = $_POST['answer']; // Loop through it for ($i = 0; $i < count($answers); $i++) { echo $answers[$i].'<br />'; } [/code] | |
Re: You have to use global keyword for variable if it has been defined out of function. So, the following code should work: [CODE=php] $filename = "names.txt"; $data = array(); $key = 1; # get the data from current file if (file_exists($filename)) { $data = parse_ini_file($filename, true); } function txtupdate($k) { … | |
Re: Change your query string from [code=php] $query = "SELECT userid, username, password, userdesc FROM login WHERE (UserName='$u' AND Password='$p') and DelCategory='0'"; [/code] to: [code=php] $query = "SELECT userid, username, password, userdesc FROM login WHERE (UserName='".addslashes($u)."' AND Password='".addslashes($u)."') and DelCategory='0'"; [/code] Here I added slashes for parameters before executing query to … | |
Re: Try this: 1) Make a HTML more clear by using three separated fields for DOB filed: [code=php] <select name="yearOfBirth"> <option value="">---Select year---</option> <?php for ($i = 1980; $i < date('Y'); $i++) : ?> <option value="<?php echo $i; ?>"><?php echo $i; ?></option> <?php endfor; ?> </select> <select name="monthOfBirth"> <option value="">---Select month---</option> … |
The End.