619 Posted Topics
Re: Have you checked database value? Database contain more than 40 char? ![]() | |
Re: You can get query string parameter using $_GET. [CODE] echo '<pre>'; print_r($_GET); [/CODE] | |
Re: [URL="http://brenelz.com/blog/how-to-create-a-simple-api-with-php-and-mysql/"]check here[/URL] it might help you | |
Re: [URL="http://plugins.learningjquery.com/expander/demo/index.html"]check this[/URL] This is exactly what you want ! | |
Re: Have some patience and dont repeat thread... :) | |
Re: I use this code found from one forum. Hope this helps you. [CODE] <?php if (!isset($_POST["timezoneoffset"])){ ?> <form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" id="time_form" name="time_form"> <script type="text/javascript"> tzo = - new Date().getTimezoneOffset()*60; document.write('<input type="hidden" value="'+tzo+'" name="timezoneoffset">'); </script> <input type="submit" value="Get Server Client TimeZone Difference" name="Ok"> </form> <?php }else{ $serverTimezoneOffset = … | |
Re: There is ';' after if condition line# 6.Remove it. What you exactly want? you want to replace </div> with <br> tag? | |
Re: You don't need below code.It is generating problem. Remove it and then run. [CODE] if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } [/CODE] | |
Re: below is code. with the help of [URL="http://in.php.net/manual/en/function.in-array.php"]in_array[/URL] function. [CODE] <? $childarr = explode(",", $row["children_pref"]); ?> <input type="checkbox" name="children_pref[]" value="0" <?=(in_array('0',$childarr))?('checked'):('');?> >None<br> <input type="checkbox" name="children_pref[]" value="1" <?=(in_array('1',$childarr))?('checked'):('');?>> 1<br> <input type="checkbox" name="children_pref[]" value="2" <?=(in_array('2',$childarr))?('checked'):('');?>> 2<br> <input type="checkbox" name="children_pref[]" value="3" <?=(in_array('3',$childarr))?('checked'):('');?>> 3<br> <input type="checkbox" name="children_pref[]" value="4" <?=(in_array('4',$childarr))?('checked'):('');?>> 4<br> <input type="checkbox" name="children_pref[]" value="5" … | |
Re: Where is the select query for question table? Post that query and also any error is you getting. ![]() | |
Re: First code: use window.location.href [CODE] <head> <script type="text/javascript"> function alertSize() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant … | |
Re: This code return array of emails. [CODE] <? $str = '"[email protected]" <[email protected]>,"Rahul Mahajan" <[email protected]>'; $pattern = '/<([^"]*)>/'; preg_match_all($pattern, $str, $matches, PREG_OFFSET_CAPTURE, 3); foreach($matches[1] as $val) { foreach($val as $key=>$each) { if($key==0) $email[]=$each; } } print_r($email); ?> [/CODE] | |
Re: 'select' tag can not have value. Value is only for 'option'. When form is submitted add this php code to debug it. echo $_POST['wex']; exit; | |
Re: Remove isset from $_REQUEST['checkbox'] in delete code. [CODE] $checkbox = $_REQUEST['checkbox']; $countaa = count($checkbox); [/CODE] | |
Re: I have made this function after mane efforts. This will surely help you. select is a function which will return two dimension array from query. [CODE] function catArray($id,$dash,$separate='__') { $resCat = select("select * from category where parentId=".$id); for($i=0;$i<count($resCat);$i++) { $con=''; for($j=1;$j<$dash;$j++) $con.=$separate; $arr[$resCat[$i]['categoryId']] = $con.$resCat[$i]['name']; $temp = select("select * from … | |
Re: can you please post code! | |
Re: Check this, if it helps you. [URL="http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand"]http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand[/URL] | |
Re: foreach takes array as an argument. $values must be an array.echo $value and you will know that. html field name should be 'check[]' will make $values an array. | |
Re: [url]http://www.daniweb.com/web-development/php/threads/357864[/url] | |
Re: Your question is unclear. You just want to change or hide extension of file on website? | |
Re: Give class 'alltr' to all tr. And then try below code. [CODE] $("#idtext").change(function(){ $('.alltr').hide(); $('#'+$("#idtext").val()).show(); }); [/CODE] | |
Re: Why don't you try php code. [CODE] <? $temp = explode('_', $option); unset($temp[count($temp)]); $option = implode('_', $temp); ?> [/CODE] ![]() | |
Hello All, I am having one email template code as shown below. [CODE] <table width="400" border="0"> <tr> <td><strong>Id</strong></td> <td><strong>Name</strong></td> <td><strong>Address</strong></td> </tr> <tr> <td>##ID##</td> <td>##NAME##</td> <td>##ADDRESS##</td> </tr> </table> [/CODE] Site administrator manage this. Now i want php code to dynamic replace [B]##key##[/B] code. It is simple for one record but here … ![]() | |
Re: [CODE] //Accesses users $query = mysql_query("SELECT * FROM users WHERE login='$username'"); //Checks if users do not exist (Checks rows) if($query) { $num_result = mysql_num_rows($query); echo $num_result; } else { echo 'No result in select query'; exit; } [/CODE] Try this and post output. | |
Re: Hi, First of all you need email access information of accounts you want to grab. It can be done using PHP IMAP. [URL="http://davidwalsh.name/gmail-php-imap"]Check this link[/URL] Once you have emails in php variables insert into your mysql database. Hope this helps. | |
Re: Try to debug your code. Add below code at line#11 [CODE] echo $itemsql; exit; [/CODE] Use that query and run in phpmyadmin. Check output result. | |
Re: Check this code.. let me know output. [CODE] <? $sqlQuery=mysql_query("select * from tbl_page_detail where page_name='Home'"); $sqlArr=mysql_fetch_array($sqlQuery); $cat = $sqlArr['page_cat']; $sql = "select * from tbl_category where cat_id IN ($cat)"; $res = mysql_query($sql); $str = ''; while($sar = mysql_fetch_assoc($res)) { $str.=','.$sar['cat_name']; } echo 'Category Names : '.$str; ?> [/CODE] ![]() | |
Re: 1) when you save news also save expire date in database.e.g. <? $expDate = date('Y-m-d H:i:s', mktime(date("H"), date("i"), date("s"), date("m") , date("d")+7, date("Y"))); // expire after 7days ?> 2) where ever you are showing news in select query filter expire date for fetching news from db.e.g. <? $currDate = date('Y-m-d … | |
Re: Heres a code: Try it... [CODE] <script language="javascript" type="text/javascript"> function toggleMe(val) { var designation = document.getElementById('designation'); var organization = document.getElementById('organization'); if(val=='Trainee') { designation.style.display = "none"; organization.style.display = "none"; } else { designation.style.display = "block"; organization.style.display = "block"; } } </script> <select name="select" onchange="toggleMe(this.value)"> <option value="0">Select any one</option> <option value="Trainee">Trainee</option> <option … | |
Re: post your list.txt content. Will give you exact code to create drop down from that file. | |
Re: You can identify exact mysql error by using below code. [CODE] $result=mysqli_query($dbc,"insert into events (Title,City,Content,Photo,Date) values ('$Title','$City','$Content','$path','$Date')") or die(mysql_error()); [/CODE] Exact error will guide you. | |
Re: Your while loop is not proper. See below code. [CODE] elseif(isset($_POST['EventId'])){ require_once('database.php'); $Search=$_POST['Search']; $query="select * from participation where EventId ='$Search'"; $result=mysqli_query($dbc,$query) or die('Not Connected'); while($row=mysqli_fetch_array($result)) { $LoginId= $row['LoginId']; echo $LoginId; $query="select * from registration where LoginId='$LoginId'"; $resultReg=mysqli_query($dbc,$query) or die('Not Connected to Reg'); while($rowReg=mysqli_fetch_array($resultReg)) { echo "<table border='2'><tr><td> Name--".$rowReg['Name']."</td> <td>Contact Number--".$rowReg['ContactNumber']."</td> … | |
Re: You mean user is not redirected to play.php even he is valid user? [CODE] <? { $username = mysql_real_escape_string($username); $password = md5( mysql_real_escape_string($password) ); $sql = mysql_query("SELECT * FROM usersystem WHERE username = '$username' AND password = '$password' LIMIT 1"); $rows = mysql_num_rows($sql); if ($rows<1) { echo "&serverResponse=Incorrect username/password"; } … | |
Re: Try below code. Here i have used session to remember previous items. [CODE] <? session_start();?> <title> SALES </title> <body> <form action="index.php" method="post"> ENTER ID: <input type="text" name="item" /> <input type="submit" name="submit" value="submit"/> <input type="submit" name="refresh" value="refresh" meta http-equiv="refresh" /> </form> <?php include("connection.php"); if(isset($_POST['submit'])){ $sel_item = $_POST['item']; $query = "SELECT * … | |
Re: Debug code using: echo $mail_body = $htmlContent; exit; See what you have in browser. | |
Re: Check this page, if it helps you. If you dont want to show button on print then call printpage function on body tag onload. [CODE] <html> <head> <title>New Page 1</title> <script language="javascript"> function printpage() { window.print(); } </script> </head> <body> <form> <input type="button" value="Print" onclick="printpage();"> </form> </body> </html> [/CODE] | |
Re: Why dont you try jquery. Its easy to use. Check this code. [CODE] <html> <body> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"> <script language="javascript" type="text/javascript"> function ajaxFunction(age,wpm,sex) { $.ajax({ url: 'example.php?age='+age+"&wpm="+wpm+"&sex="+sex, success: function(data) { $('.ajaxDiv').html(data); } }); } </script> <input type='button' onclick='ajaxFunction(1,2,3)' value='Query MySQL' /> <div id='ajaxDiv'></div> </body> </html> [/CODE] | |
Re: Check with this code. What it alerts? [CODE] $.post("ajax.php", { Name:'doodle', Fathers_name:'anything' }, function(data){ alert(data); } ); [/CODE] | |
Re: Restart apache and check phpinfo() function for memory_limit field. You can also set it as -1 for no limits. | |
Re: Here is some modification with ur code... [CODE] <?php $last_date = ""; $result = mysql_query("SELECT * FROM tbl_localnews ORDER BY local_date DESC limit 0,10"); while ($row = mysql_fetch_array($result)) { if ($row['local_date'] != $last_date) { print("<h2>News for ".date('F j, Y',strtotime($row['local_date']))."</h2>"); $last_date = $row['local_date']; } print("<p><b>".$row['local_title']."</b></p>"); print("<p>".$row['local_desc']."</p>"); } mysql_free_result($result); ?> [/CODE] Try … | |
Re: For changing image follow below steps: - one php page where user see his/her old uploaded image with browse button. - when user upload image with browse andf click on update button, on server side in php code check if image is valid. - if all is set then firstly … | |
Re: Generally ur php page should be such that all php coding appears on top of page and before html tags. The error you are getting because of there is some thing in output before header function executes. There should be no html tags or blank spaces before header. I think … | |
Re: I think [CODE]while ($i=0; $i < sizeof($file_contents); $i++);[/CODE] Should be [CODE]for($i=0; $i < sizeof($file_contents); $i++)[/CODE] 'for' and no comma at end. | |
Re: Firstly crosscheck whether register entry is done in database table or not? Dude your php coding is in checklogin.php. So post that code... | |
| |
Re: Another thing you can try is serialize data. 1. Create php array with all data you want to save. 2. Serialize that array.[URL="http://in3.php.net/manual/en/function.serialize.php"]Check this for help[/URL] 3. Save this in database. 4. Retrieve database and unserialize it to use that php array again.[URL="http://in3.php.net/manual/en/function.unserialize.php"]check how to unserialize[/URL]. Hope this helps.... | |
Re: Firstly there should be relation between these three table recipe, instructions and ingredients. Here you have selected all records in select query rather you should have select query in ingredients for perticular recipe(e.g. 'where' keyword must be there). post your table structure to make select queries and new code. | |
Re: Same code for multiple textbox and checkbox. [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script language="javascript"> function enableMe(fld) { eval('window.document.formx.'+fld+'.disabled = !window.document.formx.'+fld+'CB'+'.checked'); } </script> </head> <body> <form name="formx" action="" method="post" > <table> <tr> <td> <input type="text" disabled="disabled" name="firstbox" … | |
Re: You dont have to pass username to included php page. e.g. test.php [CODE] $username = $session->username; include('function.php'); [/CODE] Once you have $username on test.php, you can use $username in function.php directly. functions.php [CODE] echo "username is ".$username; [/CODE] | |
Re: Why dont you write mysql query in index.php itself. Or post your code, lets see what u r trying with code. |
The End.