331 Posted Topics
Re: include 'index.php';//will try to include, will continue if cant find include_once 'index.php';//will only include it once, will continue if cant find (wont include the same file if it is called more than once) require 'index.php';//tries to include, fatal error thrown if fails script will not run require_once 'index.php';//tries to include … ![]() | |
Re: pixie said the error, the f needs quotes you can only use no quotes for number fields and you should get it to tell you why it's erroring it will likely give error in mysql query at point where it says filename = $f [code=php] //change $k=mysql_query($query,$con); to below if(mysql_query($query,$con)){ … | |
Re: I'd always say write it yourself it forces you to understand how things work, soon as you jump into something like joomla, wordpress or phpcake things go out of your control and you skip understanding things unless it doesn't work then need to study and understand the code someone else … | |
Re: Wheres your data - mysql? it's stored as the rows unique id? [CODE=php] //connect to your mysql server $mysql_query = "select `id` from `table` limit 1"; $mysql_result = mysql_query($mysql_query); $mysql_array = mysql_fetch_assoc($mysql_result); $images_dir = "images/{$mysql_array['id']}/thumbnails/";[/CODE] or for multiple rows [CODE=php] //connect to your mysql server $mysql_query = "select `id` from … | |
Re: $predictrow = mysql_fetch_array($predict_result); $predictrow = mysql_fetch_[COLOR="Green"]assoc[/COLOR]($predict_result); assoc = associative array (with key names) array = plain array (with only values) | |
Re: not specific dates? i would use strtok to pull out the hours, mins and seconds then compare them how you want [code=php] function timeToSeconds($timeStr){ $hours = strtok(':',$timeStr); $mins = strtok(':'); $secs = strtok(':'); if($hours > 0){ $secs += ($hours*3600); } if($mins > 0){ $secs += ($mins*60); } return $secs; } … | |
Re: died is a function in the class, i can only think of retyping the line and a couple before it and try changing \n\n to \r\n - can't see anything wrong otherwise and don't want to insult you're intelligence but gmsngrqst.php is the right file? | |
Re: that could be old? All i know is $_REQUEST is a standard array like $_GET or $_POST, it's in php.ini which overwrites the other $_GET['var1'];//get1 $_GET['var2'];//empty $_GET['var3'];//empty $_POST['var1'];//post1 $_POST['var2'];//post2 $_POST['var3'];//empty //depending on php.ini $_REQUEST['var1'];//post1 $_REQUEST['var2'];//post2 $_REQUEST['var3'];//empty $_REQUEST['var1'];//get1 $_REQUEST['var2'];//post2 $_REQUEST['var3'];//empty The only reason i can think of to do that is … ![]() | |
Re: [CODE=php]index.php <?php if($_GET['id'] == 1){ echo 'page 1'; }elseif($_GET['id'] == 5){ echo 'contact page'; }else{ echo 'page 2'; } ?>[/CODE] --------------------------------- index.php?id=1 -> page 1 index.php -> page 2 index.php?id=5 -> contact page | |
Re: [QUOTE=gavinpit;1703415]Hi I am getting very frustrated with my php code I am relitivaly new to php and need a little help displaying multiple results from mysql within the one page and it wont do it!! what am I missing?? I am displaying the results with this code but feel I … | |
Re: [QUOTE=aaloo;1703342]@zero13 i tried your code . now i m getting this error Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' in C:\xampp\htdocs\flasblog\test.php on line 3 my php code is [code] <?php include_once"scripts/connect.php"; ?> <?php if(isset($_POST['firstName'] && $_POST['lastName'])) { $text=$_POST['firstName']." ".$_POST['lastName']; $to="anubhavjhalani09@gmail.com"; $subject="Message from php"; //data insert into database … | |
Re: [code=javascript] function timedCount(){ document.getElementById('txt').value=c; c=c+1; if(c == 5){ c = 0; stopCount(); }else{ t=setTimeout("timedCount()",480000); } } [/code] | |
Re: see whats happening on this line, must be returning an array 19. $target_path = $target_path . basename( $_FILES['uploaded_file']['name']); also your upload if statement has no else - if it fails which might be causing the first error [code=php] 15. if((!empty($_FILES['uploaded_file'])) && ($_FILES['uploaded_file']['error'] == 0)){..... if(...){ }else{ //say error } }//<--else … | |
Re: it's probably because jquery is really a package of javascript functions in js files so to run it you have to call the function jQuery() or $(); ![]() | |
Re: you're missing a bracket if (isset($_POST[$MM_flag])){ if(empty($_POST)) || empty($_POST)) { $error = 'Please enter your full name; name and surname'; } update: also missing a bracket on line 41: `if (strlen($_POST< 8)){` and another error: line 35.` if (isset($_POST[$MM_flag])){` this if statement doesn't close not sure where its meant to … | |
Re: Looks like some server setting i just re-created it on mine and works fine. try error_reporting(E_ALL); at the start and var_dump($rule); and even declaring $rule as an array before adding values to it | |
Re: your insert.php page: [code=php] <?php include("config.php"); if(isset($_POST['status']){ //field is set $status = $_POST["status"]; $status = str_replace("'",''',$status);//take out single quotes so they dont mess up the sql if($status != ''){ $query = "INSERT INTO streams (message) VALUES ('$status')"; mysql_query($query) or die(mysql_error()); }else{ //$status was empty } }else{ //status was not set … | |
Re: first off really consider starting to use a database such as mysql you can manage data so much better and do so much more with it. but for the current setup make a new page [code=php] <?php if($_POST['submit'] == 'count'){ $from = $_POST['from']; $to = $_POST['to']; $allowedchars = array(':','-',' ','.'); … ![]() | |
Re: [code=php] if(!empty($_POST['recipeid'])){ $recipeid = mysql_real_escape_string($_POST['recipeid']); $mysqlResult = mysql_query("SELECT decription FROM recipes WHERE recipeid = '" . $recipeid . "'"); $mysqlArray = mysql_fetch_assoc($mysqlResult);//if the query should be 1 row echo'<textarea rows="10" cols="75">'; echo $mysqlArray['decription'];//the fieldname from the mysql query, it's missing an s is that a typo? echo '</textarea>'; //while($mysqlArray = … | |
Re: [code=php] //$_POST is an array with key->value pairs //key being the 'name' attribute on the input/textarea in the form and value, the value of it when submitted $hourglass1 = strip_tags($_POST['hourglass1']); if(ctype_digit($_POST['intvalue']) || is_int($_POST['intvalue']){//check if its a string with all numeric characters or is an integer $intvalue = $_POST['intvalue']; }else{//else make … ![]() | |
Re: replace [code=php] //check number of user records found... only 1 $userRecFound = mysql_num_rows($userRec); [/code] with [code=php] //check number of user records found... only 1 if(@mysql_num_rows($userRec)==1){ $userRecFound = 1; }else{ $userRecFound = false; } [/code] | |
Re: sounds odd it should do that anyway but you could put in SELECTED [code=html] <OPTION VALUE="" SELECTED>- Please select -</OPTION> [/code] | |
Re: you can send on all the post vars again [code=php] foreach($_POST as $k=>$v){ $allowedchars = array('@','-','.','_'); $tk = str_replace($allowedchars,'',$k); $tv = str_replace($allowedchars,'',$v); if(ctype_alnum($tk) && ctype_alnum($tv)){ echo "<input type='hidden' name='{$k}' value='{$v}'/>\r\n"; } } [/code] add to the allowed chars if you want to let more chars through, or just validate it … | |
Re: mysql_select_db() --> mssql_select_db() mysql_query() --> mssql_query() [url]http://www.php.net/manual/en/function.mssql-query.php[/url] | |
Re: [code=php] <?php require_once('connect.php'); $query="Select `Amountspent`,`Category`,CONCAT(`Financialyear`,`Financialmonth`) as `jointdate` from Moneyout"; $result=mysql_query($query); //CONCAT joins 2 fields together, a row with financialyear = 08 and month 10 becomes '0810'. basically is grouping the data by month $data = Array();//array to hold all the data $data['total'] = 0;// set total to 0 while($row=mysql_fetch_assoc($result)){ if(!$data[$row['Category']]){//check … | |
Re: Think i get what you want, you want the changed value to be first in arrayc and the rest pushed down? [code=php] <?php $array1 = array(0 => 1,1 => 2,2 => 3,3 => 4,4 => 5); $array2 = array(0 => 1,1 => 2,2 => 8,3 => 4,4 => 5); $arrayresult … | |
Re: [CODE] if($smsnum != '') {//if(ctype_digit($smsnum)){ ? if( strlen($smsnum) > 1 ){//this is going to exclude 0-9 its checking the string length not the value $qryt = "SELECT accbala, securecode FROM table WHERE securecode='$securecode'"; $result = mysql_query($qryt); if($result) { //if you do want row count this is safer $row_count = @mysql_num_rows($result); … ![]() | |
Re: Likely be z-index, some element is sitting ontop of the a tag - so no click! no css with it so can't say for sure | |
Re: [code=css] -ms-border-radius: 0.5em 2em 0.5em 2em; [/code] is the css set for ie9, unfortunately ie8 and under just doesn't support it. You have to make a corner image for each corner and position them in html otherwise | |
Re: You could take a different approach and make your banner.php output itself as an image, this requires the GD library to be installed on your php server which is pretty common now. [code=php] <?php include"db.php"; $id = $_GET['image']; if(!ctype_digit($id)){$id=0;} $sql=mysql_query("select * from banner where `id`='{$id}' "); $r=mysql_fetch_assoc($sql); $target = 'admin/banner/images/'.$r['name']; … | |
![]() | Re: You might be able to do it with a simple webkit transition, not sure if it will look right [code=css] #div{ background-image: url(myimage.jpg); background-position:0px 0px; -webkit-transition: background-position 5s linear; -moz-transition: background-position 5s linear; -o-transition: background-position 5s linear; -ms-transition: background-position 5s linear; transition: background-position 5s linear; } #div:hover{ background-position: 2000px 0px; … |
The End.