- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 12
- Posts with Upvotes
- 12
- Upvoting Members
- 11
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
- Interests
- Programmnig
84 Posted Topics
Re: Hi, Replace your javascript function with this below function. [CODE]function updateText() { var dd = document.getElementById("book_id"); var ddtext = dd.options[dd.selectedIndex].text; var sp_ddtext = ddtext.replace(/[^ a-zA-Z]+/g,''); document.getElementById("book_name").value = sp_ddtext; }[/CODE] | |
Re: Use javascript or jQuery to add every rows totalrate value and show it in a total value. Providing some code may help to fix ur problem. ![]() | |
![]() | Re: Hi, Replace the 3rd line with the below code. [CODE]file_put_contents($file,$data,FILE_APPEND);[/CODE] The third parameter need to be set in [I]file_put_contents[/I] to append with existing data. otherwise it would overwrite the existing file contents. check the manual [URL="http://php.net/manual/en/function.file-put-contents.php"]file-put-contents[/URL] |
Re: Hi, As you are using the built in PEAR php class, you need to give an absolute path of the class. Change this instead of the first line, [CODE] include("adodb/adodb.inc.php"); [/CODE] For your info, [URL="http://phplens.com/adodb/"]adodb[/URL] | |
Re: You can use the input values by array as mentioned below, <input type="checkbox" name="facility[]" value="gym"/> Gym<br /> <input type="checkbox" name="facility[]" value="cardio" /> Cardio <br /> ... and using php you can get the values thorugh a simple foreach loop, foreach($_GET['facility'] as $val) { echo $val . ","; // prints weightloss,weightgain... … | |
Re: You can use [URL="http://php.net/manual/en/function.wordwrap.php"]wordwrap[/URL] function in php to break the strings in to new line. [CODE] wordwrap($comment, 20, "<br />\n") [/CODE] | |
Re: You could not use the $_GET variables into the include funtion. You can get it done by the following method... [CODE]$_GET = array(); $_GET['buyer'] = $lastid; $_GET['oid'] = $oid; $_GET['bid'] = $bid; include('Code.php');[/CODE] [URL="http://php.net/manual/en/function.include.php#76675"]Ways to set $_GET variables into local includes.[/URL] | |
Re: Could you post also the html part? and also whether the file is uploaded to your $targetpath successfully ? | |
Re: @Buppy, Did you check whether the session value is assigned and accessed ? Use cakephp's native session method to access session values. try [I]print_r($this -> Session -> read());[/I] to check the session varaible is assigned or not. Use cakephp's native method to get the session value, [CODE]$this -> Session -> … | |
Re: You need to loop through the fetching records when you are having more than one record from your table, or if you want the quote value of last inserted record, then you can use [I]order by[/I] and [I]limit[/I] to get the last inserted quote value. [CODE]$query_lastQuote = "SELECT * FROM … | |
Re: You need to implement a cron job in codeigniter. You can get [URL="http://codeigniter.com/wiki/Cron_job_bootstrapper/"]Cron job bootstrapper[/URL] file to work with cron in codeigniter. A simple example of below link will help you, [URL="http://www.okadadesign.no/blog/codeigniter/creating-a-simple-cron-job-with-codeigniter/"]Simple Cron job with Codeigniter[/URL] | |
Re: Check whether error_reporting is On from your php.ini file by simply printing phpinfo(). If not, then set it to On. | |
Re: You can use [B]$_SERVER['REMOTE_ADDR'][/B] to get ip address of visitors. | |
Re: Before start, You need to know what is MVC and how it works in Joomla. I think you have some solid knowledge about how the things works in joomla. Go through the below links to create our custom component using mvc. [URL="http://www.vojtechovsky.net/joomla/component-helloworld-2-create-tutorial-guide-en.html"]helloworld component in joomla[/URL] [URL="http://www.mightyextensions.com/knowledge-base/joomla-tutorials/item/developer-center/44-component-mvc-ajax/758-joomla-hello-world-mvc-component-tutorial"]joomla-hello-world-mvc-component-tutorial[/URL] Look around to google … | |
Re: To upload pdf, word, excel files you need to add the files types of the files like below, [CODE] if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "application/pdf") || ($_FILES["file"]["type"] == "application/msword") || ($_FILES["file"]["type"] == "application/vnd.ms-excel")) && ($_FILES["file"]["size"] < 20000000)) [/CODE] | |
![]() | Re: Hi TechySafi, For this kind of situation, sure you can approach via looping. By exploding every value stored in an array, using [I]foreach[/I] you can get the values. [CODE] $data = "email@yahoo.com,go@gmail.com,example@example.com"; $emails = explode(",", $data); foreach($emails as $email) { echo $email." "; } [/CODE] ![]() |
Re: If you want to show the random rank data, then use [URL="http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand"]rand()[/URL] in mysql, [CODE]$data = mysql_query("SELECT * FROM table ORDER by rand() LIMIT 10");[/CODE] ![]() | |
Re: I think Tes_ID is common for both tables. If so, try with the below query. [CODE]DELETE FROM test as t1 WHERE t1.Tes_ID = '$Tes_ID' AND t1.Tes_ID IN (SELECT t2.Tes_ID FROM question as t2 WHERE t2.Tes_ID = '$Tes_ID')[/CODE] | |
Re: Hi puvi, Do you have [I]session_start()[/I] in your generatepdf.php ? | |
Re: Hi zeeshan, You could try using this method below, [CODE]$arr3 = array(); foreach($arr2 as $key => $val) { if(in_array($val, $arr1)) { $arr3[$val] += 1; // Increments the value if its found } } echo "<pre>"; print_r($arr3); echo "</pre>"; $mobile = $arr3[$arr1[0]]; // Mobile $shop = $arr3[$arr1[1]]; // shop $query="update table … | |
![]() | Re: [CODE]$query=" SELECT * FROM vessel,cargo,customer WHERE vessel.id=cargo.id AND vessel.id=customer.id ORDER BY ladate DESC LIMIT $eu, $limit";[/CODE] ![]() |
Re: Hi, As R0bb0b suggested you can use date() and strtotime() functions in php to format the date. [CODE] $d1 = "2011-11-15"; echo date("Y-M-d", strtotime($d1)); // 2011-Nov-15 echo date("M d Y", strtotime($d1)); // Nov 15 2011 [/CODE] From your question, i think you need to increment the month from the given … | |
Re: You can append [B]image/png[/B] to filter the png image type. [CODE]if($type=="image/jpeg" || $type=="image/png")[/CODE] This will upload both jpeg and png image types. [URL="http://www.w3schools.com/PHP/php_file_upload.asp"]php file upload[/URL] | |
Re: First of all, You need to understand what is sessions in php. Click the below links to find out how you can access sessions in php. [URL="http://www.php.net/manual/en/book.session.php"]php sessions[/URL] [URL="http://php.about.com/od/advancedphp/ss/php_sessions.htm"]session examples[/URL] | |
Re: Where is your form tag part. Post your html part.. | |
Re: This should check the username must start with 4 digit letter followed by numbers or letters. [CODE]preg_match('/^[A-Za-z]{4}[A-Za-z0-9]+$/', $username, $matches);[/CODE] | |
Re: Put this in top of the page where you have the header redirect part. [CODE]ob_start();[/CODE] [B][URL="http://php.net/manual/en/function.ob-start.php"]ob_start()[/URL][/B] This function will turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer. | |
Re: Using XPDF Package, [URL="http://davidwalsh.name/read-pdf-doc-file-php"]Read pdf,doc files using php[/URL] and using FPDF & FPDI, [URL="http://www.setasign.de/products/pdf-php-solutions/fpdi/"]fpdi[/URL] | |
Re: To list all files from a current directory try with this below code, [CODE]// open the current directory by opendir $handle=opendir("."); while (($file = readdir($handle))!==false) { echo "$file <br>"; } closedir($handle);[/CODE] Try changing the opendir with which pepople selected folder to get the list of the selected directory. | |
Re: Hi, You can embed php values inside a html page by using php shortcut, [CODE]<?=$shortcut;?>[/CODE] Remember, for this short open tags (short_open_tag) must be enabled in php.ini file. And another ways of using the php variables, [CODE]<?php echo $shortcut; ?> and <? echo $shortcut; ?>[/CODE] | |
Re: Hi, Where is that $id comes from in update statement ? just put print_r($quantity) after the first for loop to check how many values available in $quantity array.. You are only doing the $quantity array for updating the records, how about if it contains empty records and if other $_POST … | |
| |
Re: Hi, Using php you can accomplish this using date() function like below, [CODE]$date = date("Y-m-d H:i:s"); $query = mysql_query("insert into tablename (`dated`) values ('".$date."')");[/CODE] Another way using mysql function now(), [CODE]$query = mysql_query("insert into tablename (`dated`) values (now())");[/CODE] Provide some info about your table structure, it could help to find … | |
Re: Hi, The problem is in defining the uploading directory (REPOSITORY). Try changing by adding document_root path to the REPOSITORY url. [CODE]define("REPOSITORY", $_SERVER['DOCUMENT_ROOT']);[/CODE] Now the files will upload to the document root path. By concatenating the document root path with your specified directory, the images will upload to that directory (/parctice/test/htdocs). … | |
Re: Why do you need to have multiple forms where the forms contain same action ? Make a single form request where you have all requests to the same action page. Add validations to mandatory fields. | |
Re: Hi, Make the textarea field like sudeepjd said, [CODE]<textarea id='discuss_text_<?=$<?php echo $row['id']; ?>' name='discuss_text'></textarea>[/CODE] and using jquery you can get the dynamic ids using this, [CODE]$(document).ready(function(){ $("form#post_reply").submit(function() { $("textarea[id^='discuss_text_']").each(function() { var discuss_id = parseInt(this.id.replace("discuss_text_", "")); var diszuss_id_value = $('#discuss_text_'+id).attr('value'); }); return false; }); });[/CODE] | |
Re: Could you post the url's that you are trying to post via textarea ? | |
Re: Hi, The problem is in the concatenation of the string with the double quotes in <a href>. Replace the existing line 36 with this, [CODE]$rainbowmsg .= "<a href='".trim($links[$i])."'><font color=\"".$out[$i]."\">$letter</font></a>";[/CODE] If you use the spaces between the values which is in array, use [URL="http://in2.php.net/manual/en/function.rawurldecode.php"]rawurldecode[/URL] in php to work that values. | |
Re: You have missed something that assigning the size values in to the hidden element. [CODE]echo '<input type="hidden" name="size" />';[/CODE] to be [CODE]echo '<input type="hidden" name="size" value="'.$size.'" />';[/CODE] and assign [I]$totalorder=0[/I] before starting the for loop. | |
Re: @tcollins, just include [CODE]ob_start();[/CODE] at the top of the page. [URL="http://php.net/manual/en/function.ob-start.php"]ob_start()[/URL] | |
Re: You need to escape the single quotes in function call. [CODE]<a href="#" class='link' onFocus='if(this.blur)this.blur()' onclick="change_content('imagediv', '<img src='images/painting_<? echo $paintingBack; ?>.jpg'>');"><img src='images/braceL.gif' alt='brace' width='20' height='11' valign='text-bottom'/></a>[/CODE] | |
Re: mysql_real_escape_string escapes only following characters to prevent sql injection, \x00, \n, \r, \, ', " and \x1a. You can use strip_tags to add particular tags to your processing comment. [CODE]strip_tags($_POST['comment'], '<u></u><i></i><b></b>'); // Allow <u></u><i></i><b></b>[/CODE] [URL="http://in3.php.net/manual/en/function.strip-tags.php"]strip_tags[/URL] | |
Re: @mamari, Show us the query that you are trying to execute. | |
Re: I never tried this before in codeigniter, but i think the below url will help. [URL="http://www.scottnelle.com/41/extending-codeigniters-validation-library/"]Extending-codeigniters-validation-library[/URL] | |
Re: SELECT DATE_FORMAT( curdate( ) , '%M %e, %Y' ) AS showdate [URL="http://www.mysqlformatdate.com/"]Mysql Format Date[/URL] or in php you can get by using, [CODE]date("F j, Y", strtotime($res['news_date']));[/CODE] | |
Re: The problem is that you are trying to get [I]$_POST[/I] value by using [I]$_GET[/I] method. Try changing your code in line 70 by modifying, [CODE]$Sname=$_POST["name"];[/CODE] Go through the [URL="http://www.php.net/manual/en/reserved.variables.php"]Predefined variables in PHP[/URL] | |
Re: You can make it by assigning the table column as array key. [CODE]while ($rows=odbc_fetch_array($result)){ $DATA[$rows['date']]=$rows['totalin']; } print_r($DATA); [/CODE] | |
Re: Checkout the below thread.. [URL="http://www.daniweb.com/forums/thread47922.html#post1233384"]PHP Joomla[/URL] | |
Re: You may check the [URL="http://www.datatables.net/"]jquery datatables[/URL] plugin to create a grid view of php dynamic pages. It simply creates the grid view with sorting (asc,desc) of all columns, search query and pagination. The only thing is you need to set up the credentials. | |
Re: Find the below link to know about php server side validations. [URL="http://www.php-mysql-tutorial.com/wikis/php-tutorial/form-validation-using-php.aspx"]form-validation-using-php[/URL] |
The End.