-
Posts
43 -
Joined
-
Last visited
Everything posted by xenLiam
-
It's a rewrite rule, not a condition, so I don't think it needs any more flags, although I may be wrong, as I am not an expert in rewrites. I managed to test it by placing an index.php file in the root of my localhost LAMP server and inside the index.php I wrote: <?php if(!empty($_SERVER["QUERY_STRING"])) { echo $_SERVER["QUERY_STRING"]; } ?> ... and it seems to work just fine.
-
Hi there, stranger that I've never met before. </sarcasm> Nice to see you around here.
-
Web designing is basically everything to me. Nobody will be interested in a site with a design from the 90s (unless that's what the theme of the site is). I try my best to keep up with standards and put user interaction at first priority.
-
Mhm, well then I guess I'm all out of options unless you use jQuery. Sorry.
-
installation on Windows 7 fails
xenLiam replied to hyess's topic in PHP Installation and Configuration
Doesn't IIS contain a "Web Installer Platform" that allows a one-click installation of PHP for use in IIS? -
changing wwwroot directories
xenLiam replied to neginf's topic in PHP Installation and Configuration
What were the warnings? If you're running Linux/Unix then I guess those would likely be permission problems, but I think that's a far idea. -
Your existing code, as you said, is already there. The problem is converting the month. You can do it manually, but it's a long code. $months = array( "01" => "January", "02" => "February", "03" => "March", "04" => "April", "05" => "May", "06" => "June", "07" => "July", "08" => "August", "09" => "September", "10" => "October", "11" => "November", "12" => "December" ); echo $months[$bday[1]] . " " . $bday[2] . ", " . $bday[0];
-
Create an .htaccess file and put this in: ErrorDocument 500 http://site.com/500.html Replace the URL to match the location of your error page. You can do the same for 403s, 404s, etc.
-
You said you were using WHM, so you can enable the PHP extension "mbstring" via EasyApache. You do have to recompile Apache to get it working though. If you're working with a bare VPS server (I considered that you may have a different server for WHM and running your Wordpress/WHM integration script on another VPS), you can enable PHP in the following way (considering you installed PHP through the system's package manager and not through source building): # For CentOS/RHEL/Fedora yum install php-mbstring You need to have the EPEL repository for that to work though.
-
You said no jQuery. Here's one in pure JS. function iframe_height() { var iHeight=document.getElementById('your_iframe_id').contentWindow.document.body.scrollHeight; document.getElementById('your_iframe_id').height=iHeight; } You can call it through: <iframe src="yourpage.html" id="your_iframe_id" onload="iframe_height()"></iframe> I haven't tested this one out yet, but in theory it should work.
-
Is $files an array? If that's the case then you can use this: if(count($files) != 0) { // Show the files } else { // Show the error message } I can't seem to understand your code, it's broken. I don't know where $files came from. Including the part where $files is declared can help.
-
For the "Cannot modify header information" error, you can't put a header() anywhere in the code after text has been printed out. You can try to resolve that by adding ob_start() to the top of the script to buffer the output (after the first <?php). As for the rest of the code, you seem to be using 2083, which is the SSL port for cPanel, when you call the function, but I don't see that being used anywhere inside the function (you connect to 2082, the standard HTTP port). Not saying it's the problem, just pointing it out.
-
I don't think you can install Git on a shared hosting environment. You would need root access to install the git binaries alone.
-
I don't think there would be such a script that checks the file's contents, as different file types have different ways to be read. A simple code snippet I can give you: <?php $dir = "./repository/"; // The folder where all the files are $search = "text"; // This can also be a POST or a GET, or whatever. It will search for anything with the file name containing "text" (text.jpg, subtext.exe, etc.) // Code foreach(glob($dir."*") as $key => $value) { $file = str_replace($dir, "", $value); if(is_int(strpos($file, $search))) { echo $file . "<br />"; // Echo the file that matches what you were looking for } }
-
If you wanted to run a specific code in PHP 50 times, you can use any of the loops, depending on how you want to use it. Using the "for" loop: for($i=0;$i=50;$++) { // Your code Here } Using the "while" loop $i = 0; while($i != 50) { // Your code here $i++; } Replace " // Your code here " with the code you want to repeat. I don't want to bother reading all of your code to figure out which one. lol.
-
What do you mean you want to run curl in "50 time"? 50 seconds? That will still depend on your server configuration and the default cURL timeout. I don't know if it's just me or I really did not get what you wanted to know. And please, enclose your code in the forum's built-in code block. Man, was that painful to read.
-
how to inclued more then 10 php file .........in a main php.......?
xenLiam replied to ShivaGupta's topic in PHP Coding Help
trq is right, there is no limit on file includes. Perhaps you're having inclusion conflicts where you've mistakenly included a PHP file on one file and then on another file. In that case, use a require_once or include_once. -
Try this. <rewrite> <rules> <rule name="Redirect to WWW" stopprocessing="true"> <match url=".*"> <conditions> <add input="{HTTP_HOST}" pattern="^domain.com$"> </add></conditions> <action type="Redirect" url="http://www.domain.com/{R:0}" redirecttype="Permanent"> </action></match></rule> </rules> </rewrite>
-
Try this (I'm no expert on this myself, but it's worth a shot) (Edited) RewriteEngine On RewriteRule ^([a-zA-Z0-9]+)$ /?$1 In theory, that should make http://site.com/1 be the equivalent of http://site.com/?1. Also, I didn't set it so that it would redirect URLs with /?1 to /1 and vice versa. Also worth noting is that you have to change / to the path of your URL. Note: Edited it to work with words and numbers + tested.
-
So, hi. I'm Liam. I'm currently 16, and I'm taking up a Bachelor's degree in Information Technology at the University of the East - Manila campus. If anyone's familiar with the web hosting script "TheHostingTool", I've written a lot of plugins and mods for it, and I've managed to code a video downloader for myself and my friends some time before. Some personal info, I LOVE and LIVE FOR music. I sing and play the piano, guitar, bass and I used to be in a band. I also love cooking, and I love spending the day coding a snippet of whatever I come up with. Looking forward to having fun in the community.
-
Wamp xampp or IIS , which one?
xenLiam replied to alfredo's topic in PHP Installation and Configuration
I use WAMPServer on my laptop and it works fine. Last time I used XAMPP it was very confusing (I was a beginner then, go figure). I find WAMPServer easier because I can have multiple PHP versions and change to any of them at the click of a button.