PHP - Shared Hosting And Security
Hello - I have usually run my own servers, and always drop my .php files with MYSQL connection strings in a directory like /var, with webroot being /var/www/mysite.
I now find myself in a shared hosting environment for a client and wondering the safety of my connection string .php files. Unfortunately they are sitting in a folder in the root of my hosting directory right now, and they feel vulnerable. It seems the only thing I could do would be to put the root of my hosting into a subdirectory, point the site there, and then put my connection strings on directory back. But seems the problem is they are still in my shared hosting. What's the best way to secure this type of sensitive info in a shared environment? I'm also getting ready to explore credit card processing via an API, and wondering if shared hosting is even worth it. Thanks!! Similar Tutorials
Not experienced coding PHP and need help doing something which is probably very easy but looks like Mt Everest to me. FOO = 123456 BAR = abc Then, write URLs with those variables and have them work the same in a browser:
http://webpage1.com/?var1=FOO&var2=BAR
http://webpage2.com/?var1=FOO&var2=BAR
http://webpage3.com/?var1=FOO&var2=BAR If I update the fields in my local webpage and refresh browser, would like the new value(s) to be used instead. Any help with this greatly appreciated. If someone will put a file together think that I can edit and modify from there for my specific application. Thank you. Edited December 1, 2020 by XcloneI have one array, called for example $MainImages : - Code: [Select] Array ( [0] => Array ( [widgetID] => 143 [image] => image_a.jpg ) [1] => Array ( [widgetID] => 147 [image] => image_b.jpg ) [2] => Array ( [widgetID] => 73 [image] => image_c.jpg ) ) and a second array, we'll call it $widgets: - Code: [Select] Array ( [0] => Array ( [widgetID] => 147 [seo_title] => An excellent class B Widget [name] => Widget B [categoryID] => 1 ) [1] => Array ( [widgetID] => 73 [seo_title] => An excellent class C Widget [name] => Widget C [categoryID] => 1 ) [2] => Array ( [widgetID] => 143 [seo_title] => An excellent class A Widget [name] => Widget A [categoryID] => 1 ) ) I want to merge the value from the [][image] key from the first array into a new [][image] key / value in the second, using a shared value as a reference...so the desired result array is: - Code: [Select] Array ( [0] => Array ( [widgetID] => 147 [seo_title] => An excellent class B Widget [name] => Widget B [categoryID] => 1 [image] => image_b.jpg ) [1] => Array ( [widgetID] => 73 [seo_title] => An excellent class C Widget [name] => Widget C [categoryID] => 1 [image] => image_c.jpg ) [2] => Array ( [widgetID] => 143 [seo_title] => An excellent class A Widget [name] => Widget A [categoryID] => 1 [image] => image_a.jpg ) ) Obviously the order is different and so they need to be merged based on the widgetID values. Also, the same widgetID may be in each array more than once. I've looked at a lot of help but can't find anything to do exactly what I need....any help would be greatly appreciated! Ok here it is, seems like it is an easy problem but my developers are having some issue with this, I hope you guys can help. Basic question and answer problem, where I am developing a website that uses Items and questions like " How many of this Item do you need?" the answer seems to simple. Lets say the answer Is "1". The display is given to the Item list and we move on. Here is the Problem: When selecting Muiltiple Items in the List and they all have the same question associated to each Item: "How Many Items do you need?" the the answer is shared between the Items, Again, sounds simple so far, However, when the USER selects Multiple Items on a list say 30 Items then the Question should only be dispalyed one time, not 30 times, then the answer is shared 30 times. Thats what I have now being displayed on my website, 30 of the same questions over and over again. The USER will get frustrated and leave the site never to return. Question: How can I get the Question to be displayed only once, but shared between several items on a list? This is a very serious problem fo my website because I will have not have just one Item on a list but 300 to 400 items, and if I get the answer to the problem I have just wasted 1 year of my life developing something undevelopable (is that a word?). Any Help you can give me would greatly be appricated. Thank you in advance. I am on a shared hosting server running CentOS. I have copied a PHP extension (imagick.so) that was built on similar server to my shared hosting server. I have resolved most of the dependencies by placing the missing files in ~/lib but I have one that I can't figure out how to cope with. I am getting the following error: Hi, I have Code: [Select] $to = 'rberbe2002@msn.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com'; mail($to, $subject, $message, $headers); which works fine on a shared hosting website I have, but not on a website I have on my dedicated server. Any ideas or suggestions please? Hi,
I would like to ask if someone knows a trick to know if the script is running on a shared hosting or a vps or a dedicated server.
Regards
Hi,
I'm newbie. My requirement is to open network shared folder from PHP.
This works fine in IE but not in Chrome.
Can anyone please help me ....
Thanks
I implemented google's reCAPTCHA V2 on http:// on the remote apache shared server and it worked 100%. I then changed the protocol to my shared server SSL using the same PHP script as the non-SSL script. The older version of reCaptcha had an SSL 'false' to 'true' SSL parameter, whereas I can't find one for V2. I had to use htaccess to redirect the example.com to the shared SSL server https://serverid.net/example/ which works perfectly without recCAPTCHA. I incorporated reCAPTCHA V2 and the error message where the reCAPTCHA image should be shows "ERROR: Invalid domain for site key". Hi all i was wondering if someone knows a way to make sure an image which is uploaded isn't infected by a virus. I have read about avclam, but if your on a shared host your mostly not allowed to add own software. Isn't there maybe a php trick to resize the image which would magically remove a virus? If anyone knows a nice way or tricks to limit the virus breating space to a certain folder please let me know. This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=317008.0 Hello, I am new. I have created a very simple webpage that has content the changes when a link is clicked. The site works perfectly on my "localhost". I am running Apache 2.2 and PHP 5.3 on localhost. When I upload to my GoDaddy shared hosting, ( I beleive Apahe 1.3 and PHP 5.2) my "index.php" displays fine on load. However, when any of the links are clicked the content area where it is supposed to change disapeears. Here is a sample of the code that I am using: // These are the links in the index.php html code... <li><a href="index.php?id='home'" id="home" name="home">Home</a></li> <li><a href="index.php?id='form'" id="form" name="form">Register</a></li> <?php include("form1.php"); getPage(); ?> html.... Then on the form1.php page is the following code... function getPage() { $linkID = $_GET['id']; if ($linkID == NULL) { changeBool("'home'"); } else changeBool($linkID); } //end example The function "changeBool()" has a switch structure that is determined by the $_GET[] var. I beleive this has something to do with the php.ini settings, possibly the apache settings...any ideas would be greatly appreciated. Hello, we got a site running in to different servers, the other one is a sub domain that will be use as internal pages and the other one is external. As of that I need to pass session to see if a user details.
Is there a another secure way to pass session data to other server without storing on the database?
Hi; I had an email from my hosting company which said that my account was hacked and one script in images folder is trying to send thousands of spams(file name : "/public_html/images/sm5vy7.php"). they blocked my account and asked me to check if there is any script or code that may cause this problem. The only server side page I had was a contact.php file that has mail() function in it. the code is like this; "if( isset($_POST['submit'])) { $name=$_POST['name']; $comment=$_POST['comment']; $email=$_POST['email']; $phone=$_POST['phone']; $to = "sample@gmail.com"; $subject = "sample"; $message = "sample"; $from = "$email"; $headers = "Content-type:text;charset=utf-8" . "\r\n"; $headers .= "From: $from" . "\r\n"; mail($to,$subject,$message,$headers); }" My question is "can the code I used cause any security problem that someone be able to create a php file in my images folder or someone has accessed my account?" Thank you in advance I'm really in a big trouble Hello guys, I have created a mini image hosting website. Well, I have successfully coded the file upload, including security to allow certain image extensions and size as a beginner in PHP. However, only one thing remains is the image link. You can view the website on this address http://mini-image-hosting.99k.org/ where it is currently hosting on a free web hosting account with a free sub-domain. Right now, only the image can be uploaded and is being stored in a directory. Nevertheless, I want that when the person uploads an image, he gets also the link, for example: http://mini-image-hosting.99k.org/xxx.jpg something like that. Can you help me for this? Code: [Select] <div id="recent"> <p class="title"><?php echo "Staff Picks"; ?></p> <div id="gallery"> <?php $i = 0; while($album = mysql_fetch_row($recent)): ?> <?php if(++$i%4 == 1): ?><div><?php endif; ?> <?php $image = mysql_fetch_row(mysql_query('SELECT `id`, `extension` FROM `image` WHERE `album_id`='.$album[0].' ORDER BY `id` DESC LIMIT 0,1')); ?> <a href="<?php echo WEB; ?>a/<?php echo alphaID($album[0]); ?>"> <img src="<?php echo WEB; ?>small/<?php echo alphaID($image[0]); ?>.<?php echo $image[1]; ?>" alt=""/> </a> <?php if($i%4 == 0): ?></div><?php endif; ?> <?php endwhile; ?> <?php if($i%4 != 0): ?></div><?php endif; ?> </div> I have this code, which on my image hosting website, displays a grid of the latest albums of images that users upload. I really have no experience in Php. I to change this code to simply display a grid of albums that i choose, not the latest. Like 'staff picks' instead of 'most recent'. Any help would be greatly appreciated. Hey Friends,
I am new to this forum, and does not know anything about programming. And I require very small help from the experts of forum. I have downloaded free image hosting script from web & it is not working fine, it gets stuck at basic.php (one of the file in script). I am sharing the script here also sharing the website. My website : bsm1313.5gbfree.com
Note : I have uploaded a rar file. Kindly change extension to .rar from .php. as it was not allowing me to upload the rar file.
Any kind of help is highly highly appreciated. Thanks a ton in advance.
Attached Files
easyimagehoster_1.32.php 35.46KB
5 downloads I'm running about 50 domains on a private host that's going out of business, so I need to move providers soon. The Amazon or Google cloud platforms are intriguing. Does anyone have any experience using either for website hosting?
My current solution is a Plesk management interface. So, I'm hoping to install the same wherever I go (because migrating 50 domains manually ...)
I launched my new website about a month ago. I switched from one web host to another due to poor hosting performance. Now I'm running into the same issue again -- poor web hosting performance.
My first web host was Hostgator. My current web host is AT&T. I hate the thought of switching to a different web host every month trying to find one that will reliably host my site. Does anyone here have a reliable web host that they use and would recommend?
My question is relative since what is reliable for a simple web site, may not be reliable for one that is more complex. For this reason, I can't simply trust web host reviews.
My website isn't overly complicated, but it's more complex than just basic HTML. It uses a lot of PHP, as well as a MySQL database that only has two small tables. The website uploads and downloads small text files regularly. It also sends E-mail attatchments quite often.
Because I just launched, my website isn't getting a ton of traffic -- about 10 users per day. However, I'm beginning to run into the same problem as before. My web host's server is starting to show itself as being unreliable. As with my first web host, it seems as if it may be due to overcrowding on the shared server.
Do any of you run any moderately complex websites? If so, who do you use for a reliable web host?
I've considered setting up my own server with a LAMP configuration and hosting the site myself. However, I don't know a lot about Linux or Apache, and so would like to avoid this. But because the computer would only be hosting my own website, and no one else's, I have to believe that a LAMP setup would be more reliable than a shared server that is overcrowded.
A reliable web host is really what I'm looking for. But I don't want to keep going down the road of trial and error. If anyone uses a web host that reliably supports their moderately-complex website, then I would love to hear from you. I'm sick of my site failing due to server issues. Like the Duracel commercial says, "It just has to work!"
Please forgive me if you feel that my post doesn't correctly fit the forum category. I tried to figure out which category best fits this topic, but none of them seemed to be perfectly suitable.
Thank you for your time, as well as for any suggestions.
Forbidden You don't have permission to access /cgi-bin/sendmail.php on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Hi: I have a site hosted (shared) on 1and1.com hosting, and they seem to have a file upload limit of 2MB. Is there a way to overwrite this? I have been trying a .htaccess and php.ini file, but can't get it to work. The folder with the upload form is called "admin," in the ROOT of the site. Been trying (in both the ROOT and the "admin" folder): php.ini Code: [Select] ; Maximum size of POST data that PHP will accept. post_max_size = 8M ; Maximum allowed size for uploaded files. upload_max_filesize = 8M ini_set('memory_limit','128M'); .htaccess (in both the ROOT and the "admin" folder): Code: [Select] php_value memory_limit 24M That is all the code in each file - am I missing some code? Can this be done? Thank you. |