Why do we use array() when executing PDO commands? even when the parameter is just one single value? In other words, why is execute($value) not a valid statement?
@phpNoOBఠ_ఠ How is it overriding logic? You always pass an array of parameters as the first argument of the method. Regardless of how many parameters that is
Anonymous
Well, the question is then why should the " first argument of the method be an array" even when the argument is a single value. @cspray
In computer science and probability theory, a random binary tree refers to a binary tree selected at random from some probability distribution on binary trees. Two different distributions are commonly used: binary trees formed by inserting nodes one at a time according to a random permutation, and binary trees chosen from a uniform discrete distribution in which all distinct trees are equally likely. It is also possible to form other distributions, for instance by repeated splitting. Adding and removing nodes directly in a random binary tree will in general disrupt its random structure, bu...
while i was using django and python, i found that either i have to use mrkdown laguage or escape the html properly in the textarea, but in php we donot need to do that.. why ?
@PeeHaa埽 Yeh alright, I've applied for a couple but I'm not that interested in them, but I figure I might as well get some interview experience. Actually someone emailed me of the back of my SO account with a job offer but it's a bit far away and would involve some (but apparently not much) Ruby
but if i write <ul><li>hello </li></ul> in a textarea in php and then append the contents to a div then what i have typed in just that gets printed, no html formatting occurs
<script>
function check() {
var p=document.getElementById('abc').value;
document.getElementById('content').innerHTML=p;
}
</script>
<div id="content"> <form method="post" action=""><textarea id="abc"></textarea>
<input type="button"value="submit" onClick=" check();"/></form> </div>
</div>
this is what i am using
i have tried inputs like
<ul><li>Hello</li></ul>
<a href="javascript:alert('xss')">hi</a>
I added a session & used this code to prevent user from accessing a page after logout but i can't do so. User can still access the previous page.Here is the code
login code is
<form id="form1" name="form1" method="post" action="alogin.php" onsubmit="return(validate());">
<p align="center"><f...
I don't find out if you can also put (under which eventual conditions) flow content in html4 into an <a> tag? May someone help me googling, I'm too dumb to use the right keyword appearently...
@CodingNoob The code you have should just work. Please enable error reporting. exit; after redirects. And var_dump() the $_SESSION super global where you think it should be cleared
You know, I think we'd all assume taking a shit is a FIFO operation; however upon inspection I appear to have performed a LIFO operation (barring of course, the possibility of toilet bowl acrobatics)
@PeeHaa埽 here is the current code i am using "<?php session_start(); if(isset($_SESSION['name'])) { if(!$_SESSION['name']=='admin') { header("Location:login.html?id=You are not authorised to access this page unless you are administrator of this website"); } } else { header("Location:login.html?id=You are not authorised to access this page unless you are administrator of this website"); }?>" and in logout the code is "<?php session_start(); $_SESSION=array(); setcookie(session_name(),"",time()-3600);
@DaveRandom Oh, understandably, however I did leave out the detail of having consumed great quantities of gummy worms and blue-raspberry slushees, which provided quite an color indication.
Vivid, if I must say so.
user652649
@DaveRandom ok i'm leaving so
user652649
xD
Anonymous
@CodingNoob do you acctually have this on your site header("Location:login.html?id=You are not authorised to access this page unless you are administrator of this website");
@CodingNoob first focus on the main problem. That script I mentioned is not the cause for your session-related problems. Just fix the session problem first.
hi table preset contain id, sspsid,categoryid id = 1, sspsid = 1,2,3,4,5,6, categoryid = 1 query select preset*., category.title, etc how can I select ssps table title contcate
The PHP development team announces the immediate availability of PHP 5.4.16 and PHP 5.3.26. These releases fix about 15 bugs, including CVE-2013-2110. All users of PHP are encouraged to upgrade to PHP 5.4.16. For source downloads of PHP 5.4.16 and PHP 5.3.26 please visit our downloads page, Windows binaries can be found on windows.php.net/download/. The list o…
@webarto hey man how's it going? i'm looking for a vps too, do you know some good hosting company in central europe that does English support? france, germany, austria...
@StuartKaufman No. What you put in is appropriate encoding for HTML in the context of normal HTML content. Depending on where the value is being output (url, JS, CSS, HTML content, HTML attribute, etc) different encodings must take place
@StuartKaufman Ok, but if you're able to add the code to concatenate a string into a URL query then you can create an associative array and concatenate the output of the http_build_query function
Do whatever way is simplest for you
But the $amp; situation and other encoding issues are gonna be handled properly by PHP's functions that deal with URL building
So, my script allows people to write content into a .txt file and save it on the server. They can currently write anything they want to. This is the method I'm using to save the file.
<?php
$victim = $_POST['victim'];
$user = $_POST['user'];
$comment = $_POST['comment'];
$IP = $_POST['IP'];
$d...
The easiest way to copy large files can be demonstrated here Save large files from php stdin but the does not shows how to copy files with http range
$url = "http://REMOTE_FILE";
$local = __DIR__ . "/test.dat";
try {
$download = new Downloader($url);
$download->start($local); // Start ...
Ok so I was working on some bash scripts which I use for my webserver, I have an update script I was moving which has the following code at the end to empty out the temp downloads directory rm -fr ${DOWNLOADS_DIR}/* after the updates are downloaded and applied. Well that variable is included into script via source ./paths.sh well I had earlier changed the name of the variable as I was doing a lot of modifications to the update system.
So when I had acidently executed the file, which would normally be harmless and just do update no big deal it ran the code, but since the var was missing it was intepretted as rm -fr /*
yeah, lesson learned, backup more often, don't mark any local dev files as executable, and find out a safer way to empty a directory in case the path var is missing
Does anyone know how I can safely empty the directory? The only way I have thought of is to create a var DELETE_DIR=${DOWNLOAD_DIR}/* then before passing it to rm check to make sure it contains a path.
Ok - but usually a website is user => websitename, group=www-data. So if you were running the script as websitename, it wouldn't have been a big problem - but I still think just including at least one bit that is hard-coded would also stop it being such a horrible problem.