Go Back   Cyber Tech Help Support Forums > Software > Web Development & Graphic Design

Notices

Reply
 
Topic Tools
  #1  
Old August 29th, 2006, 10:03 PM
crashnet crashnet is offline
Member
 
Join Date: May 2004
Posts: 45
Send Query Results through a link in PHP

Hello again,

I've been doing some experimenting, and I'm trying to figure out the best way to handle displaying some results from a database query. I have a file (FILE 1) that performs a query on a database. What I want to do is transfer those results to another file (FILE 2) so they can be processed and displayed.

What are my options for performing this? I was thinking the results could be transfered through the URL, but I'm not quite sure how to do that, plus, I'm not sure if its a good idea to send query results through a URL for security reasons. Would using "require()" allow me access to call that function in FILE 2? The rest of FILE 2 (it contains several functions) isn't needed. This is probably a very simple question to answer, but even as a programmer I'm just drawing a complete blank. I probably know the answer, but its escaping me.

FILE 1 = PERFORMS QUERY
FILE 2 = PROCESSES AND DISPLAYS QUERY RESULTS

Thanks for the help!
Reply With Quote
  #2  
Old August 30th, 2006, 12:46 AM
Buzz's Avatar
Buzz Buzz is offline
Cyber Tech Help Moderator
 
Join Date: Sep 2000
O/S: MacOS
Location: Oregon, USA
Posts: 3,326
Actually, only way to do it is to add conditionals all in one page to show information after the query is run. You can have one page with two completely separate displays. There is no easy way to pass query data between documents. In addition, it's an EXTREME security risk. Queries should always be in the script that displays them.

In order to help further, you need to expand on why the query is run. If it's just a form submission or something you can use hidden form fields to change the page to the data display.
__________________
Scott
Moderator : Macintosh : Website & Graphics
Adobe Certified Expert: Illustrator
Royalty-Free Vector Stock Art
Reply With Quote
  #3  
Old August 30th, 2006, 02:25 AM
crashnet crashnet is offline
Member
 
Join Date: May 2004
Posts: 45
Quote:
Originally Posted by Buzz View Post
Actually, only way to do it is to add conditionals all in one page to show information after the query is run. You can have one page with two completely separate displays. There is no easy way to pass query data between documents. In addition, it's an EXTREME security risk. Queries should always be in the script that displays them.

In order to help further, you need to expand on why the query is run. If it's just a form submission or something you can use hidden form fields to change the page to the data display.
Thanks for your response Buzz. I am trying to add a search plugin to an existing file. The search plugin takes in a search query, runs the query, and then displays the results. Essentially, I want to keep it a plugin, and stand on its own from the actual file. The code to display the results is EXACTLY the same as the display function used by the existing file. It may be superficial to try and use its code rather than just copying it, but as I said previously, I was experimenting.

And I figured it would be a very large security issue with query data. I've never done it before and it felt like common sense.

Thanks again for the help!
Reply With Quote
  #4  
Old August 30th, 2006, 02:32 AM
Buzz's Avatar
Buzz Buzz is offline
Cyber Tech Help Moderator
 
Join Date: Sep 2000
O/S: MacOS
Location: Oregon, USA
Posts: 3,326
It would be better to style the plug in to match the rest of the site if possible. Users would never know it's a plug in. You can easily pass the search term from any page to the search page and allow the search page to run the query and display results. And no security risks that way.
__________________
Scott
Moderator : Macintosh : Website & Graphics
Adobe Certified Expert: Illustrator
Royalty-Free Vector Stock Art
Reply With Quote
Reply

Bookmarks

Topic Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:59 AM.

[ RSS ]