Well, yikes! Maybe too much info… Let’s see. First, okay we understand how you get the data which is part#1.
Next, you retrieve the data using this query:
BUT, why do you convert inputs to the WHERE clause. I do not understand that at all. AND, NEVER use LIKE to attempt to pull out data. LIKE will take the similar fields. It is used to acquire data that is similar. NOT EXACT! So, once you start getting a lot of data, this query could pull out the incorrect data! This will cause you a problem in the future. As the ADMIN of the site, you would have some page that would show you the list of reference_code’s that you need to deal with. A list of pending requests or whatever. In that list, you would have a button that would create the forms and PDF’s or whatever. This list would be all of the reference_code’s and inside the button, it would have the id of the record. You normally would use the id since it is a 100% accurate index for the one and only one record. Or, you can use the reference_code itself as long as it is 100% unique. Normally, if you use that as your index, you would make sure that when the new record is created that there are no other reference_code’s with the same value. Either way, id or reference_code, you must query only for that one row of data and never ever using LIKE. Something loosely like:
SELECT * FROM thetitl1_livesite754.forms WHERE reference_code = ‘QKEX49MKDE’
No converting needed and no LIKE’s. As you said, in the phpMyAdmin, it pulls out the unique “id” field, but, that is no way correct! If you have several slightly different values for the reference_code, you might get the correct one, but, might not.
Same comments for the searching for form’s. Drop the convert and do NOT use LIKE. You can NOT use phpMyAdmin for generating your search queries! You need to create them yourself and make them fit your data exactly. There is no “tool” that creates a 100% accurate query. Well, in my humble opinion anyways. Here are some comments on how a search query would be used for data like this.
First, normally, if it is a user based system, you would have all of the user’s or client’s personal data stored in
your users table. This would include personal info such as phone numbers, dob, addresses, etc. Then, in a vehicle table you would have all the data for any one of them. All the data that is ever needed on a form. The vehicle table would include a field indicating the user_id of the owner. Then, when a user/owner/client requests a form, they would have to select which vehicle they want that form for. At this point, you would have a user_id pointing to the owner, a vehicle_id pointing to the vehicle and a form_id that points to the form they requested for that vehicle. With those items, you have all you need to put the form together. You would have pointers directly to all the parts. Again, NEVER using LIKE! It will fail for sure at some point.
Now, since you gave more info, I see why the convert was inside your query. You did not create it. There are hundreds of variations of phpMyAdmin’s and other control panels. They are for important usage, but, are not a final solution. So, perhaps you need some training on queries.
Now, another issue in your design logic… If you run the entire process based on the user entering the reference code, how do you know 100% that it is their info? I mean, I could enter your reference code and get a copy of your forms not mine. The way you pull this info is questionable. Logic-wise…
You pull the data from a posted webpage using $refcode = $POST[] … You should use a filter on this to protect your code and database from hackers. At the least use the "filter_input(INPUT_POST, “field”) function. And, use “prepared statements” to protect the database from hackers.
Looking at the site, it is clean, simple and appears to have everything you need. Note that the Home page shows people in line. Legally, you need to have permission from each of them. I suggest in writing! Otherwise, you might get sued for use of their images without permission! Have to think of all these things when creating a website!
Skip the temp username and password! Just use their email address as identification. Let them enter their email address and password to log in. If they change their email address, they can still log in with the old one and change it in their user-profile page. Cuts out a lot of work that way!
Livesite is a “shared” server system. You get a share of a server. Each app such as Zend Guard is installed on your server. Depending on how it is set up, you should be able to include your own codes. There should not be a need to have a second server set up just for called PHP scripts!
Livesite is really Bluehost. I went to Livesite’s help page and that sent me to Blue host’s site and their chat page to ask about this was here: Livesite-Bluehost chat I was talking to them. You give them a name and the site name and they will help you. But, they asked if it was a WP site. I was not sure. Did you build the site using Livesite’s WP creation tool? That would be a “Word Press” site creator tool. If it is, you can add pages, but, you need to get into the WP’s ADMIN’s pages and add them in there. Also, if it is a WP site, you need to learn how to use WP. Not sure about that. But…
Cross posting from domain to domain can be tricky. Both have security on them, both would need to allow accesses from the other to pass things back and forth. Quite often, if you own both sites, you could leave a PHP script open on one to allow it to pull data from it’s database, but, not from the main live one. Doesn’t work that way. You can use your phpMyAdim on the main site to make the database into a remote database allowing external users to access it. Then on the second site, you can access that database with the correct login and password, but, that can open it up for possible hackers to attempt to get into it.
The error:
Parse error: syntax error, unexpected end of file in /home1/thetitl1/public_html/pdforms/TX Title App.php on line 39
Means that you most likely did not close a brace/bracket. { } In the code you posted above, you show a WHILE clause at the bottom, but, you never close it. Guessing that is the problem.
So, questions… Is it a WP site? Do you have 100% full access to the files on the site? Can you FTP to it and review all of the files? If you can FTP to it, you must have made several backups of the site on your system at various times. And, if so, you should be able to edit the files and add in your code. If you are using a front-end site creation tool, you might have to use that to edit the site. You shouldn’t need to use a secondary domain. In your control panel, you can get to phpMyAdim pages as you mentioned them above. Can you also get to a file manager where you upload and download files? If so, you should be able to move around Zend Gaurd using that. Am a little confused on why you can’t get full control of the site.
Well, that’s a lot more for you to review. Hope you get something out of it all…