Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql_query('SELECT * FROM users WHERE user = '.$_POST['user']);
- $_REQUEST['anything']
- if (some_condition) {
- return false;
- error_log('some error message');
- }
- // Load configuration settings.
- require_once(implode(DIRECTORY_SEPARATOR, array(
- SF_ROOT_DIR,
- 'apps',
- SF_APP,
- 'config',
- 'config.php'
- ));
- if ($condition) {}
- else {
- // something
- }
- if ($condition) {
- $var = 'foo';
- } else {
- $var = 'foo';
- }
- function getAttributes(&$a_oNode)
- {
- $l_aAttributes = $a_oNode->attributes();
- if ($l_aAttributes === NULL)
- return array();
- $l_iCount = count($l_aAttributes);
- $l_i = 0;
- for ($l_i = 0; $l_i < $l_iCount; $l_i++)
- {
- $l_aReturn[$l_aAttributes[$l_i]->name()] = $l_aAttributes[$l_i]->value();
- }
- return $l_aReturn;
- }
- function getText(&$a_oNode)
- {
- $l_aChildren = $a_oNode->child_nodes();
- if ($l_aChildren === NULL)
- return NULL;
- $l_szReturn = "";
- $l_iCount = count($l_aChildren);
- for ($l_i = 0; $l_i < $l_iCount; $l_i++)
- {
- if ($l_aChildren[$l_i]->node_type() == XML_TEXT_NODE)
- $l_szReturn .= $l_aChildren[$l_i]->node_value();
- }
- if (strlen($l_szReturn) > 0)
- return $l_szReturn;
- return NULL;
- }
- if ($condition)
- foo();
- $sql = "SELECT * FROM attendance_exceptions";
- $found = false;
- ...
- $appendSql = " AND YEAR(event_time) = '$_POST['year']' AND MONTH(event_time) = '$_POST['month']' AND DAY(event_time) = '$_POST['day']'";
- $temp = array($sql, $appendSql);
- $sql = join($temp);
- $found=true;
- function verifyQuery($sql, $con) {
- if (!mysql_query($sql, $con)) {
- echo "Error occured in verifyQuery() in sqlfunctions.php <br>";
- echo "SQL sent : ";
- echo $sql;
- echo "<br>Database report: <br>";
- die('Error: ' . mysql_error());
- }
- return mysql_query($sql);
- }
- <?php
- // Obviosly relying on register globals!
- switch($page) {
- case cart:
- echo '<html><head>...</head><body>'.
- some random application logic, including SQL, of course! .
- '</body></html>';
- break;
- case checkout:
- echo '<html><head>...</head><body>'.
- even more random application logic, including SQL, of course! .
- '<form><input type="hidden" name="total" value="X"></body></html>';
- break;
- case complete:
- echo '<html><head>...</head><body>'.
- and again, some random application logic, including SQL, of course! .
- '</body></html>';
- break;
- case error:
- echo '<html><head>...</head><body>'.
- some random application logic, including SQL, of course! .
- '</body></html>';
- break;
- // Show the home page
- default:
- echo '<html><head>...</head><body>'.
- show the home page, if you really don't know what else to do.....
- '</body></html>';
- break;
- ?>
- $str = file_get_contents("db-info.php");
- $str = str_replace("<?", "", $str);
- $str = str_replace("?>", "", $str);
- eval($str);
- $url_parts = explode("/",ereg_replace("(.php|.html|.htm)", "", $_SERVER['PHP_SELF']));
Add Comment
Please, Sign In to add comment