DukeOfMarshall Posted October 21, 2008 Share Posted October 21, 2008 My MySQL is 4.1.22. I'm trying to setup up something with PHP right now to read something from one of my MySQL databases in order to retrieve certain information. Eventually I will be doing it with a .NET application. My server informed me that I can allow access to certain IP addresses or all IP addresses, but I don't want to do ALL IP addresses because of the obvious securtiy risks and I can't set it to a certain IP address because my clients are going to be from varying IP addresses. All I need to do is have a simple script that will read a few pieces of information from the database externally. I've never done external before so that's why I'm needing some advice. Any help would be greatly appreciated. Here's what I've tried so far, but the server keeps rejecting access. **test.php <? global $t; $t = "828-555-5555"; include("http://test.dukeofmarshall.com/call.php"); echo $name."<BR>"; echo $denomination."<BR>"; echo $address."<BR>"; echo $city.", ".$state." ".$zip."<BR>"; echo $phone."<BR>"; echo $email."<BR>"; ?> **call.php <? global $name; global $denomination; global $address; global $city; global $state; global $zip; global $phone; global $email; mysql_connect("localhost", "$USERNAME", "$PASSWORD") or die(mysql_error()); mysql_select_db("$DATABASE") or die(mysql_error()); $find = mysql_query("SELECT * FROM churches WHERE phone='$t'") or die(mysql_error()); while($row = mysql_fetch_array($find)){ $name = $row['name']; $denomination = $row['denomination']; $address = $row['address']; $city = $row['city']; $state = $row['state']; $zip = $row['zip']; $phone = $row['phone']; $email = $row['email']; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/129341-external-reading-of-information-in-a-mysql/ Share on other sites More sharing options...
fenway Posted October 22, 2008 Share Posted October 22, 2008 I'm confused... mysql grant table easily handle wildcard IPs. Quote Link to comment https://forums.phpfreaks.com/topic/129341-external-reading-of-information-in-a-mysql/#findComment-672024 Share on other sites More sharing options...
DukeOfMarshall Posted October 24, 2008 Author Share Posted October 24, 2008 I may be going about this the wrong way. What I need to do is go from a random point and get a variable from a specified server. What I'm thinking about doing now is to write a script on the random point that passes a static piece of information to the specific server and then have the server query the database and return a specific piece of information to the random point. Here's the complete story if it helps to clarify. I have a client that is producing a video encoding box to sell to churches that will allow the church to stream live video, record the sermon, and then upload the recorded video to a hosting server. The box is completely automated. Very little user interaction will be needed. What I have to do is develop a database that stores all the customer information and also stores the IP address to the current hosting server to which the box needs to upload the video when it's done recording. The hosting server will more than likely change depending on how much space the customer is using and of course the bandwidth. What I'm looking for is a way for the customer's encoding box to query my database and find out the IP address for the hosting server for that day. There will be thousands of boxes sold and there's no way to determine the IP address of all the customers. So I need to have a process where the encoding box passes the customer identifier to the server and then have the server return the IP address for uploading for that day. My client will be programming the encoding box in either ASP or .NET. He hasn't decided yet. Quote Link to comment https://forums.phpfreaks.com/topic/129341-external-reading-of-information-in-a-mysql/#findComment-673877 Share on other sites More sharing options...
fenway Posted October 27, 2008 Share Posted October 27, 2008 I still don't see what that has to do with IPs... by definition, you'll need to connect to the DB with a "common" user, since you can't possibly know the IP in advance. Quote Link to comment https://forums.phpfreaks.com/topic/129341-external-reading-of-information-in-a-mysql/#findComment-675944 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.