1,257 Posted Topics
Re: try to add slashes instead of real escape [CODE]$title= addslashes($_POST[title]); $description= addslashes($_POST[description]);[/CODE] | |
Re: in your post handler form you check errors [CODE] <?php unset($_SESSION['last_data']); unset($_SESSION['errors']); if(errors) { //set error session here $_SESSION['last_data']=$_POST; } else { //update/insert database } header("location:myform.php"); exit; ?> [/CODE] Now in your main form you can diplay session errors if session errors is set, and use last data to set … | |
Re: I have selected only required columns and echoed query before running it. When you run this page, copy the query output from browser and run it in phpmyadmin, and see what comes as result [CODE] <?php $query="SELECT topics.quizId, topics.title, quiz.passState' FROM topics LEFT JOIN quiz ON topics.managerId = quiz.managerId WHERE … | |
Re: in the begining (or before using session variable) of all pages make sure you write session_start(); | |
Re: your form page, say myform.html. [CODE]<div><?php echo $_GET['message']?> </div> <form action='mail.php' > . . . </form> [/CODE] your mail.php [CODE]<?php $mailsent=mail('som@g.com','hi','how are you'); if($mailsent) $msg="Mail sent succefully"; else $msg="Error occured while sending mail"; header("location:myform.html?message={$msg}"); exit; ?>[/CODE] ![]() | |
Re: [CODE]<div><b><a href='edit.php?articleid=1'>My article 1</a> </b> content 1 content 1 content 1 content 1 content 1 </div> <div><b><a href='edit.php?articleid=2'>My article 2</a> </b> content 2 content 2 content 2 content 2 content 2 </div> <div><b><a href='edit.php?articleid=3'>My article 3</a> </b> content 3 content 3 content 3 content 3 content 3 </div>[/CODE] | |
Re: try to do without sprintf, [CODE] $notes=addslashes($_POST['Notes']); $updateSQL = "UPDATE Leads SET Notes = CONCAT_WS(Notes,'\r\n', '{$notes}') WHERE Id='{$_POST['Id']}'";[/CODE] | |
Re: 1 removed () around echo 2 merged two lines, 3 changed " to ' [CODE] echo "<br>You left out some required dields. <STRONG>Record NOT added</STRONG>. Enter this record again, please <P align='center'><A HREF='http://www.kotw.net'><STRONG>Go Back</STRONG></A></P> "; [/CODE] | |
Re: better you post your code for at least form 1, that you have written | |
Re: Explain in detail. post acutally table structure and sample data (preferably in sql format) Then post expected output. | |
Re: I assume gid is number so pass one more parameter test.jsp?gid=1&gidlist=-1,2,3, track entered ids using javascript store it some where. then in your query you may write [CODE]"select gid, sgg_eng_nm from test where gid not in ($gidlist)"[/CODE] | |
Re: we must practise to do it in correct format. Better you use <br /> <img />. Though it will not change layout, if you do not add space and slash. | |
Re: [code] update tablename set col1='newvalue' where col2='my condition' [/code] | |
Re: You must quote operators if (ope=='+') there no operators function [CODE]<html> <body> <script lang="text/javascript"> var num1, num2, ope, sum, diff, prod, quo, mod; num1=Number(prompt("Enter First number: ")); num2=Number(prompt("Enter Second number: ")); ope=prompt("Choose Operator : + - * / %"); if (ope=='+') { sum=num1+num2; document.write("The sum is: "+sum); } else if … | |
Re: if you know the path of the file on server, you may use readfile('http://server/folder/image.jpg'); | |
Re: this is expected output groupname jan feb march.... A 3 1 2 B 1 4 5 then post table structure and sample data here | |
Re: HERE IS THE CODE [CODE]<html> <head> <script lang=javascript> isEmail1 = /^\w+([\.\-]\w+)*\@\w+([\.\-]\w+)*\.\w+$/; isEmail2 = /^.*@[^_]*$/; function isEmail(s) { return (isEmail1.test(s) && isEmail2.test(s)); } function validate(what) { if (!isEmail(what.txtemail.value)) { alert('Invalid email id'); return false; } else { alert('WELCOME ID IS VALID'); } //return true; } </script> </head> <body> <form name=frm id=frm … | |
Re: As far as I know in mysql by default datatime field is stored in yyyy-mm-dd format. Though if data is in another format then you may use mysql strtodate (some thing like that) function. I suggest you to directly use mysql current_timestamp function [CODE]mysql_query ("INSERT INTO $tablename (timestamp,name) VALUES (current_timestamp,'$name')"); … | |
Re: after running page view souce and search for MY SQL = I think you should find real query text around it in source. then run that query in myadmin. | |
Re: Are you able to display it [CODE]echo '<td align="center" >'.$row['commentId'].'</td>';[/CODE] If no then check the spelling and case, php array is case sensitive. Another thing is that you have placed form in the loop, I think it is not required, you can simply use <a></a>\ replace your delete code [CODE] … | |
Re: You must also consider javascript in mind. load server time in javascript and manage countdown clock there. [url]http://www.w3schools.com/js/js_timing.asp[/url] | |
Re: I think this is not good way of entering date check jqueryui datepicker its very simple to use, in your case how you will validate date any way for your case you must give name and ids to all elements like [CODE]<input .... name='d1' id='d1' > <input .... name='d2' id='d2' … | |
Re: Basic php [url]http://www.w3schools.com/php/default.asp[/url] PHP TUTORIAL [URL="PHP TUTORIAL http://devzone.zend.com/node/view/id/651"]http://devzone.zend.com/node/view/id/651[/URL] There are so many ready to use free tools (framework) joomla, wordpress, drupal, cakephp and so many more, but you must learn basic php first. | |
Re: It is possible same form and one action page by using complex javascript coding. You need to learn html element arrays 1) like Naming html elements using xyz[], 2) Adding /deleting table rows using javascript code. 3) accessing posted array in php and all that. [COLOR="Green"]If updating all at once … | |
Re: are you getting expected number of records by selecting it say [CODE]select count(*) from quest_bank where source like '%src="~/%'[/CODE] I think you might be having space in between in some records [ src = "~/ ] like that | |
Re: [CODE]select col1,col2,col3 from tablename where col1='something' and col4='some more thing'[/CODE] | |
Re: Even some database do not allow to change type especially when table having data, or it is key column. In your case if it is PK then when u change PK's datatype you will also have to change datatype of its foreign key reference. I suggest if it is going … | |
Re: if its one time you can export it to excel or csv then import it in oracle or you can develop some front end in vb.net or php and connect to both database and transer data from one to another database | |
Re: this will alert user to enter proper string which may or may not start with + [CODE]function zz(txt) { isPhone = /^[+]?\d+$/; if (!isPhone.test(txt)) { alert('Invalid phone number'); document.getElementById('aa').focus(); return false; } return true }[/CODE] | |
Re: check my code line numbers 389 given id to form 393 given id to num 395 changed submit to button and added onclick event 404 removed duplicate form 470 accessing num by id 502 change function definition, now creating new function totext 507 accessing num by id [CODE]<html> <style type="text/css"> … | |
Re: rename for function all to function allnew (i think all is inbuilt keyword) | |
![]() | Re: I think you can use gd libraries. You can draw rectangles and lines using it using php code. gd must be installed on your server with php. |
![]() | Re: I have merged template in your code, I think following 3 variable are important for your payment gateway. Do not include template code now. (its already in your code now) [CODE]$sngTotal=0.0; $strBasket=""; $iBasketItems=0; [/CODE] Final code [CODE]<?php $sngTotal=0.0; $strBasket=""; $iBasketItems=0; $total=0; foreach($_SESSION['cart'] as $product_id => $quantity) { $query = sprintf("SELECT … ![]() |
Re: carefully use this code, before running this query, keep back up of table [CODE] mysql_query("UPDATE narr_weinachtfeier SET albumdescription='$change_name', location= concat('$change_name',substr(location,instr(location,'/'))) , location1= concat('$change_name',substr(location1,instr(location1,'/'))) WHERE id='$idalb'"[/CODE] | |
Re: inserted where? In database or in textbox you want to read hardware information. | |
Re: category(cat_id, cat_desc) article(art_id,art_desc, cat_id) user(userid, username,pwd) user_category(userid, cat_id) user_mail_log(log_id,userid,art_id,sent_time) optional here when an article is added you can run query and loop it to send mail to user subscribed its category and save that log in user_mail_log table (optional). to find out you need to join article, user, category and … | |
Re: i think you want to join tables. query for joining two table is as follows [CODE]select t2.sup_id, t1s.name sup_name, t2.emp_id, tle.emp_name from table2 t2 left outer join table1 t1s on t2.sup_id=t1s.id left outer join table1 t1e on t2.emp_id=t1e.id[/CODE] | |
Re: what is the datatype of arrival_at, its datetime or time or varchar. If its varchar then you need to cast it to time before comparing. So mention here how you store your arrival_at. | |
Re: [CODE]What I need to do is take the date clause from the views and instead use it in the query so that I can re-use the views with other date ranges.[/CODE] You are in the right direction remove this line from both views [CODE]AND DATE BETWEEN '2010-08-01' AND '2011-05-01' [/CODE] … | |
Re: Can u check how much time this query takes. [CODE]select N.id, N.Alias, N.Weight FROM Ninja N left outer join Matchup Mb on Mb.BlueCornerNinjaID = N.id left outer join Matchup Mr on Mr.RedCornerNinjaID = N.id WHERE ifnull(Mb.BlueCornerNinjaID ,0)+ifnull(Mr.BlueCornerNinjaID ,0)>0 ORDER BY N.Alias[/CODE] | |
Re: Before you upload you file, you must complete the record, you can not pass blank country. Human can read file and understand that to which country that blank city belong after looking the top row of city group. But computer can not understand that. Try to attach following file with … | |
Re: add $this->link as first parameter, change that line to following [CODE]while ($rows = mysqli_fetch_array($this->link,$result))[/CODE] | |
Re: Learn it here [url]http://www.w3schools.com/html/html_links.asp[/url] | |
Re: DO you know about php datagrid428 (its free). YOu can create forms where you can add/edit/delete/print/export with ease and paging option. Also you can connect php with any database well known. I would recommend to not waste time in writing code. go for it. Warning: free version is with some … | |
Re: before one there are two single quotes not double quote [CODE]$search="q test\''1";[/CODE] | |
Re: I think you are making it little complicated, This could be achevied using joining the table. So please post following 1) your table structure and 2) input to php page 3) output format expected Also tell me what is the difference between your customerid and clientid | |
Re: Usually I follow like html1-> submit-> perl(save/fetch database) -> html2 -> submit -> perl (save/fetch) what you want is html1-> html2 (store html1 posted values in hidden variable using js) -> submit -> perl(save/fetch database) In short you need to preserve html1 values in html2's form, using javascript in hidden … | |
The End.