619 Posted Topics

Member Avatar for ankit.pandey3
Member Avatar for diafol
0
97
Member Avatar for karthik_ppts

You can get query string parameter using $_GET. [CODE] echo '<pre>'; print_r($_GET); [/CODE]

Member Avatar for karthik_ppts
0
2K
Member Avatar for joomphp

[URL="http://brenelz.com/blog/how-to-create-a-simple-api-with-php-and-mysql/"]check here[/URL] it might help you

Member Avatar for joomphp
0
71
Member Avatar for dalip_007

[URL="http://plugins.learningjquery.com/expander/demo/index.html"]check this[/URL] This is exactly what you want !

Member Avatar for vibhaJ
0
63
Member Avatar for nitnayak
Member Avatar for cliffcc

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 = …

Member Avatar for digital-ether
0
181
Member Avatar for abhi10kumar

There is ';' after if condition line# 6.Remove it. What you exactly want? you want to replace </div> with <br> tag?

Member Avatar for vibhaJ
0
118
Member Avatar for prakashghai

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]

Member Avatar for vibhaJ
0
118
Member Avatar for s7mo

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" …

Member Avatar for vibhaJ
0
1K
Member Avatar for juanitobunito

Where is the select query for question table? Post that query and also any error is you getting.

Member Avatar for diafol
-1
86
Member Avatar for rkayd

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 …

Member Avatar for rkayd
0
137
Member Avatar for dalip_007

This code return array of emails. [CODE] <? $str = '"ceo@facekut.com" <ceo@facekut.com>,"Rahul Mahajan" <creative.rahul007@gmail.com>'; $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]

Member Avatar for dalip_007
0
167
Member Avatar for LloydFarrell

'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;

Member Avatar for vibhaJ
0
201
Member Avatar for hotice47

Remove isset from $_REQUEST['checkbox'] in delete code. [CODE] $checkbox = $_REQUEST['checkbox']; $countaa = count($checkbox); [/CODE]

Member Avatar for coolest_987
0
150
Member Avatar for anooptech

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 …

Member Avatar for vibhaJ
0
143
Member Avatar for saiprem
Member Avatar for Mars1936

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]

Member Avatar for Mars1936
0
318
Member Avatar for ahsan1

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.

Member Avatar for Ezzaral
0
313
Member Avatar for ahsan1
Member Avatar for KamranArshad
0
375
Member Avatar for jack jastin

Your question is unclear. You just want to change or hide extension of file on website?

Member Avatar for metalix
0
110
Member Avatar for Buppy

Give class 'alltr' to all tr. And then try below code. [CODE] $("#idtext").change(function(){ $('.alltr').hide(); $('#'+$("#idtext").val()).show(); }); [/CODE]

Member Avatar for Buppy
0
219
Member Avatar for youvi

Why don't you try php code. [CODE] <? $temp = explode('_', $option); unset($temp[count($temp)]); $option = implode('_', $temp); ?> [/CODE]

Member Avatar for diafol
0
95
Member Avatar for vibhaJ

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 …

Member Avatar for diafol
0
90
Member Avatar for patrickm129

[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.

Member Avatar for happytogether
0
111
Member Avatar for GreaseJunkie

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.

Member Avatar for GreaseJunkie
0
260
Member Avatar for black_berry

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.

Member Avatar for tinymark
0
120
Member Avatar for sanjaypandit

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]

Member Avatar for diafol
0
134
Member Avatar for dr.4030

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 …

Member Avatar for vibhaJ
0
104
Member Avatar for rohittripathi

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 …

Member Avatar for vibhaJ
0
3K
Member Avatar for vingan

post your list.txt content. Will give you exact code to create drop down from that file.

Member Avatar for vingan
0
190
Member Avatar for ankit.pandey3

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.

Member Avatar for madCoder
0
155
Member Avatar for ankit.pandey3

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> …

Member Avatar for vibhaJ
0
127
Member Avatar for CEVGames

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"; } …

Member Avatar for CEVGames
0
129
Member Avatar for joandong2

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 * …

Member Avatar for joandong2
0
182
Member Avatar for coxdabd

Debug code using: echo $mail_body = $htmlContent; exit; See what you have in browser.

Member Avatar for coxdabd
0
124
Member Avatar for ankit.pandey3

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]

Member Avatar for ankit.pandey3
0
646
Member Avatar for whiteyoh

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]

Member Avatar for vibhaJ
0
101
Member Avatar for aksshe10

Check with this code. What it alerts? [CODE] $.post("ajax.php", { Name:'doodle', Fathers_name:'anything' }, function(data){ alert(data); } ); [/CODE]

Member Avatar for vibhaJ
0
82
Member Avatar for Hridayesh

Restart apache and check phpinfo() function for memory_limit field. You can also set it as -1 for no limits.

Member Avatar for vibhaJ
0
62
Member Avatar for rolyestemonio

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 …

Member Avatar for rolyestemonio
0
174
Member Avatar for phpDave

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 …

Member Avatar for vibhaJ
0
54
Member Avatar for lit108

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 …

Member Avatar for lit108
0
179
Member Avatar for nikc121

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.

Member Avatar for vibhaJ
0
141
Member Avatar for the_mia_team

Firstly crosscheck whether register entry is done in database table or not? Dude your php coding is in checklogin.php. So post that code...

Member Avatar for vibhaJ
0
231
Member Avatar for sickpuppy18
Member Avatar for rolyestemonio

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....

Member Avatar for vibhaJ
0
104
Member Avatar for zeeshan_kust

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.

Member Avatar for vibhaJ
0
148
Member Avatar for sugikrish

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" …

Member Avatar for billy147
0
241
Member Avatar for ryan-t

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]

Member Avatar for ryan-t
0
119
Member Avatar for andrewliu

Why dont you write mysql query in index.php itself. Or post your code, lets see what u r trying with code.

Member Avatar for hielo
0
312

The End.