PHP - Safe-mode And Its Effects On Vhosts - Why Does Turning Off
i run several wordpress on domains - and wthin the wordpress i have a plugin that allows uploads of images -within a certain plugin
the interesting thing: image upload is - sometimes possible and sometinmes impossible: see here the circumstances - PHP Version : 5.3.28 PHP Safe Mode : On image upload is impossible - and on the same server - a second vhost PHP Version : 5.3.28 PHP Safe Mode : off image upload is possible why is this so - does it have to do with the safe-mode - Similar Tutorialscan we set limit in safe mode as the hosting company would not off the safe mode so please help i get following error, Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in safe mode in /home/evercash/public_html/5dollarmatrix.co.cc/admin.php on line 190 elseif($b=="Compress Matrix") { set_time_limit(6000); include "config.php"; hey i was hoping to add a checkbox to my upload form on my site how would i accomplish something like this set to mature [checkbox here] having a problem turning this sql into a query and I need it to only update rows where id field is empty. Code: [Select] UPDATE systems SET naqahdah = naqahdah + naqahdah_mines * 2 I tried this out with failure Code: [Select] <?php mysql_query("UPDATE systems SET naqahdah= naqahdah + naqahdah_mines * 2 WHERE id <> ' ' "); ?> so i tried getting rid of WHERE and couldnt even get this to work. I tested the sql out it works fine. Code: [Select] <?php mysql_query("UPDATE systems SET naqahdah= naqahdah + naqahdah_mines * 2 "); ?> I am trying to turn a .txt file into an array, count the items in the array, and display a random quote from it.
<p class = "center"> <?php $Proverb = file('../proverbs.txt'); $ProverbCount = count($Proverb); echo rand(0, $ProverbCount-1); ?> <br> © 2014 </p>The issue I am having is that it states the file does not exist: FULL PATH: G:\EasyPHP-5.3.2i\www\PHP_Projects\ChineseZodiacs\Includes\inc_footer.php TEXT FILE: G:\EasyPHP-5.3.2i\www\PHP_Projects\ChineseZodiacs\proverbs.txt Please help, thank you. Hey i'm having trouble figuring out how to do this. This is the code grabbing the users who are online and listing them one by one. Code: [Select] $qt=mysql_query("SELECT username FROM users WHERE lastvisit > '$tm' and online='ON'"); echo mysql_error(); while($nt=mysql_fetch_array($qt)){ echo "<tr><td> $nt[username] </td></tr>"; } ?> what i want to do is have each username be a hyperlink that links to their profile how would i go about this? cause i'm completely clueless on this. is there some way i can do it in the php or will i need to make a varchar column for each player that holds their profile link and grab that with the query too? Code: [Select] $stick_topic = isset($_POST['stick_topic']) ? '1' : '0'; does this need to be escaped while entering the database or no because the values could only be 1 or 0 ? srry it's just i got hacked so i am trying to do my security #1 using this below is it safe against hackers? Code: [Select] $post_id = intval($_GET['report']); if ($post_id < 1) message($lang_common['Bad request']); query: Code: [Select] $result = $db->query('SELECT subject, forum_id FROM '.$db->prefix.'topics WHERE id='.$topic_id) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error()); should i escape my $topic_id ? right now i have my date system to say "X amount of seconds ago, X hours ago, X days ago, X years ago, How could i turn mktime() (1290874161) into a mm/dd/yyyy format? so it would say like, "Nov 27, 2010 at Hour:Minute" (whatever the hour/minute is) Hi, I'm pretty new to PHP, struggled my way through most of my encounters with PHP so far, but getting the hang of it I'm looking for a simple script that turns a number or word served by a weather station into a graphic. E.g. If the temp is 20 degrees, a graphic I've designed would be shown, or a cloud or the sun or whatever. At the moment the weather station feed is converted from 'webtags' in to php tags (temp is $temp, wind is $wind etc.) and these echo out as numbers and words on the website. I can sort of see how it would work in my head, but need a little help. Can anyone please point me in the right direction? Thanks (for reference site is www.southtyneweather.co.uk) I got a tab menu, where the user choose his category and a list of sub categories appear. Personally I like the old fashion way, where everything listed like in craiglist.com ... How can I turn the following tab menu, into a simple 3 column list? <!--CATEGORIES--> <div id="selCategories"> <div class="slidetabsmenu menu_fix"> <ul> <?php if(isset($groups) and $groups->num_rows()>0) { $i=0; foreach($groups->result() as $group) { ?> <li id="gr<?php echo $i;?>" class="<?php if($i == '0') echo "selected"; ?>"><a href="javascript:;" onclick="getCat('<?php echo $i ?>','<?php echo $groups->num_rows ?>',<?php echo $group->id;?>);"><span><?php echo $group->group_name;?></span></a></li> <?php $i++;} } ?> </ul> </div> <div class="clsInfoBox"> <div class="block"> <div class="grey_t"> <div class="grey_r"> <div class="grey_b"> <div class="grey_l"> <div class="grey_tl"> <div class="grey_tr"> <div class="grey_bl"> <div class="grey_br"> <div class="cls100_p"> <h4><span class="clsCategory"><?php echo $this->lang->line('CATEGORIES');?></span></h4> <div class="clsCategoryList clearfix" id="catInner"> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <!--END OF CATEGORIES--> Your tips, directions, and support is highly appreciated. I recently had a need to check several arrays, and if an index wasn't set, set a variable to a given value. The code was such that I couldn't perform the isset check all at once. I then thought "wouldn't it be great if I could try the script, and catch the error or warning". Searching a bit, I came across the following script. I am a little nervous, however, that there might be negative consequences of doing so. Thoughts?
set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) { // error was suppressed with the @-operator if (0 === error_reporting()) { return false; } throw new ErrorException($errstr, 0, $errno, $errfile, $errline); }); try { dns_get_record(); } catch (ErrorException $e) { // ... } Advice please. I am setting up a new machine here and I can't remember which to download. What information do you need to be aware of to know whether to install 'non thread safe' or 'thread safe'. I did some googling but didn't find anything that was clear. And is 5.3 good to go or should I stick with 5.2. Thanks in advance for your input! Hello all. Just wanted to run this past you guys to see if I am missing anything important. I am making a script that I plan to allow a lot of other people around the web to use, so I want to make sure it's as bullet proof as possible. I am passing two values and grabbing them with a _GET, one is a big number, and the other is only letters and 8 characters long. her's my code so far. Code: [Select] <?php $clan = $_GET['clanid']; // make sure its an INT //if(isint($clan)){ if(ereg("[^0-9]", $clan)){ //im an int. echo ("ERROR Invalid CLANID"); die; } // make sure its a 8 letter only word. $style=$_GET['style']; // cut style down to 8 characters long. $style=substr($style, 0, 8); if(ereg("[^a-zA-Z]+", $style)) { // Contains only letters. echo("ERROR Invalid STYLE NAME"); die; } ?> to my noob php eye's it looks pretty solid, I cant think of any way a malicious user could get past it, but like I said, thought I would run it past you guys first , you can never be to careful. Hi guys, I have been using the same code for years now to include my default page and pull content into my layouts.
I found the code online and its a bit confusing so was just wondering if its still safe to use, and is it all needed nowadays?
or is there a simpler way i could be doing this?
Thanks for any help
<?php if (isset($_GET['nav'])) { if (strpos($_GET['nav'], "/")) { $direc = substr(str_replace('..', '', $_GET['nav']), 0, strpos($_GET['nav'], "/")) . "/"; $file = substr(strrchr($_GET['nav'], "/"), 1); if (file_exists($direc.$file.".php")) { require($direc.$file.".php"); } else { require("error.php"); } } else { if (file_exists(basename($_GET['nav']).".php")) { require(basename($_GET['nav']).".php"); } else { require("error.php"); } } } else { require("links.php"); } ?> I have a button that uses $_POST to send information to another page. The data is in a hidden input so it's not possible for users to change information. I have nothing to check if the data is correct on the other page. Is it still possible for people to change the $_POST data though? Or somehow send false $_POST data to the other page? Hi guys, I have written a page that contains a form. When the user chooses a color, it is posted, then the posted value is re-written as a filename, sent through a function, and the image on the page uses the "colorized.gif" created by the function to make an image swap "onclick. Problem is, no matter the choice, it always changes the picture to orange! Here is the code for the form: <?php include('function.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>PHP GD CONFIGURATOR</title> </head> <body> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> Red<input type="radio" name="color" value="red" /> Orange<input type="radio" name="color" value="orange" /> Ivory<input type="radio" name="color" value="ivory" /> Black<input type="radio" name="color" value="black" /> <input type="submit" name="submit" value="submit" /> </form> <?php if($_POST['color'] != NULL){ echo $_POST['color']; $file =('gdimages/' . $_POST['color'] . '.gif'); createImg($file); } ?> <img src="default.jpg" name="lola" alt="lola dining chair" onclick="this.src = 'colorized.gif'" /> </body> </html> And here is the function... function createImg ($imgname1) { $base = imagecreatefromgif("gdimages/base.gif"); $top = imagecreatefromgif($imgname1); if ($top) { imagecopy($base, $top, 0, 0, 0, 0, 250, 250); imagejpeg($base, 'colorized.gif'); imagedestroy($base); } else{ header("Content-Type: text/html"); } } I really can't understand it...this is my first attempt at programming something new by myself...and I really need it to work!!! I also plan for this to work with combining more than 2 images from more than two choice menus...so debugging now is definitely necessary. Any suggestions? I have got a date field in my mysql database with events, and as you know date in MYSQL uses yyyy/mm/dd but I would first like to turn this around to dd/mm/yyyy but also turn this into for example "Tuesday - May 1990" would anyone like to point me into the right direction? Much appreciated! Do you know of a way in php to do multitrack video editing? The only tool I have found online is a MltMelt, which is a command line utility. I'm in the process of making an app that merges multiple videos, photos and audio clips into one video, but I was wondering if there was a way to process this in php. Can anyone point me to a PHP library that can handle things like multitrack merging, transitions, color effects, blurring, etc?
I'm looking for adobe premier like features in code. |