619 Posted Topics
Re: <?php include "class.php"; $account = new account(0); $id = $_GET['id']; $u = $_COOKIE['username']; $a = mysql_fetch_array(mysql_query("SELECT * FROM items WHERE id='$id'")); $path = $_SERVER['DOCUMENT_ROOT'].$a['actualPath']; // make sure file exists at this path $fullPath = $path.$_GET['download_file']; if ($fd = fopen ($fullPath, "r")) { $fsize = filesize($fullPath); $path_parts = pathinfo($fullPath); $ext = … | |
Re: This is one of my favorite website: [Click Here](http://www.generateit.net/mod-rewrite/) Here htaccess code is generated based on your selection, you just need to add it in root of your project. | |
Re: Whenever any select input is submitted it will take it's value not label. | |
Re: After urldecode you can use extract function, which will create variable based on array variable. <? $myArray['TIMESTAMP'] = '2012%2d05%2d01T17%3a19%3a07Z'; $myArray['L_LONGMESSAGE0'] = 'This%20transaction%20cannot%20be%20processed'; $myArray['CURRENCYCODE'] = 'Euro'; $myArrayFinal = array_map('rawurldecode',$myArray); extract($myArrayFinal); echo 'Time: '.$TIMESTAMP; echo 'Long Message: '.$L_LONGMESSAGE0; echo 'Currency: '.$CURRENCYCODE; ?> > This%20transaction%20cannot%20be%20processed ![]() | |
Re: If you are adding your php age in cronjob and assuming it will run daily you can use '<=' as shown below query . select email from myusers where WHERE DATE_ADD(FROM_UNIXTIME(prelogin), INTERVAL 30 DAY) <= CURDATE()"; | |
Hi All, Sorry if this question is already asked. After new changes i am not able to judge that if anyone has posted to the thread after me where i have posted. Previously judgement was easy based on circle infront of post title. Now circle remains white bordered even there … | |
Re: Your query is bit not clear. Do you want to save all 3 language names into one array. If user select any language then set selected language in cookie. when page is loaded check cookie value and based on that fetch content.. Is that so?? | |
Re: Try this: <? while($row = mysql_fetch_array($result)) { $one['id'] = $row['id']; $one['name'] = $row['name']; $one['link'] = $row['link']; $one['parent'] = $row['parent']; $thisArray[] = $one; } echo '<pre>'; print_r($thisArray); ?> | |
Re: try to change admin rule with : `RewriteCond %{REQUEST_URI} !/admin` Check if it is working or not? > ck direct access to | |
Re: Make sure any tag doesn't break. Try below code i have used photourl as image src. <div class="body2"> <div class="main"> <section id="content"> <div class="wrapper"> <article class="col1"> <div id="slider"> <?php while($row=mysql_fetch_array($result)) { ?> <img src="<?php echo $row['photourl'] ?>" alt="" title="<strong><?php echo $row['address'] ?></strong><span> <?php echo $row['bathroom'] . " bathrooms," . $row['bedroom'] … | |
Re: How do you insert data? Using mysql_query function or any mysql interface like phpmyadmin? | |
Re: PHP is having good function ctype_alnum, which will do all stuff for you in one line. <?php $username = 'testing123'; if(ctype_alnum($username)) { echo 'Username is valid'; } else { echo 'Username is not valid'; } ?> | |
Re: I am adding code in post, and clicking on reply button. Codes are not highlighted. I thought i don't know how to use code tag but when i refreshed page it shows highlighting. Sorry if this post is repeated question. Also sometimes i need to delete last post.. Will it … | |
Re: Apart from readymade script, if you still want to make your own code: 1) Design database tables. *e.g autoId chatSession fromUserId toUserId message dateTime* 2) There will be one div and one text area for design view. 3) When user type something in textarea and press enter trigger javascript and … | |
Re: [http://www.daniweb.com/web-development/databases/mysql/threads/126510/copying-rows-from-one-table-to-another](http://www.daniweb.com/web-development/databases/mysql/threads/126510/copying-rows-from-one-table-to-another) Just to ask, What is the requirement for moving same data to another table? | |
Re: PHP is server side language while javascript is client side. You can not combine both. If you want to use php functionality in javascript you can use ajax which will send js data to php and will return with php output. What is your exact requirement so that i can … | |
Re: Try below. $query="SELECT admission_no FROM student_info WHERE student_info.admission_no='$admission_no'"; $result=mysql_query($query); $num_rows = mysql_num_rows($result); if($num_rows > 0) { // admission no already exist in system } else { // admission no not exist } | |
Re: It meanse you don't have offers.php in admin folder. Or form action path you have specified is not correct. | |
Re: I don't understand why you have used iframe for image? I think below html will work for your design. <form method="post" name="mainForm" id="mainForm"> <table width="500" border="0" cellpadding="0"> <tr> <td width="21%" align="right" valign="top"><input type="radio" name="selected_option" id="rb1" value="one"></td> <td width="79%" align="left"><input type="image" name="imageField1" id="imageField1" src="img1.png"></td> </tr> <tr> <td align="right" valign="top"><input type="radio" name="selected_option" … | |
Re: have you checked [ this link ?](http://defunkt.io/facebox/) | |
Re: <div align="center" id="footer"><hr class="footerhr" align="center" /> <p> <img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/cityoflosangeles.jpg" /> <img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/losangelesregionalfoodbank.jpg" /> <img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/salvationarmy.jpg" /> <img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/unitedway.jpg" /> <img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/211.jpg" /> <img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/fcbc.jpg" /> <img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/catholiccharities.jpg" /> <img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/countyoflosangeles.jpg" /><br /> <img width="50" … | |
Re: This is simple code for exporting student table to excel. Hope this helps you. [CODE] <? mysql_connect('localhost','root',''); mysql_select_db('test'); $sql = "select name,sirname from student"; // Query Database $result=mysql_query($sql); $filename = 'file.xls'; // Send Header header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download");; header("Content-Disposition: attachment;filename=$filename"); … | |
Re: Use array [] in check box name in form as shown below. [CODE] Orders <input name="orders[]" type="checkbox" value="One" /> One <input name="orders[]" type="checkbox" value="Two" /> Two <input name="orders[]" type="checkbox" value="Three" /> Three [/CODE] Then you need to change php code: [CODE] <?php $name = $_POST['name']; $address = $_POST['address']; $phone = … | |
Re: Try this. [CODE] RewriteEngine On RewriteRule ^user=([^=]*)$ /profile.php?user=$1 [L] [/CODE] | |
Re: You can also do it by using ternary operator. [CODE]<? echo '<td> echo <select name="type"><option value=" ">select the type</option><option value="C" "'.((trim($_POST['ctype2'])=="C")?('selected'):('')).'">Calcium</option><option value="V">Vitamin</option></td> </tr>'; ?>[/CODE] | |
Re: Or before [B]<center><font color="white" size=5>[/B], add this line. [CODE]<br style="clear: both;">[/CODE] ![]() | |
Re: Where is $User_id defined in update_user1.php? Also you need to assign all form's posted variables. e.g. $User_tcno = $_POST['User_tcno']; Then only you can use $User_tcno in update query. | |
Re: check [B]innerHTML[/B] function of javascript. | |
Re: siina, 1) firstly you need to take all html content from site url using [B]file_get_contents[/B]. 2) Then find all image tags from html source using [B]preg_match_all[/B]. 3) have a loop of images array and again use [B]file_get_contents[/B] function to grab image source and save it in your folder. | |
Re: [CODE] if (isset($_POST['submit'])) // when form is submitted { if($_SESSION['item']==$_POST['h1']) // if "h1" input's value is same as item stored in session (2*: see below) { $_SESSION['qty'] = $_SESSION['qty'] + 1; // then increament qty stored in session } else // if h1's value is not matching with session (1*: … | |
Re: Normally there are two used of functions. 1) Just call function abstractly, and you don't need anything from function. e.g. [CODE] function echoSum($a,$b) { $c = ($a+$b); echo "Sum is :".$c; } //==== some php code ===== echoSum($a,$b) // function output is not required further //==== some php code ===== … | |
Re: What are the functions you are using before inserting data in mysql? Are you using add_slashes? | |
Re: I have created this function. You can use it or customize it as per requirement. [CODE] <? function dateDifference($date1, $date2) { $date1=strtotime($date1); $date2=strtotime($date2); $diff = abs($date1 - $date2); $day = $diff/(60*60*24); // in day $dayFix = floor($day); $dayPen = $day - $dayFix; if($dayPen > 0) { $hour = $dayPen*(24); // … | |
Re: Don't use $_POST for file input field. You need to use $_FILES['p_logo']['name'] for file name. and store that name in database. When you want to display image fetch filename from database and concate with $target_path. e.g. <img src="<?php echo $target_path.$file_name;?>" /> | |
Re: what is below code ?[CODE]$f = function ($d) // f) $g = function ($d) { $e++; }[/CODE] What you want to do with this lines? | |
Re: I am using jqPrint from here : [URL="http://plugins.jquery.com/project/jqPrint"]http://plugins.jquery.com/project/jqPrint[/URL] Demo will not work but download file and try it. You just need to use any selector. i.g. div id. | |
Re: 1) If [B]code_block.php[/B] is in parent folder then only use [B]include('../code_block.php')[/B] if both files are at same folder then use [B]include('code_block.php')[/B] 2) You need to create $code_block variable in code_block.php in order to use it in page.php [CODE]<? $code_block = 'html html... but here i need an include html html... … | |
Re: I am not codeIgniter programmer but you can use ajax to call one php page that will load result. | |
Re: Where is [B]settings.inc.php[/B] in included? In index.php OR includes.inc.php? And what is the order of include coding? | |
Re: When your form is submitted use urlencode in following way before inserting into database. [CODE]$comment = urlencode($_POST['comment']);[/CODE] I think it should not cutoff with &, What is field type of comment in database? | |
Re: [CODE]echo '<td><a onclick="return confirm('Are you sure want to delete?');" href="teachers_delete.php?Course_Id=' . $row['Course_Id'] .'" ><img src="images/delete.gif" /></a></td>';[/CODE] | |
Re: You are fetching images based on categoryid passed in link [B]viewproduct_by_category.php?categoryid=1[/B]. So when you click next link url should also have categoryid i.e. [B]viewproduct_by_category.php?categoryid=1&page=2[/B]. Check in your coding whether you are getting it or not. | |
Re: check [B]Draggable[/B] and [B]Effects[/B] at this link [URL="http://jqueryui.com/demos/"]http://jqueryui.com/demos/[/URL]. You need to customize jquery based on your requirement. | |
Re: [CODE]onchange="window.location.href='http://www.mysitehere.com/subfolder/subfolder1/subfolder3/'+this.value;"[/CODE] | |
Re: Check this code. [CODE]<? session_start(); $sendAfter = (10)*(60); // in seconds $sendEmail = false; $now = date('Y-m-d H:i:s'); if(!isset($_SESSION['sent_time'])) // if you are first time send email { $sendMail = true; $_SESSION['sent_time'] = $now; } else { $diff = strtotime($now) - strtotime($_SESSION['sent_time']); if($diff >= $sendAfter)// if difference is more than … | |
Hi Friends, I am working on php from builder, where user can add text-box, text-area, chekbox, radio-button etc field using jQuery. Now i am ready with html code of form. Next step is to save each attributes(i.e. name, optionstags, label, title, tooltip, class etc) in mysql database. How can i … | |
Re: If you just need image in email body then create email body string which contain img tag. [CODE]<?php emailBody = '<img src="http://images.daniweb.com/logo.gif" />'; ?>[/CODE] Check this example for help : [URL="http://in.php.net/manual/en/function.mail.php#example-2935"]http://in.php.net/manual/en/function.mail.php#example-2935[/URL] | |
I have one index.php file that is on abc.com server. Here in index file i have frameset and src of that is : 'http://www.xyz.com/login.php' All my php files are on xyz.com. What i am having problem is when user open url : abc.com And they get login page. they are … | |
Hello All, I wand Firefox to remember my password when i login in phpmyadmin. But Firefox doesn't ask me to 'Remember password'. When i inspect phpmyadmin form using developer tool, i done see any trick. Secondly i also want in my website coding that when user log in Firefox don't … | |
Hi Pals, I am using filezilla and i heard that it causes virus attacks on my website. I am also not saving password in site manager rather using quick connect. From some days m using core FTP. What do you guys think. What is secure way? Regards, Vibha |
The End.