PHP - Help To Rewrite The Function
Hi,
I've a problem modifying the code which send parallel requests to get the status from getstatuses().I've two functions say public function getStatuses($idList) { } public function getid($id) { $status = array(); foreach ($id as $idList) { $status[] = $this->getStatuses($idList); } return $status; } the above getid() function sends the synchronous requests to the getstatuses() function and get the status back one after another.If you need to make 5 HTTP requests and each call takes a second, your app is delayed at least 5 seconds.Now,i want to rewrite the code(if possible two functions)that speeds up the results by sending all the requests and getting back the statuses at once.Something,other friends have developed is to reverse the getstatuses() and getid() functionality.Can anybody help me writing this code Thanks Similar TutorialsI am having trouble rewriting a url, I have taken on a project that to rebuild a site that is over 7 years old and the current url structure is "http://www.mysite.com/?page=home" this i find crazy who uses "?page=" anyway am now creating the site again using a better structure of http://www.mysite.com/home.htm my problem is that the owner of the site has good google results with the current urls but wants them changing, and for the old ones to work too, i am trying to do this with .htaccess but the "?" in the url is causing massive problems with internal server errors. can anyone help me please it driving me nuts. Thanks in advance I want to rewrite this url
site.come/info.php?country=america&state=colorado&city=denver hello friends, that would help me alot , if i've 2 code all are of if and else code 1 $r = $_SERVER['HTTP_REFERER']; if (stripos($r, $refere) !== false) { echo "good"; }else{ echo "bad"; } code 2 if($line[hits] >= $limited){ echo "bad"; }else{ echo "good"; } both are 2 codes where the user should pass before it show good how then it be 1 code not 2 ( if x if y else y2 else x2 ) it like double sandwich This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=333344.0 Hello everyone,How can i change the url when I am navigating from one page to another. for example if the existing url is like "www.example.com/product.php?name=xyz&q=service" ,I want to change it to "www.example.com/product/name/xyz/q/service" But I dont want to use .htacces. How can I do it using php functions only? This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=318852.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=357919.0 Hi Guys, I no its only a partial PHP question but its still related to PHP... I have a URL .com/sites/0.php?Ter=144 and it takes you to a page and loads details with the id (ter) equalling 144 and displays all of 144's information... normal PHP stuff However I want to be able to put a Rewrite rule using a .htaccess (unless there is a better method!?) to get search engine frienly results. However I dont want the user to type .com/144 to bring up the Leeds branch. I want them to type .com/leeds and it bring up 144 (Leeds Branch). BranchName is the field I use for the branch name in my MySQL table. Is this possible? Also when I enter .com/sites/0.php?BranchName=Leeds that doesnt work either... Cheers, Sam Hi all
I have the following in my .htaccess file
RewriteRule ^([^/]+)/ /$1.php?q=$1 [L,QSA]
and this is great because any PHP page I create, such as 'about.php' can be rewritten as '/about/' - so that is all good.
the problem is, I also want to let users create their own custom URL's for their profiles in the root of the site, such as '/david-jones/' but because 'david-jones' is not actually a real PHP page (but rather a database entry), I cant use a rewrite rule as far as I can see.
Would the best solution be to piggy back the error 404 rewrite rule, so that if an actual PHP page isn't found, it takes them to the 404 error page which actually contains a script to lookup the users details, if the user details are not found, i'd show a "the page cannot be found" message.
Or is there a more elegant way to do this?
Thanks
Hello friends, If i've link as following myownsite.000/index.php?r=5774 and i want to convert it to be myownsite.000/5774 i've tried .htaccess Code: [Select] RewriteRule (.*)\ index.php?r=$1 but didn't worked ! can anyone write it thanks This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=346275.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=325762.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=332483.0 mod rewrite on easy php: EasyPHP says to set the following in apache config : http://www.easyphp.org/faq.php#0 Quote Uncomment LoadModule rewrite_module modules/mod_rewrite.so In <Directory "${path}/www"> section replace AllowOverride None by AllowOverride All I have done as the guide requested on easyPHP and restarted the easyPHP. writing a modrewite into the .htaccess following this guide: http://www.debian-administration.org/articles/136 Resulted in a .htaccess like so: Code: [Select] RewriteEngine on RewriteRule ^/route/([A-Za-z0-9]+)$ /?route=$1 [PT] With this all in place and the url of the easyPHP index page is: http: //127.0.0.1:8080/testsite/ I added a link on the home page like this: http: //127.0.0.1:8080/testsite/route/hello but the link doesnt work. the .htaccess isn't kicking in it seems. Is it not meant to be seen in the php as: http: //127.0.0.1:8080/testsite/?route=hello So that i can grab the route from the $_GET? Hi,
I have upgraded my server from PHP 5.3.3 to version 5.5 and I'm now having a few problems with some code.
This line gives a fatal error of:
Call to undefined function session_is_registered()
if (session_is_registered("isAuthenticated") && ($_SESSION ['isAuthenticated'] = "loggedIn"))It appears this is depreciated? How can I solve this? Say my URL is http://www.example.com/catalog.php?category=hats&prodID=53 and I use Mod-rewrite to make it http://www.example.com/catalog/hats/53/ Can I still use $_GET['category'] to get the parameters? If so, how? This topic has been moved very early in the morning to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=359281.0 Here is what I am trying to do.
Get from this
http://mysite.com/po...&title=postname
to this
http://mysite.com/post/12/postname/
here’s the rewrite rule.
Options +FollowSymLinks RewriteEngine On RewriteRule ^post/([a-zA-Z]+)/([0-9]+)/$ post.php?id=$1&title=$2This is my html link that links to the post.php page. <a href="post.php?id=12&title=postname"> Click here to see the post! </a>It does not change the url. I have also tried it like below and it gives me an internal error. <a href="post/12/postname"> Click here to see the post! </a>Can you see what I have done wrong? Also if the above method for the linking is correct, how do I get the "id" and "title" using the $_GET? This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=349451.0 Hello I have problem on redirecting the site to https when it comes to "www.site.com".
I made this
<rules> <rule name="Redirect site.com to www" patternSyntax="Wildcard" stopProcessing="true"> <match url="*" /> <conditions> <add input="{HTTP_HOST}" pattern="site.co" /> </conditions> <action type="Redirect" url="https://www.site.co/{R:0}" /> </rule> </rules>In this sample when I try to access the site through "site.com" it redirect to " https://www.site.com " but when I access the site to www.site.com the https doesn't appear. |