Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. Thanks, that is a much better solution!
  2. Hello, I have a directory on my site named "spanish", and I would like any webpage in that directory to be translated to spanish automatically. So is there a way to tell mod_rewrite to add the following string (below) to the beginning of the URL ONLY IF the webpage is in the directory "spanish"? String I'm trying to add to beginning of URL http://translate.google.com/translate?hl=en&sl=en&tl=es&u= So say the url was: www.optimumhealthcare.org/spanish/page.html I would want it to change that URL to: http://translate.google.com/translate?hl=en&sl=en&tl=es&u=www.optimumhealthcare.org/spanish/page.html Any help would be greatly appreciated! Thanks
  3. I have a few questions that deals with cURL. Question #1 Lets say I'm using cURL to fill out a form with multiple pages. Is cURL able to navigate through each page of the form retaining all the previous pages information until I reach the last page, then submit it all without losing any data? I'm pretty sure this is possible, I just can't seem to find any tutorials or help with it. Question #2 Lets just say I was trying to fill out a form with a CAPTCHA (which obviously I can't get past). Is there a way to display the web page with all the other information filled out, and just leave the CAPTCHA blank to be manually inputted? It would be greatly appreciated if you are able to point me in the right direction! Thanks in advance!
  4. Still looking for some help with this! Thanks
  5. I have a few questions that deal with cURL. Question #1 Lets say I'm using cURL to fill out a form with multiple pages. Is cURL able to navigate through each page of the form retaining all the previous pages information until I reach the last page, then submit it all without losing any data? Question #2 Lets just say theoretically I was trying to fill out a form with a CAPTCHA (which obviously I can't get past). Is there a way to display the web page with all the other information filled out, and just leave the CAPTCHA blank to be manually inputted? I'm really just looking for yes/no answers, but it would be much appreciated if you are able to point me in the right direction as well! Thanks in advance!
  6. Thanks Ken, I wasn't even aware there was a discussion group.
  7. I am trying to use Google's map API to dynamically create new maps. For example, I would like to be able to make a replica of this page using PHP. I just don't see where in the API it allows you to add all this information, such as adding categories, details, pictures, videos, etc. I've been researching for quite a while, and can't seem to come up with something that is similar to what I'm trying to do. Here is a link I found that shows you how to create maps, but I still don't see how to add all the information that you could if you did it manually! http://code.google.com/apis/maps/documentation/mapsdata/developers_guide_protocol.html#CreatingMaps It would be great if someone can point me in the right direction. Thanks!
  8. If GoDaddy does not allow outside connections, then how would you explain me doing it exactly the same way with two other sites I'm hosting on the same account with GoDaddy?? I can't even create a user in this database because it says I don't have the privilege, which doesn't make sense since I am the default user. I think I'm going to backup the database, delete it, and re-create it. Maybe that will solve the problem.
  9. I definitely think it has something to do with needing to add a user with permissions. The only thing is I am logging into the database as the ONLY user created...and for some reason I don't have permission to add a new user...something is not right.
  10. Both of the sites are hosted with GoDaddy on the same account. As I said, I've already been doing this same thing with other sites on my GoDaddy account connecting to this same database. When I put the connection code in, the page takes forever to load and says: And if I delete the connection code, it's fine.
  11. I know this sounds like an issue I should take up with GoDaddy, but I've tried calling them and they can't help me. I have two websites that each have there own database. I'm basically just trying to take information from one database, and insert it into the other. From website #1 I am trying to connect to the database on website #2. This has worked flawlessly for me on two other sites already doing the same exact thing with the same database. But for some reason on this particular website it won't let me connect to the other database, although it let me with the others. To me it sounds like some sort of security setting on this website that won't let me have outside connections, I wouldn't know where to find this or fix it though. Like I said, I know the connection code is fine as it's worked perfect on other sites and it's just copied and pasted. So does anyone know what this could be? Any help would be greatly appreciated!
  12. Okay, the zip file solved my problem. Thanks for the advice!
  13. I have a program where the user can select multiple categories, then multiple cities. It should loop through each category, then download a file for each chosen city for that category. <?php if ($_POST['export']){ $categories = $_POST['categories']; $cities = $_POST['cities']; foreach ($categories AS $category){ foreach ($cities AS $city){ $keyword = new keyword(FALSE, $category, $city); $keyword->export(); $file = ("keywords.csv"); header ("Content-Type: application/octet-stream"); header ("Accept-Ranges: bytes"); header ("Content-Length: ".filesize($file)); header ("Content-Disposition: attachment; filename=$category - $city"); readfile($file); } } } ?> I'm pretty sure the loop isn't the problem. I think it's all the headers that are for someone reason stopping the execution. It will download the FIRST file, but then completely stops. It should automatically start multiple downloads. I'm thinking it's something to do with one of the headers...like only one download can happen at once. Any help would be greatly appreciated, Thanks!
  14. Thanks, I'll test that and see if it works.
  15. I am able to successfully submit forms with cURL when there is a submit button, but recently I have ran into a problem. I am trying to write code that will submit the form from this webpage: http://www.attorneyssearchusa.com/submit.html The problem is, the "submit listing" is not a submit button, it's just a button with no name. <INPUT TYPE="button" VALUE="Submit Listing" ONCLICK="check(form,form.elements.length)" TITLE="Submit Listing"> So the question is, how do I tell cURL to hit the "submit listing" button? Here is the code I have: <?php include '../config.php'; $query = mysql_query("SELECT * FROM locations"); while ($row = mysql_fetch_assoc($query)){ $curl_connection = curl_init('http://www.appealsattorneysusa.info/submit.html'); curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"); curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1); $post_data['name'] = 'Optimum HealthCare'; $post_data['addr'] = $row['street_addr']; //street address $post_data['city'] = $row['city']; $post_data['state'] = $row['state']; $post_data['zip'] = $row['zip']; $post_data['phone'] = $row['phone']; $post_data['email'] = 'info@optimumhealthcare.org'; $post_data['web'] = 'http://www.optimumhealthcare.org'; //website $post_data['comments'] = ''; foreach ( $post_data as $key => $value) { $post_items[] = $key . '=' . $value; } $post_string = implode ('&', $post_items); curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string); $result = curl_exec($curl_connection); curl_close($curl_connection); //print_r(curl_getinfo($curl_connection)); echo 'Success!<br>'; } ?> Any Ideas? Thanks!
  16. For some reason I'm having a hard time finding regex to check for a street address and phone number. What I'm doing is crawing websites and trying to extract all this information. <?php preg_match_all('REGEX', $this->markup, $phone); I'm using file_get_contents, then searching through that to extract the information. For the phone number I want to extract as many US formats as I can. (xxx) xxx-xxxx xxx xxx xxxx xxxxxxxxxx And for the address, I just want to extract everything from the street address to the zip code. EX. 7492 Street Name, city, state zip I would greatly appreciate any help with this!
  17. I am having issues sorting an array that come from a SimpleXMLElement Object. The array looks like this: SimpleXMLElement Object ( [www] => SimpleXMLElement Object ( [allen] => SimpleXMLElement Object ( [city] => Allen [area] => Allen [county] => Collin [state] => Texas ( ) [newcontent] => text content ) [addison] => SimpleXMLElement Object ( [city] => Addison [area] => Addison [county] => Dallas [state] => Texas ( ) [newcontent] => text content ) [amarillo] => SimpleXMLElement Object ( [city] => Amarillo [area] => Amarillo [county] => Potter [state] => Texas ( ) ) ) I want to sort it by city in alphabetical order. This array is being populated from an XML file. I know you can make a XSLT template to sort an XML file, but I can't figure out how to do that. If anyone could help, it would be greatly appreciated. Thanks!
  18. Thanks thorpe, it was because the methods were static.
  19. I am trying to figure out how to use an error class I created within all of the classes I create for my site. Right now I am trying to implement it into a user registration class and am getting an error and can't figure out why. Here is the relevant code from my registration class <?php class authorize { . . . public $error; function __construct($username, $password, $vpassword, $email){ . . . $this->error = new error; //Here I try to embed my error object into the class } function register(){ //This is how I'm trying to use my error object if (strlen($this->username) < 1) $this->error->addError("You must enter a username"); . . . } The error I'm getting is Fatal error: Using $this when not in object context in C:\wamp\www\horse\classes\error.class.php on line 9 Here is the error classes code <?php class error { public $errors = array(); static function addError($error){ $this->errors[] = $error; //This is line 9 } static function displayErrors(){ $output = "<b>The following errors occured:</b><br><ul>"; foreach ($this->errors AS $error){ $output .= "<li>$error</li>"; } $output .= "</ul>"; return $output; } static function numErrors(){ if (count($this->errors > 0)) return TRUE; else return FALSE; } } ?> I understand that I could just assign the error object to it's own variable inside the class (not as part of the class), but I'm trying to avoid having to make a method to return the errors in every single class. If you have a better approach to this, please share! Thanks
  20. Because you are closing your select inside the loop. Change your while loop to this: while($rowid = mysql_fetch_array($resulti)) { $iduu= "{$rowid['album']}"; echo"<option value='$iduu'>$iduu</option>"; } echo"</select>";
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.