sebastiaandraaisma Posted February 9, 2007 Share Posted February 9, 2007 Hi I have 2 php files and try to merge them into 1, the problem is that chunks of information are beeing posted to the second one. They all end up in a hidden form. Im wondering if there is an easy way to get all of this into one script. For example: Page 1: <input type="hidden" name="pname" value="<?=$_POST["name"];?>"> and on page 2 I find: <input type="hidden" name="pname" value="<?=$_POST["pname"];?>"> There are a lot of these post fields so I won't list them all. I just try to understand the website I bought. I would like to merge these two files into one and think I have to start with desolving these post variables. Unfortunatley the programmers who made this did not use any comments, I did some changes that improved the system a bit but I'm still a beginner. Any advise? All advise is welcome! Kind regards, Sebas. [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
only one Posted February 9, 2007 Share Posted February 9, 2007 um thats it? doesnt make a lot of sense to me :-\ wers the rest of the code* Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 9, 2007 Share Posted February 9, 2007 I assume it's in the attached file. You should ask the programmers who wrote it for some support. Quote Link to comment Share on other sites More sharing options...
sebastiaandraaisma Posted February 9, 2007 Author Share Posted February 9, 2007 Oh, yes I'm sorry for mentioning that. I think its to much to read and to ask for. I did contact the programmers for support but they did not want to give it for free and sinds they are not realy competent I did not feel like it was a value for my money. Its interesting that you always seem to reply so quick. I was just on your website filling in your form to ask you for a price quote in case I can't figure it out myselve. I rather pay an expert than the company that has build our website Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 9, 2007 Share Posted February 9, 2007 Basically what you're saying is there are two forms, and you want to consolidate them into one? Let me take a look at the files and see what the deal is. Edit: both of the forms go back to index.php - We'd need to see that, and I have a feeling it's a whomper of a file. This code doesn't sanitize any user data, it suppresses errors and doesn't check for them... What is it? Like, what did you buy the site for, what does it do? Quote Link to comment Share on other sites More sharing options...
sebastiaandraaisma Posted February 9, 2007 Author Share Posted February 9, 2007 The website is a real estate listing site www.globalhome[dot]eu, these particular files are the pages that allowes someone to list theire property. At the moment it is devided into to pages, I'm trying to get it all on one page so that I can try to implement my new layout (by myself ) I will attach the index, its not that big, but I think it won't contain the data you need [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 9, 2007 Share Posted February 9, 2007 See how the form action points to index? On index there is this code: // querystring args $page = intval(querystring("page")); $id = intval(querystring("id")); $num = intval(querystring("num")); $search = querystring("search"); $action = querystring("action"); $language = querystring("language"); $self="index.php?"; foreach (array_keys($_GET) as $key) { if ($key != "language") { $self.=$key."=".$_GET[$key]."&"; } } if (preg_match("/\&$/",$self)) { $self=substr($self,0,strlen($self)-1); } if ($language!="") { $_SESSION["LANGUAGE"] = $language; setcookie("Language", $language, time()+(60 * 60 * 24 * 365)); $query = @mysql_query("SELECT * FROM lang WHERE id='".$language."'"); $row = @mysql_fetch_array($query); $_SESSION["LANGNAME"] = strtolower($row["name"]); redirect($self); } What this does (I think) is creates the page it should go to based on the URL. IMO this seems pretty insecure, and it's a weird way of doing it. Anyway, there should be yet another file which does processing, because you have two forms which only have code to select data, I see no inserts, so there should be more. Honestly, this is too complicated for me to just pick up and help with, because of the structure I am unfamiliar with. If I were you, I would tell the original programmers to help support you somewhat, or try to get some money back, if they misled you about the ease of use for this code. Best of luck. Quote Link to comment Share on other sites More sharing options...
sebastiaandraaisma Posted February 9, 2007 Author Share Posted February 9, 2007 No problem, Thank you for taking the time looking into it and your honest advise. I have no Idea why they did things the way they did. I mean I'm a beginner, but I could allread after reading one chapter of Sams php course see the mistakes they made. (at that point the website had allready been paid for) No, they will not give me money back, I can ensure that! They feel like they did enhaugh. But that's ok, I will do my best, try to learn a little and if it realy doesn't work I will pay them one more time and that's it! Thank you for your time (interesting Blog you have) Kind regards, Sebas. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.