Jump to content

taquitosensei

Members
  • Content Count

    657
  • Joined

  • Last visited

Community Reputation

2 Neutral

About taquitosensei

  • Rank
    Prolific Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. taquitosensei

    Live location tracking using php and javascript

    So you want tracking information but want it refreshed on a regular basis? Is it always shipped through the same shipping company? ie FedEx, UPS, etc? If not you'll have to come up with a solution for each tracking company. Just deal with pulling tracking information first, then worry about refreshing it. So you have to pull the shipping provider and tracking # out of your database, then based on the shipping provider use an api to get the tracking info, then parse that info and display it.
  2. taquitosensei

    Site Won't Submit Multiple Variables

    Try this. <form id="main-search-form" method="POST" action="<?= $baseurl; ?>/_searchresults.php" role="search"> <select id="query-input" name="city_id" style="width:28.8%" style="height:69px" required> <option value="">Select Area</option> <option value="3,1">Ches & VB</option> <option value="3">Chesapeake , VA</option> <option value="9">Hampton , VA</option> <option value="10">Newport News , VA</option> <option value="2">Norfolk , VA</option> <option value="12">Poquoson , VA</option> <option value="4">Portsmouth , VA</option> <option value="5">Suffolk , VA</option> <option value="1">Virginia Beach , VA</option> <option value="11">Williamsburg , VA</option> <option value="0">All Active US Cities</option> </select> then if($_SERVER['REQUEST_METHOD'] == 'POST'){ if(isset($_POST['city_id']) && $_POST['city_id']!="") { $city_ids=explode(",", $_POST['city_id']); $query = "SELECT city_name, state FROM cities"; switch($_POST['city_id']) { case 0: Default: $query.=" WHERE city_id IN (:" . implode(',:',$city_ids) . ")"; } $stmt = $conn->prepare($query); foreach($city_ids as $city_id) { $stmt->bindValue(":query_city_id",$city_id); } $stmt->execute(); $cities = $stmt->fetchAll(PDO::FETCH_ASSOC); foreach($cities as $city) { } } } Haven't tested it. But something like this.
  3. If your domain's reverse lookup isn't setup correctly that could cause this. If the spf records aren't configured correctly. If the return address isn't a valid e-mail, ie you haven't created it yet on your mail server. It could be any of those and more. E-Mail is very finicky.
  4. taquitosensei

    Sessions Without Cookies in PHP 7

    I had a boss who had an 80/20 rule. Program for the 80%. He would have told me not to worry about people with their cookies disabled. Make sure it works for everyone else.
  5. taquitosensei

    Important "if" statement relying on mySQL

    I would personally go for #2 I don't know if it's safer. I just like the idea of setting a flag then using that flag.
  6. taquitosensei

    Is this valid syntax?

    I just tried the syntax and it works. Have you tried it? Without knowing where $ARR and $NEEDLE come from and what they look like. It's hard to know what the problem is.
  7. taquitosensei

    import csv in mysql db using ajax and php

    $counter = 0; while ($row = fgetcsv($fp)) { if ($counter > 9) { $stmt->execute(array_slice($row,3)); } $c++; }
  8. taquitosensei

    import csv in mysql db using ajax and php

    I just didn't read it close enough and copied and pasted and adjusted.
  9. taquitosensei

    import csv in mysql db using ajax and php

    You could use a counter and look for the 10th row $counter = 0; while ($row = fgetcsv($fp)) { if ($counter > 9) continue; $stmt->execute(array_slice($row,3)); $c++; }
  10. taquitosensei

    Unexpected end of JSON input

    Because it doesn't work that way. Ajax is client side javascript that runs in the browser. It is not aware of the php page at all until you say, send this data to jobsDatabase.php on the server and get me the results.
  11. taquitosensei

    Unexpected end of JSON input

    You should be able to browse to jobsDatabase.php?method=getAllRoles and see your json. If you don't then the php to echo the json isn't being called. You do need to echo the $data. Just doing die($data); will end the script without sending the json data. The ajax call is on the client side and it posts to the php page which then runs and outputs the json data which the ajax call receives in the success and processes.
  12. taquitosensei

    PHP Group Array Dealing With Duplicates

    $group_products = array(); foreach ($product_table as $element) : if(!isset($product_table[$element['SKU']])) { $group_products[$element['SKU']][] = $element; } endforeach;
  13. taquitosensei

    Unexpected end of JSON input

    Instead of echoing the json string you should return it. return $jsonstring; Then you would need something like this. $job_db = new jobsDatabase; $data = $job_db->getAllRoles(); echo $data;
  14. taquitosensei

    PHP Help

    Either that or switch hosting plans/companies. Find one that doesn't limit the number of queries per hour.
  15. taquitosensei

    PHP Help

    You could still write to your database. But at the same time to write to a json file or some other flat file format so that you know it's changed. Then instead of querying the database to find out if the database has changed look at your file.
×

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.