-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
How to enctypt URL ? like page.php?id=XXXXXXXXXXXXXXXXXXXXXXX
JonnoTheDev replied to ankur0101's topic in PHP Coding Help
Mod Rewrite - Check out the mod rewrite forum boards or look at http://www.easymodrewrite.com/ for a simple tutorial. Validating url parameters: // this is an example url http://www.xyz.com/index.php?id=1 // index.php // the value of $_GET['id'] must be numeric. If it isn't throw a 404 header or die // i.e. http://www.xyz.com/index.php?id=abc - will not execute if(!is_numeric($_GET['id'])) { exit(); } // now I will use the value in an sql query - if no records are returned throw a 404 header $result = mysql_query("SELECT * FROM table WHERE id='".mysql_real_escape_string($_GET['id'])."'"); if(!mysql_num_rows($result)) { header("HTTP/1.0 404 File Not Found"); die("File not found"); } -
Nice find. As long as they have an active directory & LDAP
-
The script you have posted has nothing to do with the error. This script calls resize() but does not declare it! In the file with the error you must be including i.e. include('functions.php'); more than once or you have the following declared more than once: function resize() { } Do a scan of your web files for 'function resize' and see how many times you find it. You can only have 1 function with a particular name. Also if this is not the case then change any include() to use include_once() or require_once() for the errornous script.
-
How to enctypt URL ? like page.php?id=XXXXXXXXXXXXXXXXXXXXXXX
JonnoTheDev replied to ankur0101's topic in PHP Coding Help
I don't know why you are attempting to implement such a function. Why would you need to encrypt url parameters? You should not be passing anything through the url that could compromise your program. A simple mod-rewrite regex can validate the parameters are of the correct type. If you used md5() or any other encryption then you have no way of decrypting the values on the resulting page. You should validate URL parameters - not encrypt them -
How to enctypt URL ? like page.php?id=XXXXXXXXXXXXXXXXXXXXXXX
JonnoTheDev replied to ankur0101's topic in PHP Coding Help
eh? Why not just check the php manual rather than guessing. To encode & decode: $string = 1; // encode $string $encoded = strtr(base64_encode(addslashes(gzcompress(serialize($string),9))), '+/=', '-_,'); // decode $encoded $decoded = unserialize(gzuncompress(stripslashes(base64_decode(strtr($encoded, '-_,', '+/='))))); -
Because you have 2 functions with the same name or you are including the same file more than once on your script.
-
Would require some Active X component to enable integration with the Windows system.
-
How to hide user name and password in configuration files
JonnoTheDev replied to everbright's topic in Application Design
Encrypt with ioncube: http://www.ioncube.com/ However if your admins can update php files then youre pretty much stuffed as they could output all variables from any part of the system. -
file_get_contents($url) is slow. If you want to read the page and extract parts from it then the best method is CURL. Read the examples http://uk.php.net/manual/en/book.curl.php
-
How to hide user name and password in configuration files
JonnoTheDev replied to everbright's topic in Application Design
Store the configuration file somewhere on your server that your admins do not have permission to. Do not store in the web document root. Change the include paths within the CMS to the new location. -
Nice layout. Looks professional. Like the image flyouts, how were they done?
-
using include() as long as allow_url_fopen is enabled in your php.ini configuration. http://uk.php.net/manual/en/function.include.php
-
PHP and XML API interface question (design)
JonnoTheDev replied to leart's topic in Application Design
Not by using sockets! As stated use CURL. // setup curl parameters curl_setopt($ch, // etc // process and store response $xmlresponse = curl_exec($ch); $obj->simplexml_load_string($xmlresponse); -
CSS doesn't work in IE8
-
debug the refresh script
-
Impossible! How can you detect what portion of the page a user is reading. Depending on your page layout the amount of scroll greatly differs with screen resolution. An alternative is not to reload but use AJAX to do whatever it is you are attempting if a condition is met.
-
Doesn't have to be a gateway. The gateway is still the router. Just need to allow traffic through the required ports for incoming requests. Just the same as say setting up a MS Exchange server.
-
You require 2 NIC anyhow as one will need a public IP address and the other your private IP address (192.168.x.x). If your public IP is e.g. 212.69.57.41 then all your website domain A records must point at it.
-
This looks incorrect: $CFG->wwwroot = "http:localhost/mymarket"; $CFG->dirroot = dirname(__FILE__); $CFG->templatedir = "$CFG->localhost/mymarket/templates"; $CFG->libdir = "$CFG->localhost/mymarket/lib"; $CFG->imagedir = "$CFG->localhost/mymarket/images"; $CFG->icondir = "$CFG->imagedir/icons"; $CFG->bannerdir = "$CFG->imagedir/banners"; $CFG->support = "support@mymarket.org"; Should be more like: $CFG->wwwroot = "http://localhost/mymarket"; $CFG->dirroot = dirname(__FILE__); $CFG->templatedir = "/localhost/mymarket/templates"; $CFG->libdir = "/localhost/mymarket/lib"; $CFG->imagedir = "/localhost/mymarket/images"; $CFG->icondir = $CFG->imagedir."/icons"; $CFG->bannerdir = $CFG->imagedir"./banners"; $CFG->support = "support@mymarket.org";
-
In your php.ini change the error reporting to: error_reporting = E_ALL & ~E_NOTICE Restart the webserver. This will get rid of the Notices. However you will have to fix: From the Notices $CFG->templatedir is not set to anything. Should be an object.
-
Then how do you know if it is not the remote end terminating the connection as opposed to the client.
-
Probably CSS issues. Doesn't always render the same in different browsers. May need to modify your CSS to work in all browsers.
-
Apostrophes, Speech Marks pulling through strangely
JonnoTheDev replied to stublackett's topic in PHP Coding Help
Oh well, never mind. What that function will do is detect the encoding of the string and convert it to ISO-8859-1. Probably would of worked. If you can add extensions to php through your webhost's control panel then I would try. Its the mbstring extension that you need: http://uk3.php.net/manual/en/book.mbstring.php