This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// In response to: http://www.reddit.com/r/PHPhelp/comments/1ddwod/im_a_total_noob_here_is_my_problem_i_am_required/ | |
$val = array( | |
array("Time", "10AM ", "11AM", "12AM","1PM"), | |
array("Pigs Kilt","100","200"), | |
array("Pigs Rubbed","300","400"), | |
); | |
echo "<table>". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// in response to: http://www.reddit.com/r/PHPhelp/comments/1d7jsr/retrieving_dynamically_generated_values_from_a/ | |
# NOTE: I wouldn't recommend keeping all of this in 1 file. For simplicity sake though, I will. | |
if(isset($_POST['ajax']) && $_POST['ajax'] == 'db_data') | |
{ | |
$test_mode = true; | |
/* this variable is just included so you can easily swap between a query | |
* and the provided array. (for easy testing) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// in response to: http://www.reddit.com/r/PHP/comments/1dknt8/is_there_any_vulnerabilities_in_this_method_ci/ | |
# Option 1 - Use CodeIgniter's built in DB sanitization. | |
$user_id = $this->db->escape($this->input->post('user_id')); | |
$query = $this->db->query("SELECT name FROM users WHERE user_id = ?", array($user_id)); | |
# Option 2 - user_id will ALWAYS be an integer, force it. Any strings will return 0, which is safe to pass. | |
$user_id = (int)$this->input->post('user_id'); | |
$query = $this->db->query("SELECT name FROM users WHERE user_id = ?", array($user_id)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
/** | |
* Thank you, Beatport for having hardcoded JSON data right on your beats pages... | |
* will expand further on this script at a later point in time.. | |
* For educational purposes only, please support your artists. | |
* | |
* @author Steve Birstok <[email protected]> | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/nginx/sites-available/example.com | |
server { | |
listen 80; | |
server_name www.example.com; | |
return 301 http://example.com$request_uri; | |
} | |
server { | |
listen 80; | |
server_name example.com; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_GET['get_the_data'])) { | |
exit(file_get_contents(hex2bin('687474703a2f2f7777772e756c7472616d75736963666573746976616c2e636f6d2f64622f312e302f6f626a656374732f66696e643f63726974657269613d7b253232736974655f69642532323a2532323534303235303263656439616163333930333637323137612532327d'))); | |
} | |
?> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Get Slugs from ULTRA</title> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ "$(curl "reddit.com/api/username_available.json?user=$1" -L -s)" = "true" ]; then | |
echo "The username $1 is available on reddit."; | |
else | |
echo "The username $1 is NOT available on reddit."; | |
echo "Profile: http://reddit.com/u/$1"; | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add as a bookmark. | |
* Open all the tabs you want, and click the bookmark to close them! | |
*/ | |
javascript:if(document.domain==='docs.appcelerator.com'){var closes=document.getElementsByClassName('close');if(closes.length>0)for(i in closes)if(!isNaN(parseInt(i)))closes[i].click();} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// chase_transactions.js | |
var transactions_to_get = 2; | |
var stopNum = 9+(6*(transactions_to_get-1)); | |
$sum = 0; | |
for($i=9;$i<=stopNum;$i+=6) { | |
$foo = parseFloat($($("#DDATransactionDetails_DDAPrepaidTrnxDetailsGrid").find('td').get($i)).text().trim().replace('$', '')); | |
if (!isNaN($foo)) $sum += $foo; | |
} | |
alert("$"+$sum); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://ctf.infosecinstitute.com/ | |
## Level 1: | |
View the source, at the top we see: | |
<!-- infosec_flagis_welcome --> | |
Level 1 PASS: infosec_flagis_welcome |
OlderNewer