| | |||||
| ||||||||
| Website Development Development concepts, scripts, sponsors and affiliate programs. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| New Member Join Date: Apr 2011
Posts: 5
![]() | PHP: URL data problem. Little help if possible. Hi guys. ????: NamePros.com http://www.namepros.com/website-development/720602-php-url-data-problem-little-help.html I thought I would turn to here so that I could get some advice off you lot as you can be very experienced in this subject. Ok so I have a big problem. I have created a link which looks like: <a href="productPage.php?NAME=<?php echo $name; ?>&IMAGEURL=<?php echo $imageurl; ?>"> <?php echo $name; ?> </a> Now this works fine and it pulls the information from my database. But when I have all the information being passed over to the 'productPage' the URL becomes to big and won't view properly in any of the browsers. This is because most URL have a large cap of around 3k words or even below that. I need a way of which when I click on the link, it passed data to the 'productPage' but does not use tons of code in the URL. I'm not sure if this can be done with cookies or sessions but it seems likely. Any help would be amazing, thank you. |
| | |
| | #2 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,963
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | There is a limit of 2048 characters for GET requests as per HTTP standard. Normally it's enough the pass the product ID in the URL, then the target page should fetch the product info from the DB. You can also create SEO-friendly URLs like this.
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| | |
| | #3 (permalink) |
| NamePros Member Join Date: Apr 2009
Posts: 189
![]() ![]() | as already suggested, easiest and best thing to do is only pass a key that can be used to query the database and get the rest of the info. if however you absolutely must still pass all the data, switch to using post and use javascript to submit the form when the link is clicked.
__________________ Great Britain | San Francisco | Trinidad | New Delhi | Rhode Island | San Diego | Beverly Hills |Ascot | North Korea Ads Once | Ads Package | iBranded | Buy a tel | Dottel |
| | |
| | #5 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,963
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | You're bound to have problems with URLs that long. Honestly I can't see the justification for it.
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| | |
| | #6 (permalink) | ||||
| Senior Member Join Date: May 2009 Location: internet@ctivist.com
Posts: 4,799
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
????: NamePros.com http://www.namepros.com/showthread.php?t=720602 ------ As far as the solution goes - you store the name/url pair in a table - there's no reason you couldn't create and autogenerated key (ID ) anyway. That said - if your query access is via a long string like that it won't be long before your indexes get huge and useless. You could also do url rewrites, shortening services, meta refreshes etc to try and mask the affiliate url. Here's a TIP if you implement your own url-shortener/expander on your site then no one can remove your affiliate link. J.
__________________ A Member of: IdeationTeam.com HowToBeADomainer.com - a Domaining How To AuthorEditor.com
Last edited by defaultuser; 06-27-2011 at 06:08 PM.
| ||||
| | |
| | #7 (permalink) |
| NamePros Regular Join Date: Oct 2008 Location: Florida
Posts: 450
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | The site is already in php. It wouldn't be too much work to pass the id only and then pull the data from the database via the id.
__________________ ██ 6 Website HotSpots You May Have Missed | Custom Web Development & Graphic Deals ██ |
| | |
| | THREAD STARTER #8 (permalink) |
| New Member Join Date: Apr 2011
Posts: 5
![]() | Thanks for the responses guys, gives me some stuff to think about. As I said above, the URLs can be massive due to the long links provided by the affiliate supplier. Alls I want is all the information to pass over to another page when I click on a link, I guess I'll use another language or look into optimizing my database so that I can drag information through from an ID of some sort. |
| | |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| LiteSpeed ⇔ cPanel ⇔ PHP 5.2/5.3 ⇔ Softaculous ⇔ RVSiteBuilder ⇔ R1Soft ⇔ Get 50% OFF | CrocWeb | Web Hosting Offers | 0 | 06-13-2011 03:21 PM |
| Domainate Weekly 6/9: SeniorsGroups(.)com, MigraineRemedies(.)org + 28, < $130 each | Domainate.com | Domains For Sale - Fixed Price | 1 | 06-13-2011 11:40 AM |
| LiteSpeed ⇔ cPanel ⇔ PHP 5.2/5.3 ⇔ Softaculous ⇔ RVSiteBuilder ⇔ R1Soft ⇔ Get 50% OFF | CrocWeb | Web Hosting Offers | 0 | 05-30-2011 11:29 AM |
| LiteSpeed ⇔ cPanel ⇔ PHP 5.2/5.3 ⇔ Softaculous ⇔ RVSiteBuilder ⇔ R1Soft ⇔ Get 50% OFF | CrocWeb | Web Hosting Offers | 0 | 05-15-2011 10:53 PM |