Jump to content

funbinod

Members
  • Posts

    501
  • Joined

  • Last visited

Everything posted by funbinod

  1. that's why I've mentioned ".......... depends on .... overall design, where and how u wish blank lines or spaces..........."
  2. is using double quotes in HTML is a problem that they should be escaped?? sorry I've less idea about this...
  3. thank u for clarifying about element and properties. so far the idea of line break concerns, I've also suggested using css. using css we can set the margins or paddings or anything for any tag, right? and so can be done for line breaks also??
  4. in simple language - what everyone above are saying is don't use any charcode for html. use the characters themselves.. not like what u wrote-- style= "height: 50px; background-color: #E6E9FE &quote; in stead write -- style="height: 50px; background-color: #E6E9FE;"
  5. there are many ways. depends on your overall design, where and how u wish blank lines or spaces. the best way is to use css. using css you can do anything to anything (regarding design ).. in css there are elements like padding and margin to make line spaces. line break <br /> can also be used. using empty paragraph or div is not recommended, so fas as I know...
  6. have u included functions.php at the beginning of the page? if u haven't, I think, removing the functions.php from img tag and placing it at the beginning of the page can solve the problem. u doesn't need to include inside img tag.
  7. (sorry if I choose wrong place to post this. I got confused whether to post it on javascript or css) I am trying to learn bootstrap. but simply after including bootstrap.css, it overrides most of the styles I defined on the page. like buttons, tables, etc. can anyone guide me how to handle this?
  8. i don't use firefox (coz i don't like. i dunno why) so i dunno much about firefox. it might be the case of compatibility. just add some lines that can support firefox. like-- @-moz-keyframes slidy { } -moz-animation: 30s slidy infinite;
  9. funbinod

    insert problem

    amaizing! the var_dump gave string(10) "2015-01-27" and suddenly it worked. then i removed this(var_dump) and it again worked. i think var_dump has nothing to do with inserting rows. I've not changed anything else and its working now. dunno what had happened. can u focus light on some possible reasons.
  10. funbinod

    insert problem

    the logic behind the switch between date and ndate is that, user may change the type of date anytime. if they change the type of date, then the date coming from $_POST['date'] would also be changed. then the insert query must be clear what type of date is it that is coming from 'date' field and it has to store both type of dates in the database. if 'N' date is coming then it should grab 'E' date and store in the same way. and opposite for another setting.
  11. funbinod

    insert problem

    here is a part of the included file if($date=='2071-10-09'){ $edate='2015-01-23';}elseif($date=='2071-10-10'){ $edate='2015-01-24';}elseif($date=='2071-10-11'){ $edate='2015-01-25';}elseif($date=='2071-10-12'){ $edate='2015-01-26';}elseif($date=='2071-10-13'){ $edate='2015-01-27';}elseif($date=='2071-10-14'){ $edate='2015-01-28';}elseif($date=='2071-10-15'){ $edate='2015-01-29';}elseif($date=='2071-10-16'){ $edate='2015-01-30';}elseif($date=='2071-10-17'){ $edate='2015-01-31';}elseif($date=='2071-10-18'){ $edate='2015-02-01';} and it must work. what could be the cause for not behaving the way i expect..?????
  12. funbinod

    insert problem

    but, as i mentioned above, the IF block is executed, but the ecal.php is not included in it, as it should be if the IF block executes. after including ecal.php, it should give the value for $edate according to the value of $date. but while echoing the $edate, it gives nothing...
  13. I couldn't understand what ur exact problem is. please go more clear. instead, in your css u have mentioned selector as-- figure#imagestrip img but in your html there is nothing with id 'imagestrip'
  14. funbinod

    insert problem

    ok. I had no idea about this. I thought the else { } block will give error msg if it encountered any. and I thought if the insert succeeds then only the success msg will be generated. now it gave the error msg "Column 'date' cannot be null" this made me more confusing. first, as I mentioned previous, the script inserts everything on localhost. here I mention more of my script. there are two types of date. one international and other local. $date = $_POST['date'];if($srow->cal=='N') { // in setting table 'calander' is set to 'N'. this means the setting is for local date.. require('ecal.php'); // in it if($date=='2071-10-12'){$edate='2015-01-26';}elseif($date=='2071-10-13'){$edate='2015-01-27';} and more.. $dw = 'ndate, date'; $dp = $edate;} else { // and the same thing vice versa is here in this block... require('ncal.php'); $dw = 'date, ndate'; $dp = $ndate;}// testing if everything is ok or not...echo $srow->cal.'<br />'; // echos 'N'echo $date.'<br />'; // echos '2071-10-12' (this is local date)echo $date.'<br />'; // echos 'ndate, date'echo $edate; // echos nothing here, I think, the script is not including ecal.php in it.the motive of this script is to create the insert structure. that means, according to setting table, if $srow->cal is 'N' then the acquired date in 'ndate' and it has to grab 'edate'. so it has to be inserted in 'ndate' column and another in 'date' column. to define this, I created the $dw and $dp vars. in this current setting, date insert structure is ..,ndate, date,... and value for them-- ..,$date, $edate. if the setting is different, then the structure is ..,date, ndate,.. and value for them-- ..,$date,$ndate,.. here is the exact insert block $stmt = $mysqli->prepare("INSERT INTO $temptbl(sn, vn, tr_type, ".$dw.", aid, sid, description, catid, qty, rate, less, amt, ref, cid, uid) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");$stmt->bind_param('iisssiisiddddsii', $sn, $svn, $tr_type, $date, $dp, $aid, $sid, $desc, $catid, $qty, $rate, $less, $amt, $ref, $cid, $uid); the confusion here is, why isn't this including the 'ecal.php'. the ecal.php lies in the same directory of this insert script... (again reminding, the EVERYTHING is fine on localhost)
  15. funbinod

    insert problem

    and another interesting thing. the query is not failing. rather it gives success message. it just doesn't insert into db. if ($stmt = $mysqli->prepare("INSERT INTO $temptbl(sn, vn, tr_type, date, ndate, aid, sid, description, catid, qty, rate, less, amt, ref, cid, uid) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt->bind_param('iisssiisiddddsii', $sn, $svn, $tr_type, $date, $dp, $aid, $sid, $desc, $catid, $qty, $rate, $less, $amt, $ref, $cid, $uid); $stmt->execute(); $_SESSION['vousub'] = $qty." ".$unit." '".$item."' added to basket!"; $mysqli->close(); die (header("location: invoice.php?m=$method"));} else { die('Insert Error: '.$mysqli->error);}
  16. funbinod

    insert problem

    I encountered a unexpected problem while inserting row to MySQL table. the interesting point is that it was working one day earlier and it is still working on localhost. the following is the query I used.. INSERT INTO $temptbl(sn, vn, tr_type, date, ndate, aid, sid, description, catid, qty, rate, less, amt, ref, cid, uid) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) the following is the MySQL table.. CREATE TABLE IF NOT EXISTS `temptbl` (`list` int(10) NOT NULL AUTO_INCREMENT, `sn` int(10) NOT NULL, `ref` varchar(100) DEFAULT NULL, `date` date NOT NULL, `ndate` date NOT NULL, `vn` int(10) NOT NULL, `aid` int(10) NOT NULL, `sid` int(10) NOT NULL, `description` longtext NOT NULL, `catid` int(10) NOT NULL, `qty` int(100) NOT NULL, `rate` int(100) NOT NULL, `less` int(3) NOT NULL, `amt` int(100) NOT NULL, `tr_type` varchar(100) NOT NULL, `cid` tinyint(4) NOT NULL, `uid` tinyint(4) NOT NULL) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1; one thing I must mention is that, previously the AI column `list` was TINYINT(3) and its AI value reached 318 ( I don't know how it reached, or I might be confused, since I've read in web that its max value is 127). I thought it stopped inserting because the AI column reached maximum value. thus I changed it to INT(10) and truncated it to force it start from 1. but it is still not inserting anything. and what I wonder more is that it is working fine on localhost. please guide what could be the possible reason(s).
  17. edit ---- (sorry for spelling mistake on topic. its "special" in stead of "sepcial") I've created ajax request to get some data. I works fine for normal data but if it contains special character like "&", then it does nothing. following is the ajax request---- function getSid(){var XMLHttpRequestObject = false;if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest();} else if (window.ActiveXObject) { XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHttp");}XMLHttpRequestObject.onreadystatechange = function(){ if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { document.getElementById('sid').value = XMLHttpRequestObject.responseText; }}var item = document.getElementById('item').value;XMLHttpRequestObject.open('POST', 'ajax/sid.php');XMLHttpRequestObject.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");XMLHttpRequestObject.send("item=" + item);} and this is the page that I derive data from--- <?php##################### sid.php #####################require_once('../functions.php');header("content-type: text/xml");$item = ($_POST['item']); // this works fine if I put $item = 'this & that' but if I send the same value from ajax, it doesn't work.if ($stmt = $mysqli->prepare("SELECT sid FROM stock WHERE item=? AND cid=?")) { $stmt->bind_param('si', $item, $cid); $stmt->execute(); $stmt->bind_result($sid); $stmt->fetch(); echo $sid;} else { echo 'error: '.$mysqli->error;}?> please help resolving this problem-----
  18. don't use AM or PM. just use date and hours. and no space between hours and minutes... strtotime('01/25/2015 04:11'); for details, read manual---- http://php.net/manual/en/function.strtotime.php
  19. ok! the all meant for SEO then???? for designing part, both are same????
  20. I wonder what exactly is difference between some new html5 tags and divs with ids like----- <header> </header><section> </section><aside> </aside><footer> </footer> and <div id="header"> </div><div id="section"> </div><div id="aside"> </div><div id="footer"> </div>
  21. the best way to do this is to use <table> in stead you can try this --------- <style>body { margin:0; background-color:#6FF5C5;}.container { width: 1000px; color:#FFFFFF; text-align:center; margin:auto; font-size:20px; font-weight:bold;}.rside { float:right; width: 250px; background-color: #2D30C5; position:relative; padding: 10px 0px;}.lside { float: left; width: 250px; background-color: #C53234; padding: 10px 0px;}.center { padding: 10px 0; width: 500px; border:0px solid red; background-color: #7CD56F; margin:auto;}.rside, .lside, .content { display:block;}</style><div class="container"> <div class="lside">This is sidebar on left..</div> <div class="rside">This is sidebar on right..</div> <div class="center">main content area</div></div>
  22. can I make an alert display before redirecting a page? I tried this but it gave error "headers already sent............" if (($time - $lastActive) > 1200) { mysqli_query($connect, "DELETE FROM session WHERE cid='$cid' AND uid='$uid'") or die("Error: ".mysqli_error($connect)); $user->logout(); session_start(); echo '<script>alert("Timeout!");</script>'; $_SESSION['timeout'] = 'Timeout!'; die(header("location: login.php"));} and the $_SESSION['timeout'] also did not work either...
  23. I generally do this way (as suggested by davej) <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><title>title</title><script></script><style>#wrapper { width:1280px; margin-right:auto; margin-left:auto;}</style></head><body><div id='wrapper'><!-- all content --></div></body> </html> and I think this would solve ur problem... am I right davej?
  24. inside capquery, there is many querys and I've placed the result of the querys inside respective divs and i wish them to use on another pages where they are needed. and yes! i know i can do the same thing with php
×
×
  • Create New...