619 Posted Topics
![]() | Re: Debug with this below code. post your output and current error you are getting. [CODE] <? $source = "../upload/".$img; $destination = "../gallery/pic/".$img; if(file_exists($source)) echo '<br />Source exists'.$source; if(file_exists($destination)) echo '<br />Destination exists'.$destination; copy($source , $destination); ?> [/CODE] |
Hi all, My site is on dedicated server by fasthosts.co.uk. i get email from host server that my site has been placed on the Spamhaus SBL. below is the content for that: [CODE] >> Web bot: port 80 >> IP address 217.174.241.205: on fasthosts.co.uk/live-servers.net >> Canadian Pharmacy spammer[s] are using … | |
![]() | Re: I have integrated it once as below. register.php is page where user register to the site. and forum is a sub folder for phpbb placed at root. [CODE] <? /*====================================== my register.php code goes here ========================================*/ //--- phpbb code start ------ echo '<form method="post" style="display:none;" name="frmfrm" id="frmfrm" action="forum/ucp.php?mode=login"> <label for="username">Username: … ![]() |
Re: When your data is inserted to table you should redirect user to new page. [CODE] header("Location:success.php"); exit; [/CODE] Because if you wont then when you press refresh form will be again submitted and again data will be inserted to table. So its better practice to use header when php code … | |
Re: Hi, [URL="http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/"]Check this.[/URL] It might help you. | |
Re: If you are new to PHP better you use downloaded script. [URL="http://www.reconn.us/scripts.html"]Here[/URL] is a php script with demo and download. | |
Re: What you exactly want? Does your posted code works? even partially? And where is html portion? | |
Re: lets say list.php is a page where all article title are shown. [CODE] <? $q="select * from article"; $rs = mysql_query($q); while($sar = mysql_fetch_assoc($rs)) { ?> <a href="article.php?aid=<? echo $sar['id'];?>"><? echo $sar['title'];?></a> <? } ?> [/CODE] When user click on that title you can redirect user to article.php with some … | |
![]() | Re: Echo query below and run in sql window. Does it returning result?? [CODE] echo "SELECT * FROM albums WHERE userid='".$_SESSION['id']."'"; [/CODE] ![]() |
Re: -> You can read your text file and from text file's content you can take first three or four words and use it as file name. -> or use php random function to create random name. [CODE] function getRandomAlphaNumeric($intpLength = 16) { $arrAlphaNumeric = array(); $arrAlpha = range('A','Z'); $arrNumeric = … | |
Re: In below code i have just make drop down selected as 'July'. You can set accordingly. Let me know for further help. [CODE] <html> <meta content= "text/html; charset= utf-8" http-equiv="Content-Type"/> <head> <script type="text/javascript" src="jquery-1.4.2.js"></script> <link rel="stylesheet" href="jquery.datepick.css" type="text/css" /> <script type="text/javascript" src="jquery.datepick.js"></script> <script type="text/javascript" src="fbDateTime.js"></script> <script type="text/javascript"> $(document).ready(function() { // … | |
Hi all, My site is on dedicated server by fasthosts.co.uk. i get email from host server that my site has been placed on the Spamhaus SBL. below is the content for that: [CODE] >> Web bot: port 80 >> IP address 217.174.241.205: on fasthosts.co.uk/live-servers.net >> Canadian Pharmacy spammer[s] are using … | |
Re: session is stored per user wise. So u can not store chat in session as the other user chatting with user can not use each other's session. | |
Re: Below is php code example. If $value is 'c' then it will remain selected .. same for 'a','c','d'. [CODE] <html> <body> <? $value = 'c'; ?> <select> <option <?=($value == 'a')?'selected="selected"':''?> >a</option> <option <?=($value == 'b')?'selected="selected"':''?> >b</option> <option <?=($value == 'c')?'selected="selected"':''?> >c</option> <option <?=($value == 'd')?'selected="selected"':''?> >d</option> </select> </body> </html> … | |
Re: I found this code.. test at your end. [CODE] function postit($host, $url, $postdata) { $fp = pfsockopen ( $host, 80, &$errno, &$errstr, 60 ); if( ! $fp ) return "$errstr ($errno)<br>\n"; fputs ($fp,"POST $url HTTP/1.1\n"); fputs ($fp,"Host: $host\n"); fputs ($fp,"User-Agent: Autopost demonstration script\n"); fputs ($fp,"Accept: */*\n"); fputs ($fp,"Content-type: application/x-www-form-urlencoded\n"); fputs … | |
Re: Check this function for more detail. [URL="http://in.php.net/manual/en/function.mysql-connect.php"]mysql_connect[/URL] | |
Re: What is [B]$form[/B] in insert query? Bcz it doesn't defined in above code. | |
Re: create one session array. when user click on link you can pass veh_id to ajax page. where in ajax page you will add veh_id in session array. And when user checkout it will use session array. | |
Hi all, Here is my htaccess code for url rewrite: [CODE] RewriteRule ^(.*)/test.php$ test.php?language=$1 [NC] [/CODE] which will redirect [url]www.domain.com/english/test.php[/url] to [url]www.domain.com/test.php?language=english[/url] It is working fine... But when i have extra variable with that url then it doesn't work. e.g. [url]www.domain.com/english/test.php?name=abc[/url] should work like: [url]www.domain.com/test.php?language=english&name=abc[/url] But it is not working.. … | |
Re: mysql_query function must be inside foreach loop. [CODE] // Check if button name "Submit" is active, do this if($_POST['Submit']){ foreach($checkbox as $i){ $sql2 = "INSERT INTO assignments SET firstName = '$firstName[$i]', lastName = '$lastName[$i]', AP = '$AP[$i]', last_teacher = '$last_teacher[$i]', description = '$description', subject = '$subject'"; $result2=mysql_query($sql2) or die(mysql_error()); } … | |
Re: Here i have posted code which will work for 5second, you can set urs. [CODE] <html> <head> <script type="text/javascript"> function timedMsg() { var t=setTimeout("redirect()",5000); } function redirect() { alert('5 seconds is completed!'); window.location.href='nextpage.php'; } </script> </head> <body onload="timedMsg()"> exam paper. </body> </html> [/CODE] | |
Re: This is example. [CODE] function highlight($str,$searchText) { return (eregi_replace($searchText, "<span class='highlight'>$searchText</span>", $str)); } $str = 'This is beautiful'; $searchText = 'is'; echo highlight($str,$searchText); [/CODE] Hope this helps. | |
Re: You can do this by htaccess file also. below is the code when user open non existed file then he is redirected to error.php. [CODE] ErrorDocument 404 http://localhost/project/error.php [/CODE] | |
Re: where is starting of form tag in your last code? and where is $count in line no. 28? Post complete page and also error you are getting.... | |
Re: This below code is working at my end. [CODE] <script type="text/javascript"> function GetIst() { var d = new Date() var gmtHours = -d.getTimezoneOffset(); document.write(+ gmtHours); } </script> <? $reminder ="<script language=javascript>GetIst();</script>"; echo $reminder; ?> [/CODE] Bcz your code is merging of js and php. Just refer this : [B]But whenever … | |
Re: This is a php function to avoid sql injection. [CODE] <? function cleanQuery($string) { if(get_magic_quotes_gpc()) // prevents duplicate backslashes { $string = stripslashes($string); } if(phpversion() >= '4.3.0') { $string = mysql_real_escape_string($string); } else { $string = mysql_escape_string($string); } return $string; } // if you are using form data, use the … | |
Re: Just consider beta form as a login page. On home page is session is not set user is redirect to key enter page. If key is properly inserted you can set session and redirect back to home page. You can achieve your requirement by checking and setting simple php sessions. | |
Re: This code shows simple example of query result and array. [CODE] <? $q="select * from user"; $res = mysql_query($q); while($sar = mysql_fetch_assoc($res)) { $arr[]['username'] = $sar['username']; } echo '<pre>'; print_r($arr); ?> [/CODE] | |
I have one link in my webpage where user can call to other skype user. [CODE] <a href="skype:skype_username?call">Call me</a> [/CODE] But when user have not skype installed in their pc one notification popup is coming. Is there any way in any manner i can detect is skype is installed or … | |
Re: JS code runs on client side. If you will give href on "attach more files" that means page is changed. And you can not have count of click. you can add file element dynamically using JS. Below code will give number of click without href. [CODE] <script type="text/javascript"> var max_no_img … | |
Re: It might be some issue in query to passing 'Option Two'. Also check database with having value 'Option Two'. ![]() | |
Re: Post this two values what you are getting at line # 107. -> $_SERVER['DOCUMENT_ROOT'] -> $real_dir; ![]() | |
Re: Images must be stored some where to get it display. It may be 3 case: - you can save image in folder - in database - you can directly use external link like [url]http://www.abc.jpf[/url] as a image src. | |
Re: change line no. 26 to: [CODE] $result = mysql_query($sql) or die(mysql_error()); [/CODE] Check whats wrong in $sql. | |
Re: Because your select query is not returning credits field. Change $drawquery as below. [CODE] $drawquery = mysql_query("SELECT id, credits FROM userstats WHERE `todaysurfed`>=250 AND DATEDIFF(NOW(),`wondaily`) > 30 OR `wondaily`='0000-00-00' ORDER BY rand() LIMIT 3"); [/CODE] | |
Re: This is the simplest way to create doc file. This code is for example using users table. [CODE] <? $fp = fopen("export.doc", 'w+'); $sql = "select * from users"; $res = mysql_query($sql); while($sar = mysql_fetch_assoc($res)) { $str = "<br />Username : ".$sar['username']." Password : ".$sar['password']; fwrite($fp, $str); } fclose($fp); ?> … | |
Re: 1) add new field as sendEmailAlert.make a simple php page where you check if difference between expired_date and current date is greater than 15 and sendEmailAlert is zero. 2) if is is greater than 15 then send a email to that username about expiration and make sendEmailAlert field to one. … | |
Re: What you exactly like to do? You want to add new record in database? By java script you can show dynamic row and by clicking on submit button, using php you can insert that values in database. | |
Re: try some different charset for HTML. [CODE] <meta http-equiv="Content-Type" content="text/html; charset=ISO 8859-1" /> [/CODE] | |
This is my two tables: [CODE] CREATE TABLE `subject` ( `id` int(11) NOT NULL auto_increment, `subjectName` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -- -- Dumping data for table `subject` -- INSERT INTO `subject` (`id`, `subjectName`) VALUES (1, 'Maths'), (2, 'Science'), (3, 'English'), (4, 'Chemistry'); … | |
Re: This code will generate your requires output. [CODE] <? $reminder ="300"; // 5 minutes * 60 seconds (to convert to seconds) $timefromreminder = date('h:i:s', strtotime("-$reminder seconds")); // this will give 5 minutes minus the current time //but what i am looking for is to be able to do this $event_start_time … | |
Re: Check this code. [CODE] <? function timeAfter($timestamp, $granularity=2, $format='Y-m-d H:i:s'){ $difference = $timestamp - time(); if($difference < 0) return '0 seconds ago'; // if difference is lower than zero check server offset elseif($difference < 864000){ // if difference is over 10 days show normal time form $periods = array('week' => … | |
Re: What is exact problem? This form is not working? SigninSubmit function is not defined in current code. Add this code to submit form. [CODE] <script language="javascript"> function SigninSubmit() { document.SigninForm.submit(); } </script> [/CODE] | |
Re: You can pass ItemID as a value. After form submitted you can again fire select query to fetch price of selected item from ItemID. [CODE] <select name="item2" id="item2" onchange="getPrice(this.id)" /> <option value="">Select medicine</option> <?php $sql = "SELECT ItemID, ItemName, Price FROM itemavail ORDER BY ItemName"; $rs = mysql_query($sql); while($row = … | |
Re: $_POST[aspirant_photo] doesn't mean uploaded image will be directly attached.. you have to upload that photo to the server using move_uploaded_file. Then you can give <img src="url of uploaded photo"> in message. | |
Re: Hope this code will help.. u can modify it as per ur requirement. [CODE] <HTML> <HEAD>Try</HEAD> <BODY> <form NAME="myForm"> <input TYPE="button" VALUE="Line Break" ONCLICK="insertString('</br>')"> <input TYPE="button" VALUE="H1 Tag" ONCLICK="insertString('<h1></h1>')"> <br> <textarea NAME="myTextArea" ROWS="5" COLS="100"></textarea> </form> </body> </html> <script LANGUAGE="Javascript"> var globalCursorPos=0; // global variabe to keep track of where the … | |
Re: I have made a code... Try this. Hope this is what you want. [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> </head> <body> <? if(isset($_REQUEST['submit'])) { $col1 = $_REQUEST['col1']; $col2 = $_REQUEST['col2']; $col3 = $_REQUEST['col3']; ?> <table width="100%" border="0" … ![]() | |
Re: Try this: [CODE] <?php /* $Id: contact_us.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US); $error = false; if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) { $name = … | |
Re: I found this list of perfomance tips : [URL="http://www.debianadmin.com/top-84-mysql-performance-tips.html"]Perfomance Tips[/URL] Hope it will help u. | |
Re: Your php code sequence is not correct. [CODE] <?php $mysql_host = "mysql9.000webhost.com"; $mysql_database = "a2354076_db"; $mysql_user = "username"; $mysql_password = "*********"; $con = mysql_connect("$mysql_host","$mysql_user","$mysql_password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("$mysql_database", $con); if (isset($_REQUEST['name'])) { $email = $_REQUEST['email'] ; $pass = $_REQUEST['pass'] ; $country = $_REQUEST['country'] … ![]() |
The End.