-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
[SOLVED] files requested without extensions
JonnoTheDev replied to JonnoTheDev's topic in Apache HTTP Server
This is the only thing in the httpd.conf file that has a reference to rewrite LoadModule rewrite_module modules/mod_rewrite.so -
Where are $_SERVER['HTTP_CLIENT_IP'] and $_SERVER['HTTP_X_FORWARDED_FOR'] documented? I have never seen these in the manual. http://us3.php.net/manual/en/reserved.variables.server.php
-
And dont rely on global variables. It is obvious you $ipz variable has no value $nww = nw($user, $pass, $ipz); should be $nww = nw($user, $pass, $_SERVER['REMOTE_ADDR']); Also it would be much better if your submission code was prior to any html then you can redirect the user after a successful form submission using header()
-
If I use a flash image that works, unsure why a anim gif doesn't animate on IE. Any ideas?
-
Our server has been pre-configured to request files if the filename extension has not been supplied i.e. abc.com/test.php abc.com/test How can I stop this as it is causing issues with mod_rewrites i.e. if I rewrite a url: abc.com/test/1/3456 The server ignores the rewrite and just requests test.php. Only if I change the string 'test' within the rule to one that does not match the filename will the rewrite work.
-
Web project: hotel booking availability On the above project I have a form that users select dates (arrival / departure) and enter a location to search. When complete the system will request available hotels from a remote server based on the user criteria. This is fine, however the remote server can take some time to return XML if there are a high number of hotels to return. What I implemented was a animated gif to be displayed while the data is being parsed. After the form is submitted and validated it simply displays the following: // form validated showLoader(); <div id="loading" style="display:none; position:absolute; width:100%; text-align:center; top:300px; z-index:300;"><img src="{$smarty.const.IMAGE_DIR}loader.gif" border="0"></div> <script language="javascript"> var loader = document.getElementById("loading"); function showLoader() { loader.style.display = "block"; } </script> This displays fine on all browsers however on IE (v8 I am using) the gif does not animate. It sticks at the first frame until the results screen is displayed. Am I missing something here?
-
My Routes aren't working or for some reason my app is broken!?
JonnoTheDev replied to adgower's topic in PHP Coding Help
print MODEL_PATH; exit(); will do -
Too much margin at the top of the screen. I just have a big patch of grey background on eye level. The image banner in the header would look better if it wasn't so big in height and covered the width of the content area.
-
My Routes aren't working or for some reason my app is broken!?
JonnoTheDev replied to adgower's topic in PHP Coding Help
print this constant out to the errornous page: MODEL_PATH and see what it contains. I bet you have issues with your include paths. -
header location requires POST variables again
JonnoTheDev replied to nickelus's topic in PHP Coding Help
Not at all. Change the script requiring the POST data to use: // from $_POST['varname'] to $_REQUEST['varname']; Then you can use paramaters within the url i.e. header("Location:page.php?varname=".$_REQUEST['varname']); However if you are posting text strings then I do not recommend. Either apply a better design to your code or stor the data within a session after it has been posted. -
$result = preg_replace('%((?:http://|https://)[^ ]+)%', '<a href="$1">$1</a>', $subject); Yes a url will need to start with http:// or https:// If you want to match www. without the http:// then you need to add the http:// to the url for the A tag. Get a tool like regexbuddy to help you write a pattern match. To apply http:// to a string: function addHttp($url) { if(!eregi("^https?://", trim($url))) { $url = "http://" . $url; } return $url; } $url = addHttp("www.google.com");
-
Yes, use a regular expression to find all matches within a string. preg_match_all() Then replace with the url surrounded by A tags using preg_replace() You are obviosly looking for anything starting with http:// or https:// and ending when a space, newline occurs
-
UTF-8 double height problem for internet explorer 6
JonnoTheDev replied to sungpeng's topic in PHP Coding Help
There is no such thing as a closing meta tag </meta> http://en.wikipedia.org/wiki/Meta_element You can only define one character set. -
How do you know that the function is missing? Have you written a small test script to check?
-
My Routes aren't working or for some reason my app is broken!?
JonnoTheDev replied to adgower's topic in PHP Coding Help
How can anybody help without posting any source code? Also have you checked you have applied a valid mod rewrite rule? -
[SOLVED] How to encrypt a PHP file with MYSQL querys
JonnoTheDev replied to adamlacombe's topic in PHP Coding Help
Its your description thats a little misleading. A php file containing code that connects to a mysql database and runs queries is simply php, not mysql. Mysql is a database engine. To encode php files use ioncube http://www.ioncube.com/ However when deploying it on servers they will require the ioncube libraries to decode. Good news is that a lot of hosts have installed the modules, if not you can supply with your app. -
This is absolute garbage. You seriously need to think about redesigning your db structure and codebase. I suggest you purchase a mysql 5 book for your developer.
-
[SOLVED] How to encrypt a PHP file with MYSQL querys
JonnoTheDev replied to adamlacombe's topic in PHP Coding Help
You can encrypt php files with the likes of ioncube. Does the php not contain the mysql queries? Are you trying to encrypt a .sql file (i.e text file containing your create database queries)? You cannot do this if so. Why not use a php file to create the database and insert the data. Then it can be encrypted. -
Is really search engine optimization needed?
JonnoTheDev replied to seostepnet's topic in Miscellaneous
goolge? Is this a new search engine I haven't heard about LOL. Have you tried Hooya? -
whoops - sorry. had both open in 2 windows.
-
Validate your url parameters and use 404 pages if not valid i.e. http://www.cubevision.eu/tutorials.php?dir=sdfasdf
-
There are issues with the forum on IE8. When replying to a post the text input area refuses to scroll after a certain number of carraige returns. Although you are still able to type you cannot see the output. You can use the arrow keys to move down to view the text however as soon as you start typing the text displayed is from the starting paragraph (i.e. cannot see what you type / box focus moves)
-
By magic! No, your server's settings are used. Change the timezone on your sever if required. If you cannot do this then php has functions to display the correct time for your locale.
-
cURL can make any request and is much more efficient that any other method. Essentially cURL is a web browser for php. You need the exact field/parameter names to make a POST or GET request. You may need to login to the website via cURL and set a session / cookie (fopen / fputs / fsockopen cannot do this so you would never authenticate to the remote site). Please post the code you have.
-
This is done with an ajax request and a bit of DOM scripting. Here is a simple demo: http://www.satya-weblog.com/2007/04/dynamically-populate-select-list-by.html