Jump to content

digibucc

Members
  • Posts

    142
  • Joined

  • Last visited

About digibucc

  • Birthday 08/16/1985

Profile Information

  • Gender
    Male
  • Location
    New York, USA

digibucc's Achievements

Newbie

Newbie (1/5)

1

Reputation

  1. i'm not exactly sure what this line is meant to be: $url = ($_SERVER['REMOTE_ADDR'] != "127.0.0.1") ? ; it looks like an attempted ternary operator, but it is incomplete and makes no sense in the way $url is used below. i changed it to this: $url = $_SERVER['REMOTE_ADDR']; also, did you listen to gristoi and change http_post_vars to _post? $origem = $_POST["origem"]; $nome = $_POST["nome"]; $telefone = $_POST["telefone"]; $email = $_POST["e_mail"]; $informacao = $_POST["informacao"];
  2. your order is wrong, the to email comes first. <?php mail($email, $subject, $fname);
  3. i haven't figured it out yet, but since you declared $images anyway, use it on this line instead of $_FILES: any difference? if everything else works and all you need is the uploaded filename, why not use <? $_POST['image_field_name_from_form'];
  4. how automatic? if you want it immediately after entering it into the box, it will require javascript and be much more complicated. if you want it after the submit button, then it just needs php and you can use php's curl function to accomplish what you want. the piece of code you show needs the info already, where is the address entered by a user, and where is the code that that form uses for an action?
  5. ok? do you have any code to be modified? everything you are talking about can be done, but personally i'm not going to type it out from scratch.
  6. The best way would be to use google's own api made for this: https://developers.google.com/custom-search/json-api/v1/overview the free edition will contain ads. another alternative: http://stackoverflow.com/questions/9392818/i-want-to-curl-google-search-result-in-php
  7. php curl here's a little function i wrote for simple queries, adapted for you: // Functions function docurl($data, $posturl) { $ch = curl_init($posturl); curl_setopt_array($ch, array(CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $data, CURLOPT_FOLLOWLOCATION => 1, CURLOPT_HEADER => 0, CURLOPT_RETURNTRANSFER => 1,)); $Rec_Data = curl_exec($ch); return $Rec_Data; } $result = docurl('?field1=a&field2=b', 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8'); with this, you will get the html of the resulting page into the $result variable. you can echo/print/dump that to just print the page, or you can parse the data for the specific info you want. good luck.
  8. i am not seeing a problem with your expected outcome. i'd do it a little different but that's normal, long story short i copy/pasted/uploaded and added my ip to bannedips.txt, it it prints: sooo... yeah.
  9. I don't know that table structure just looks messy to me, however my mysql skills are not top notch
  10. with the current structure and what you need to do, it's a pita, you actually have to compare 3 columns right now, name ,entry & results. I would change the db/table structure, make it: NAME | ENTRIES | RESULT | ID and have ID be an auto-incrementing primary key. then in the results field, you want to put "serialized array" with each result. then when a user enters a value it would unserialize that array, add the value to it, and then serialize and insert the whole thing. that way your data is ready to use, you just pull the row and it will have a name & entry, run an if on each entry and then unserialize it's results field and you can use count() on the resulting array. that makes the code simpler and it's more efficient, no need to check the name on every entry if they are all tied to the name specifically.
  11. Ok, I can throw actual code here but it's all rather long, so i am going to give an example: <?php $max = 10; // max runs per exec $arr = array_fill(0, 50, 0); $last = file_get_contents('last.txt'); $n = 0; echo 'left off on '. $last; while ($n < $max) { foreach ($arr as $k => $v) { if ($k > $last) { // do something with the value ($v) $n ++; } } } file_put_contents(last.txt, $k)); ?> <meta http-equiv="refresh" content="3"> this isn't anything i use, but i do something similar when i want to save where i left off in a program to come back to later. that way if the program crashes or i have to close it, i haven't lost my place. this is normally when working with database records. it makes it run incrementally and as i said save it's place to return to. it just feels wrong though, and i'm sure it is. especially the refresh. what is the best way to do this? I would use array_slice instead of if ($k > $last), but that is normally comparing row values from a db, so i can't just arbitrarily slice that.
  12. thank you neil, i did not know that.
  13. the issue i foresee is that question marks are used in code as well, namely addresses but they could appear elsewhere. you want to change the visible question marks but not any that are strictly code...
  14. google hosts libraries for common tools, here is jquery: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> it also has the old library that this calls for, but i would use the newer one if possible, don't mix versions with ui. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> and here is jquery ui: <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> but I actually don't know what jquery.easing or jquery.core are. or ui.core for that matter. I've only seen the regular and min varieties of each, no "core" in the title, and easing idk. sorry.
×
×
  • 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.