This is a discussion on "CGI page loads only halfway, parameters causing problems" within the PHP Forum section. This forum, and the thread "CGI page loads only halfway, parameters causing problems are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
CGI page loads only halfway, parameters causing problems
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
CGI page loads only halfway, parameters causing problems
Hello all,
I am making a CGI script that goes to a DB a gets info and then displays the info in tables and has links for sorting, searching, changing the page and setting the page size. All the links have URL rewriting to send parameters to itself when a link is clicked. The problem is on Monday I tried to work on the porject at home and it would freeze up halfway through transfering data. I worked on it previously with no problems. At home and at work I have phptriad installed, so MySQL/PHP/Apache combo. The page loads partially and the status bar in Firefox shows the green bars up to halfway, and stays like that forever and ever, until you click Stop. No errors in Apache, other than the oh so common "Use of uninitialized value in" error, which doesn't affect the page. So back at work it worked fine, untill I added the page size setting option. The only way to get it to load was by removing the parameter for search and seachby which is needed to know what was searched if anything and by what field. So last night I tried the project again and it worked with only 8 records in the DB, rather than the usual 200+. So I put the 200+ records back in(this is all done with a perl script that parses through xml files in a folder and adds the selected XPath data to the DB). It didn't work again. The parameters in 2 links would make the page not load. So I only parsed 50 files at a time and then ran the CGI script, and the page loaded. So now today at work I tried the scripts again and the other link that did work fine is now causing the page to not load. So 2 links at home and 2 at work, when it was originally 2 at home and only 1 at work that were causing problems. At home I have to remove 2 parameters from the links, &search=$search&searchby=$searchby, while at work I only need to remove the searchby parameter in one link, but both in the other for the page to load. This of course makes absolutely no sense to me. Why would a parameter in a link be working fine and then all of a sudden cause problems? And one day its only one link, and then the next its two. Please offer any advice on why this would happen. I dont think it has anything to do with the script because it was always working at home and at work. The script is quite long so I dont want to past it. The links are simple links, ex: 'abc.cgi?param1=$param1¶m2=$param2....paramN=$ paramN'. Thanks for any help. |
|
|
|
|||
|
Ok, well this could be related to server setup, but I doubt that - it's certainly worth checking to be sure anyway.
You also need to be careful that you're pulling in the right GET variables and don't have any variables in your script using the same names without realising it! Lastly, it's really not good to be throwing that many GET variables around anyway. Most applications that require more than a few GET vars use a session table to store that information and then simply have one get var for the session table id which allows your script to access that information seperately. This is also more secure as less information is transferred and the client cannot manually change the GET vars... As for your problem spefically, it sounds like you don't really know what the problem is, at least not specifically. You need to try to narrow down the problem and perhaps let us see exactly what you're doing by providing a link or giving us a stripped down example. Your post is pretty long and complicated and no offence, but it's also not formatted so it makes for a heavy read. |
|
|||
|
Sorry, and thanks for the reply.
The server config works, I have been using CGI perfectly fine up until now. I only learnt Perl/CGI in the last month to do a web project, but I'm pretty sure the setup is fine. Using ActivePerl, newest release. I will try sessions like you say. And you are right I don't know what he problem is other than what is obvious, being the parameters in the links. That is where i have isolated the problem. And it doesn't make sense. my @sizes = ('50', '100', '200', 'All'); foreach my $size (@sizes) { print "<th><a href='getdata.cgi? order=$order&corder=$currentOrder &sortby=$current&psize=$size'> $size</a></th> <td></td>"; } That loop is what I use for putting the different numbers representing the page sizes (except not like that on multiple lines for the print statement). Once search and searchby are introduced it doesn't work. The links don't contain duplicate names. Other links have the search and searchby params and two othersin addition to the ones above, and they work. I am very lost on this issue. Thanks. Peace. |
|
|||
|
Well I don't know Perl/CGI and I don't think many other Forum members do either... It's not as popular a language as it once was! As a result the advice I can give you is more generic. I honestly don't know if your code is causing the problem or if there are good ways of doing what you're trying to do.
|
![]() |
| Tags |
| cgi, page, loads, halfway, parameters, causing, problems |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Current page problems | unitedcraig | Web Page Design | 3 | Jun 10th, 2008 20:44 |
| can u make it so that the page loads into the iFrame? (from menu) | rachy06 | JavaScript Forum | 1 | Apr 14th, 2006 16:00 |
| having problems passing parameters to xsl stylesheet from javascript | zzqproject | Other Programming Languages | 2 | Nov 22nd, 2005 10:46 |
| Photoshop 7 jpeg images causing browser problems?? | autumn_whispers2me | Graphics and 3D | 10 | Apr 22nd, 2005 14:40 |
| Page only loads correctly once in IE, incorrectly once in FF | Malkalypse | JavaScript Forum | 5 | Apr 19th, 2005 11:26 |