|
The statement
$sql = "UPDATE testbl SET ...
merely creates a string variable, and then continues the while loop. You never send the string to MySQL to update the database.
|
|
|
|
|
I have a data of more that 500000 records which want to search data and fill in dropdown list. I am using dropdown list its working buts it is very slow
<script type = "text/javascript">
var ddlText, ddlValue, ddl, lblMesg;
function CacheItems() {
ddlText = new Array();
ddlValue = new Array();
ddl = document.getElementById("<%=ddlItems.ClientID %>");
lblMesg = document.getElementById("<%=lblMessage.ClientID%>");
for (var i = 0; i < ddl.options.length; i++) {
ddlText[ddlText.length] = ddl.options[i].text;
ddlValue[ddlValue.length] = ddl.options[i].value;
}
}
window.onload = CacheItems;
function FilterItems(value) {
ddl.options.length = 0;
for (var i = 0; i < ddlText.length; i++) {
if (ddlText[i].toLowerCase().indexOf(value) != -1) {
AddItem(ddlText[i], ddlValue[i]);
}
}
lblMesg.innerHTML = ddl.options.length + " items found.";
if (ddl.options.length == 0) {
AddItem("No items found.", "");
}
}
function AddItem(text, value) {
var opt = document.createElement("option");
opt.text = text;
opt.value = value;
ddl.options.add(opt);
}
</script>
<asp:TextBox ID="txtSearch" runat="server"
onkeyup = "FilterItems(this.value)"></asp:TextBox><br />
<asp:DropDownList ID="ddlItems" runat="server" DataTextField="Description" DataValueField="NumericCode" >
</asp:DropDownList>
|
|
|
|
|
If you're showing 500000 items then a dropdown is the wrong thing to use. Use an autocomplete textbox instead. Google for how to write one.
|
|
|
|
|
Server 2008 R2, IIS 7.5
I've got a user that can't get a website to work for them. Below is the error received. It says "Anonymous"?
??? Anonymous auth is disabled.
I can get to it, so ASP itself is enabled. The server also has multiple classic ASP sites that work fine.
The user is using IE 11 (as am I)
Any ideas?
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Detailed Error Information
Module
IIS Web Core
Notification
MapRequestHandler
Handler
ASPClassic
Error Code
0x80070002
Requested URL
<a href="http://<redacted>/default.asp">http:
Physical Path
C:\inetpub\wwwroot\<redacted>\default.asp
Logon Method
Anonymous
Logon User
Anonymous
|
|
|
|
|
That error does imply that the physical file doesn't exist - the other common causes of a 404 error would typically have a different sub-status code[^].
Are you absolutely sure that you're loading exactly the same URL as the user, and that the host name is resolving to the same IP address / server?
Try using Failed Request Tracing[^] to capture the details of the failed request, to see if there's anything obvious that you've missed.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I sent them the link the click, so it had better be the same URL. :p
The DNS should be ok, the URL in the error is correct, so they at least attempted to hit the right one.
I'll try the tracing.
It's such a pita to troubleshoot users who are umpty miles away. You can't whack them on the back of the head easily.
Thanks
|
|
|
|
|
What about use Fiddler to check traffic?
|
|
|
|
|
Oh, we're not allowed to do anything like that.
Seriously. Government work is SO much fun.
Anyway, the problem was either fixed or no one cares anymore. I'm not even sure which. :p
|
|
|
|
|
|
hi i havent been coding long, im learning on my own using the internet, youtube etc.
i am trying to us all the knowledge ive learn so far to code a basic website. i have having a couple of problems.
1/ first this error message is appearing on the console when i inspect the webpage i am creating??
Uncaught SyntaxError: Unexpected token <
2/ second i cant seem to do simple actions with css on my html using the bootstrap classes, i know its all correct in terms of the files being connected to sublime as i can copy and paste from bootstrap and the nav bars with drop downs work fine. (i assume that if they work that it all set up properly on my text editer?)
i am trying to centre the logo, heading and menu at the moment.
This is my html code.....
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Cupcake Fixation</title>
<link href='http://fonts.googleapis.com/css?family=Indie+Flower' rel='stylesheet' type='text/css'>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="logo" "col-md-2">
<img src="http://www.drawingnow.com/file/videos/image/1376476137.jpg"/>
</div>
<header class="container">
<h1>Cupcake Fixation</h1>
<p><strong>"We take your addiction seriously!"</strong></p>
</header>
<div class="container-fluid">
<ul class="nav navbar-nav" "navbar-default" >
<li class="nav" class="active"><a href="#">Home<span class="glyphicon glyphicon-heart"</span></li></a>
<li class="nav"><a href="#">About<span class="glyphicon glyphicon-heart"</span></li></a>
<li class="nav"><a href="#">Recipies<span class="glyphicon glyphicon-heart"</span></li></a>
<li class="nav"><a href="#">Frosting<span class="glyphicon glyphicon-heart"</span></li></a>
<li class="nav"><a href="#">Contact Us</li></a>
</ul>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://twitter.github.io/bootstrap/assets/js/bootstrap-dropdown.js"></script>
</body>
</html>
|
|
|
|
|
The first problem is most likely caused by the "drop downs" script at the bottom:
http://twitter.github.io/bootstrap/assets/js/bootstrap-dropdown.js[^]
That URL gets redirected to the Bootstrap 2.3.2 home-page[^], which isn't a javascript file.
It looks like that script was build for Bootstrap v2. Assuming you're using Bootstrap v3[^] - which you should be, since v2 is no longer supported - the old script wouldn't work anyway. Bootstrap v3 already includes support for drop-downs, so you can simply remove that script tag.
Your "logo" tag is incorrect - the "col-md-2" should be part of the class attribute:
<div class="logo col-md-2">
That class means that the logo will take up 1/6th of the page width. It doesn't have anything to do with centring the element.
Bootstrap : Grid system[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You need to close the anchor tag before closing the listitem tag
li a /li /a <-- should be --> li a /a /li
There are strangers on the Plain, Croaker
|
|
|
|
|
Just Wellformed your html and Close your span tag that is not closed inside UL and Li.
Use the Below Code
<ul class="nav navbar-nav" "navbar-default" >
<li class="nav" class="active"><a href="#">Home</li></a>
<li class="nav"><a href="#">About</li></a>
<li class="nav"><a href="#">Recipies</li></a>
<li class="nav"><a href="#">Frosting</li></a>
<li class="nav"><a href="#">Contact Us</li></a>
</ul>
|
|
|
|
|
I asked Google and Bing, "WEBSITE MOCKUP TOOL"
They found me...
Good and bad opinions on any of these are welcome.
The overriding goal for me is a short learning curve.
"Features" will be gladly sacrificed for simplicity in this case.
modified 17-Jun-15 14:03pm.
|
|
|
|
|
Hello, I have a page on a label applied CKEditor, HTML code as follows:
<textarea id="MyHtmlEditor" class="ckeditor" cols="80" rows="10" name="MyHtmlEditor"></textarea>
When I upload and then insert a picture, you can see the pictures in normal CKEditor, the viewing source will appear <img alt = "" src = File Name /> tag code.
Because it will put more than one picture, if I want to do in a certain period of time to execute javascript, you can get all the content in the editing area where CKEditor <img alt = "" src = filename /> src attribute values
That is made all the pictures of connecting position.
I found a CKEditor stall, it seems that only the editorial content replace () method can be used.
Some people know how to reach this level?
|
|
|
|
|
Hello.
I´m building a web page that have an administrator user, he can create new users with specific fields. All of this in html5, php and MySQL.
The question is.. Do you know a framework or process that show to the administrator the list of users that he created, with some fields with options to modify, in other tab of the web page.
I appreciate your help .
|
|
|
|
|
You are thinking of a database file (.db), which you create in Microsoft Access (or any other database editing software), then you host that file on the internet along with all your other files. Then whenever you want to create a new user, you can add another row into the database table.
|
|
|
|
|
$latlayer = array(
array('minW' => 0 , 'minH' => 0 , 'maxW' => 8.5 , 'maxH' => 4.8 , 'val' => 'lat1' ),
array('minW' => 8.5 , 'minH' => 4.8 ,'maxW' => 17 , 'maxH' => 9.6 , 'val' => 'lat2' ),
array('minW'=> 17 , 'minH' => 9.6, 'maxW' => 25.5 , 'maxH' => 14.4 , 'val' => 'lat3' ),
array('minW' => 25.5 , 'minH' => 14.4, 'maxW' => 34 , 'maxH' => 19.2 , 'val' => 'lat4' ),
array('minW' => 34 , 'minH' =>19.2, 'maxW' => 42.5 , 'maxH' => 24 , 'val' => 'lat5' ),
array('minW' => 42.5 , 'minH' => 24, 'maxW' => 51 , 'maxH' => 28.8 , 'val' => 'lat6' ),
array('minW' => 51 , 'minH' => 28.8, 'maxW' => 59.5 , 'maxH' => 33.6 , 'val' => 'lat7' ),
array('minW' => 59.5 , 'minH' => 33.6, 'maxW' => 68 , 'maxH' => 34.8 , 'val' => 'lat8' ),
array('minW' => 68 , 'minH' => 34.8, 'maxW' => 76.5 , 'maxH' => 43.2 , 'val' => 'lat9' ),
array('minW' => 76.5 , 'minH' => 43.2, 'maxW' => 85 , 'maxH' => 48 , 'val' => 'lat10' ),
array('minW' => 85 , 'minH' => 48, 'maxW' => 93.5 , 'maxH' => 52.8 , 'val' => 'lat11' ),
array('minW' => 93.5 , 'minH' => 52.8, 'maxW' => 100 , 'maxH' => 50 , 'val' => 'lat12' ),
);
$wimg = 20;
$himg = 9.6;
foreach($latlayer as $current)
{
if( $wimg >= $current['minW'] and $wimg <= $current['maxW'])
{
echo $current['val'];
break;
}
}
result lat 2 OK no problem one value checked
The problem with checking the tow value of the array
minW-maxW and minH-maxH = lat?
|
|
|
|
|
$wimg = 20;
$himg = 9.6;
foreach($latlayer as $current)
{
if( $wimg >= $current['minW'] and $wimg <= $current['maxW'] and himg >= $current['minH'] and $himg <= $current['maxH'])
{
echo $current['val'];
break;
}
}
Result : Error no parametrs
|
|
|
|
|
I've 3 php files,
1.converter.php // controllers/converter.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Converter extends CI_Controller{
function __construct(){
parent::__construct();
$this->load->helper(array('url','form'));
}
function index(){
$this->load->view('menu_converter');
}
function biner(){
$this->load->library('form_validation');
$this->form_validation->set_rules('n1', 'Number1', 'required|integer');
if ($this->form_validation->run()){
$data['n1']=(int)$this->input->post('n1', true);
$data['hasil']=decbin((int)$data['n1']);
}
else{
$n1=0;
}
$this->load->view('biner',$data);
}
}
?>
2.menu_converter.php // view/menu_converter.php
<<pre lang="xml">html>
<head><title>Aplikasi Converter Bilangan</title>
</head>
<body>
<h1>CodeIgniter 2.0 and Form!</h1>
<p>Silahkan pilih menu di bawah ini.</p>
<ul>
<li><?php echo anchor('index.php/converter/biner/','Biner');?>
</ul>
<p><br/>Page rendered in {elapsed_time} seconds</p>
</body>
</html></pre>
3.biner.php // view/biner.php
<html>
<head><title></title>
</head>
<body>
<h1>Converter</h1>
<?php echo validation_errors();?>
<p>Silahkan masukkan data berikut!</p>
<?php echo form_open('index.php/converter/biner');?>
<?php echo form_input('n1',$n1);?>
<?php echo form_submit('submit','Hitung!!');?>
<?php echo form_close();?><br>
Hasil: <?php echo $hasil;?>
<p><br/>Page rendered in {elapsed_time} seconds</p>
</body>
</html>
I'm using CodeIgniter. Everytime i run the "index.php/converter" on my browser, it keeps show error when trying to load "biner.php" view file. I hope someone can help me finding if there's something i've missed. Thank you.
|
|
|
|
|
I finally get it. It's not just the code I use to execute the ExecuteScalar method but it is mainly the code up stream that is executing the class. It is everything calling your code. That said, now can I get someone to look at the up stream code causing my SQL injection errors. First I will show you two examples of the code calling my code, then the calling code, and finally the executing code, which I formulated and displayed from a previous post.
Calling code with Three parameters:
public bool isTamAsp(int aspKey, int fy, string accountCode)
{
MyParam myParam;
string sqlQuery = "select isTamMacom = count(macom_key) FROM hier_fy " +
"WHERE hier_key = @aspKey AND fy = <a href="http:
QueryContainer Instance = new QueryContainer(sqlQuery);
myParam = new MyParam();
myParam.SqlParam = new SqlParameter("@aspKey", Instance.AddParameterType(_DbTypes.Int));
myParam.SqlParam.Value = aspKey;
Instance.parameterList.Add(myParam);
myParam = new MyParam();
myParam.SqlParam = new SqlParameter("@fy", Instance.AddParameterType(_DbTypes.Int));
myParam.SqlParam.Value = fy;
Instance.parameterList.Add(myParam);
myParam = new MyParam();
myParam.SqlParam = new SqlParameter("@accountCode", Instance.AddParameterType(_DbTypes._string));
myParam.SqlParam.Value = accountCode;
Instance.parameterList.Add(myParam);
if (Convert.ToInt32(ExecuteScaler(Instance)) < 1)
return false;
return true;
}
<pre>
Calling code with no parameters:
<pre>
Calling code with no parameters:
<pre>
public long GetMarinesUploadNextUploadKey()
{
string query = "SELECT MAX(upload_key) FROM temp_auth_usmc_upload";
QueryContainer Instance = new QueryContainer(query);
string result = Convert.ToString(ExecuteScaler(Instance));
if (string.IsNullOrEmpty(result))
return 1;
else
return Convert.ToInt64(result) + 1;
}
<pre>
Code calling my previous code with three parameters:
<pre>
public bool isTamAsp(int aspKey, int fy, string accountCode)
{
return e581provider.isTamAsp(aspKey, fy, accountCode);
}
<pre>
Method calling the SQL executing my code:
<pre>
DbCommand command = _provider.CreateCommand();
command.Connection = _connection;
{
command.CommandText = Instance.Query;
command.CommandType = CommandType.Text;
if (Instance.parameterList.Count > 0)
{
foreach (var p in Instance.parameterList)
{
command.Parameters.Add(p.SqlParam);
}
}
if (_useTransaction) { command.Transaction = _transaction; }
try
{
returnValue = command.ExecuteScalar();
}
<pre>
My Class containing the SQL string and the cmd parameter List
<pre>
public enum _DbTypes
{
Int = 1, _string = 2, _long = 3, _bool = 4, _DateTime = 5,
_decimal = 6, _float = 7, _short = 8, _bite = 9
}
public class MyParam
{
public SqlParameter SqlParam { get; set; }
}
public class QueryContainer
{
string _query;
public List<myparam> parameterList = new List<myparam>();
public QueryContainer(string query) { _query = query; }
public SqlDbType AddParameterType(_DbTypes id)
{
switch (id)
{
case _DbTypes.Int:
return (SqlDbType)Enum.Parse(typeof(SqlDbType), "int", true);
case _DbTypes._string:
return (SqlDbType)Enum.Parse(typeof(SqlDbType), "NVarChar", true);
case _DbTypes._long:
return (SqlDbType)Enum.Parse(typeof(SqlDbType), "SqlDbType.BigInt", true);
case _DbTypes._bool:
return (SqlDbType)Enum.Parse(typeof(SqlDbType), "SqlDbType.Bit", true);
}
return SqlDbType.VarChar;
}
public string Query
{
get
{
return _query;
}
set { _query = value; }
}
}
<pre>
|
|
|
|
|
I don't see a concatenated query there. What would be your question here?
Sidenote: You nested 10 (!) code-blocks into each other in your message. Which makes it hard to read. Please use a single code block or, if multiple, not nested into each other.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
This is one of the concatenate queries:
string sqlQuery = "select isTamMacom = count(macom_key) FROM hier_fy " +
"WHERE hier_key = @aspKey AND fy = <a href="http:
<pre>
|
|
|
|
|
It's concatenated with a + but it's not concatenating values as literals. All required values are either hard-coded (like "3,4,7,8") or provided via Sql-parameters.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
You're only concatenating constant strings, not user input or other variables, so there's no vulnerability in that example. You could easily remove the concatenation and declare the query in a single string:
const string sqlQuery = "select isTamMacom = count(macom_key) FROM hier_fy WHERE hier_key = @aspKey AND fy = @fy AND @accountCode NOT IN (3,4,7,8) AND macom_key IN (select hier_key from lkup_e581_MacomThatRequireTAM) AND is_visible = 1 AND is_active = 1";
If you want to split the string onto multiple lines for readability, use a verbatim string literal:
const string sqlQuery = @"select
isTamMacom = count(macom_key)
FROM
hier_fy
WHERE
hier_key = @aspKey
AND
fy = @fy
AND
@accountCode NOT IN (3,4,7,8)
AND
macom_key IN
(
select hier_key
from lkup_e581_MacomThatRequireTAM
)
AND
is_visible = 1
AND
is_active = 1";
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|