PHP - Webhost Php.ini Override Upload_max_filesize
Do any of you know how to override the php.ini file on a webhost to allow uploads using php to be set for 2gig mx file size?
.htaccess is not working and my host says it supports changing the php.ini but nothing seems to be working. Similar Tutorialsim trying to make an art gallery site for my sister with free hosting, i need upload_max_filesize to be at least 3m ive tried many free hosting services and they are all 1.5m ive tried what these guys say http://www.openg.info/entry/php-cpanel-change-upload-max-filesize-cpanel-access-php-ini which is put this in htdocs: .htaccess Code: [Select] #Enables mod_rewrite, otherwise all Rewrite directives below will not work RewriteEngine on #Activates php.ini config located in main folder to work also recursively for all subfolders, obviously replace your_cpanel_user with your full path, you find it in cPanel home page on the left it's called 'Home Directory' suPHP_ConfigPath /home/vol2/20x.cc/20x_6657899/public_html php.ini Code: [Select] upload_max_filesize = 3M post_max_size 8M memory_limit 128M max_input_time -1 which just gives me a 404 and ive tried running this, and it gives me the same old 1.5m every time index.php Code: [Select] <?php phpinfo(); ini_set("upload_max_filesize", "3M"); // Think that's right... phpinfo(); ?> im trying to make an art gallery site for my sister with free hosting, i need upload_max_filesize to be at least 3mb ive tried many free hosting services and they are all 1.5mb ive tried changing it with .htaccess files and php.ini files, seems the free hosts are cracking down on that stuff does anyone know of a free hosting service that has at least 3mb upload_max_filesize? or perhaps someone knows of a service where it can be changed with php.ini files or .htaccess files As we know , A post_max_size used to limit the size of posted data via POST method while the upload_max_filesize used to limit the size of file to be uploaded
I assume. post_max_size = 8m upload_max_filesize = 2m
When i limit the user to only upload 100kb file, i say <pre>
if (!empty($_FILES["myfile"]["tmp_name"]) && ($_FILES["myfile"]["size"] > 100000)) { </pre>
This message occur even when the file is greater than 8 m
The problem come when the file is greater than 10m the warning message for post content is on the page is
Warning: POST Content-Length of 9767236 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
What i want? I want to create my own warning as an error
ie <pre>
if (post_max_size > 18388608)) { </pre>
NB: some developers says we have to adjust the post_max_size i.e 200M what if user upload the file with 210M, the warning message will come back again
Warning: POST Content-Length of 9767236 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
In short i want to give a normal user a meaningful warning
Hi all, I have the following code to check whether the client has javascript enabled in their browser: page.php: Code: [Select] <?php session_start(); if(isset($_SESSION['gocheck'])) {$gocheck = $_SESSION['gocheck'];} else {$gocheck = 'no';} //echo $gocheck; if($gocheck=='no'){header ("Location: ./gocheck.php"); exit;} //----Execution only reaches this line if gocheck.php has been run and Javascript is enabled.-------- unset($_SESSION['gocheck']); //rest of page ?> gocheck.php: Code: [Select] <?php session_start(); $_SESSION['gocheck'] = 'yes'; echo" <!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\" xml:lang=\"en\" lang=\"en\"> <head> <script type=\"text/javascript\" language=\"JavaScript\"> window.location.replace('page.php'); </script> </head> <body> This website requires Javascript to be enabled in your browser. <br /> Please enable Javascript and try again. </body> </html> "; ?> So what should happen is the user is always redirected from page.php to gocheck.php, which sets the session variable $gocheck to 'yes' and directs back to page.php via Javascript. Because $gocheck is then equal to 'yes', page.php shouldn't direct back again tio gocheck.php. This worked fine on my PC (using WAMP), but when I upload the files to the webhost, it seems to get stuck in an infinite redirect loop between page.php and gocheck.php. Also, if I echo $gocheck in page.php, it returns 'no', so it seems as if for some reason the session variable $gocheck is not being set properly by gocheck.php. Could somebody please shed some light on this? Is there an error in my code? Is there something I need to change in php.ini on the webhost's server? Thanks! P.S. WAMP on my PC uses PHP v.5.3.0, but the webhost uses PHP v.5.2.12 - don't think this can be the problem though. Hello, I never really gave a serious thought to the above question until now that I'm trying to actually launch a live site. Well I'm sure most of you are familiar with this situation, where a user my enter a wrong, non existent url, whose root happens to be your domain name. For example, instead of entering domain.com/greetings, the user may wrongly type domain.com/grewtings . How can I make my site to redirect such erroneous urls to my homepage, instead of to my webhost's homepage with an error message? Appreciate all answers. Is there a reason why on my local machine with php, my login system works, but then when I upload my files and test it on my web host, the login system doesn't work properly. I'm using the same php version on my local machine and on my webhost, so I don't understand why it wouldn't work the same. When I try logging in on my webhost, everything processes as normal when a correct user/pass combo is found in the database, however, my session just doesn't seem to be saved, and therefore I won't be logged in. It'll end up refreshing to the home page (as I have it setup), but it won't show me as logged in. Is there something special I need to do in order for the session to be stored correctly? (I realize I haven't pasted any code, but I'm not sure exactly how much code would be needed for me to show in order to resolve the issue). I have a function which echos an array output, which creates links on a page related to that page. It all works well, but the CSS is making the links blue and purple as standard, and I want to overwrite this to make the links white. What can I add to the code to overwrite the style of the echo? The font size is working, but the colour is being overridden. The code I currently have is: echo "<p> <font color='ffffff' size='4pt'>$echo</font></p>";
What am I doing wrong? What other ways are there of redirecting to a different page, other than the standard Code: [Select] <meta HTTP-EQUIV="REFRESH" content="3; ... Ways that cannot be prevented by browsers? Hi guys, I'm sending mail from php running on a cheap webhost with the following: Code: [Select] $to = 'name@domain.com.au'; $header = 'MIME-Version: 1.0' . "\r\n"; $header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $header .= "From: Name <noreply@domain.info>" . "\r\n"; $subject = "Interest registered"; $message = "<!DOCTYPE HTML.. a bunch of html"; mail($to, $subject, $message, $header); As you can see I've set "from" in the headers. When I receive the email however, it says from: myusername@my.cheaphost.com on behalf of Name [noreply@domain.info] I need to get rid of the on behalf bit as it looks completely unprofessional. I just want it to say from: Name [noreply@domain.info] Obviously this is probably something to do with the setup of the server, some of which I have no control over. I have access to another mail server which I can use to send email, so I put this at the start of my code: Code: [Select] ini_set('SMTP', 'mail.myotherserver.com.au'); echo ini_get('SMTP'); Which returns mail.myotherserver.com.au however, when I use the mail function, it still comes from myusername@my.cheaphost.com on behalf of Name [noreply@domain.info] Is there something I'm missing, is the mail function not tied to the SMTP value? Thanks I need to add more code to an existing function located inside the parent class. I'm using code like this but can't get it working :
// Parent class Default_Fields { public function fields() { $this->_fields = array() // Default Code } } // Child class More_Fields extends Default_Fields { public function fields() { $this->_fields = array() // Modified Code } } $new = new More_Fields; $new->fields();
This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=343981.0 Hi there,
I have a timetable plugin that shows booking entries.
The times are generated dynamically by the plugin.
Now I have the situation where I need to override the automatically created time that shows in a table row.
Here's the HTML code generated by the plugin:
<tr class="row_12"> <td class="tt_hours_column">00:00</td>Ist it possible to have a simple PHP script that does the following (please forgive my noobiness) ? if table row is "row_12" then insert "my own pre-defined time" Please don't hate on me, I know I have not the slightest idea about php. I'm just wondering how to solve my plugin problem and if PHP is the right way to do it. I highly appreciate any feedback from you guys |