Jump to content

Prodjex

Site Sponsor
  • Content Count

    88
  • Joined

  • Last visited

  • Feedback

    0%

About Prodjex

  • Rank
    Kilobyte Member

Profile Information

  • Gender
    Not Telling
  • Expertise
    Jack of All Trades
  1. I need to grab the data from the “enclosure” tag from the following feed: https://queryfeed.net/twitter?q=%40CabosNews&title-type=user-name-both&geocode= In the example, you can modify the “enclosure” field to any of the fields you need help grabbing. This is using the simplexml_load_string command. $url = 'https://queryfeed.net/twitter?q=%40CabosNews&title-type=user-name-both&geocode='; $xml = file_get_contents($url); $obj = simplexml_load_string($xml); foreach ($obj->channel->item as $item) { echo PHP_EOL . (string)$item->enclosure['url']; } This will give y
  2. I have a column within my MySQL table that holds city and states for records. The dataset looks like the following: Clay County, AL Cleburne County, AL Coffee County, AL Colbert County, AL Conecuh County, AL Coosa County, AL Covington County, AL I need to just select the state name for all of the records. Since I know this is not user input and the data is all clean/structured as above I can trim off what I don’t need with the following command: select right(trim(cityStateField), 2); This then returns the needed resu
  3. Sometimes you may have form elements that you need to changed based on other input. For example I have two selects on my page. The first one if the primary goal. The second is a multiselect box of secondary goals. Based on the users input on the first select I don’t want them to be able to select the same item in their secondary goals. This is how you can manipulate the second select by using onChange jQuery commands. The library used for the multiselect is Bootstrap Multiselect. Here is the HTML of my current form: <div class="container"> <div class="row"> <d
  4. This is a basic example of how to dynamically add new options to your select drop down without reloading the page. I’m not saving these in the database, but it’s pretty easy to add in functionality to do so. I may provide a tutorial on that in the future, but this should get you started. HTML: <div class="container"> <div class="row"> <div class="col-md-12 text-center"> <h1 id="setPageName"></h1> <div class="col-md-6 col-md-offset-3"> <div class="form-group col-md-4">
  5. With PHP 5 they introduced the DateTime class. Prior to that everyone used strtotime, date, etc…commands to achieve the same results. I was a late adopter and continued to use the old commands. Recently I decided it’s been long enough and it’s time to take a look at this new class and apply it. This example is a simple how to on showing the difference between two dates in day format. So my start date here is 2016-05-04 10:20:42 as it’s stored in the MySQL timestamp field of my database. The end date is another date in the same format of YYYY-MM-DD HH:MM:SS. My first attempt mixed some o
  6. Prodjex

    PHP strtok

    The PHP function strtok splits a string one by one. In the example below I’m trying to split off everything after the ? in the URL. https://www.facebook.com/LiquidWebInc?fref=ts https://www.facebook.com/CocaColaUnitedStates?brand_redir=1 In PHP I was able to do this with the following: $facebookURL = 'https://www.facebook.com/LiquidWebInc?fref=ts'; $cocacolaURL = 'https://www.facebook.com/CocaColaUnitedStates?brand_redir=1'; $facebookURL = strtok($facebookURL, '?'); $cocacolaURL = strtok($cocacolaURL, '?'); Check out the demo here. The post PHP strtok appeared first on Kansas City Web Con
  7. This will be a walk-through on how to create a submit form that checks the database to make sure the username is not taken. If it is taken it will not allow the submit button to be activated. HTML on index.php page: <!DOCTYPE html> <html> <head> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <
  8. Prodjex

    PHP parse_str

    Quick example of how to use PHP’s parse_str command. Here is an example of my data: $source = "access_token=CAAWhyYsjaWsBAOCwjZCs&expires=5180531"; What I’m trying to do is just grab the string of the access_token variable from the URL. So above I’ve dropped it into the $source PHP variable. Now using parse_str I can get that into an array like so: $source = "access_token=CAAWhyYsjaWsBAOCwjZCs&expires=5180531"; parse_str($source, $output); Next I just need to select the section I want, for this example I need the access_token, so my final code is: <?php $source = "
  9. These are two different commands with different outputs when added to a SQL query. MySQL “in” command for example: select * from assets a left outer join assetInterests ai on a.id = ai.assetID where orgID = 2011 and deviceID in (11) and interestID IS NULL In the table I have the following deviceID’s: 11 11 11 11,9 The result set will only return the top 3. The 11,9 result will be missing. Why is that? 11 is in that column. The issue is that “in” I could say and deviceID in (1,3,11) and any column that had just the 1 or 3 or 11 will
  10. This is the first in what will end up being a several part tutorial on creating a Twitter posting program. These tutorials will show how to create the bot using the PHP library that interacts with Twitter’s API, called TwitterOAuth. It’s by far the most used PHP based Twitter API library. You can use this example anywhere, but the queries you will see are specific to the WordPress database schema. In the examples I’m demonstrating how to auto Tweet your WordPress posts. Alright, lets get started. First login to your server using SSH and navigate to the directory you want this project
  11. Springleap says it can help marketers improve their ad campaigns by tapping into a global community of 180,000 creative professionals. To pursue that vision, the company is announcing that it has raised an additional $650,000 in seed funding, bringing its total backing to around $1.1 million. I got on the phone with founder Eran Eyal partly to discuss the funding, but more to discuss the bigger vision here. When we wrote about Springleap back in November, we focused on its tools for holding crowdsourced design contests. Eyal said Springleap will still support those contests, but they aren’t
  12. Do you run a Facebook Page? Heads up: your page’s “Like” count is probably going to drop a bit soon, and it’s totally not your fault. The short version: Facebook is changing the way it’s counting likes, subtracting any accounts that have been either manually deactivated or “memorialized” after its owner passed. It’s something that probably should have been done since the beginning — but since it wasn’t, it’d be easy to think your Likes had dropped because of something you’d done. One thing that’s important to note: it seems that this only accounts for profiles that have been manually deactiv
  13. Here’s a partnership that may come as a surprise to many: Microsoft and Google are working together to help make Angular 2 — the next (and somewhat controversial) version of Google’s JavaScript web app framework — better. Angular has been using its own AtScript superset of Microsoft’s TypeScript for a while now. TypeScript is Microsoft’s attempt at extending JavaScript with features like type annotations, generics and modules. Going forward, the two languages will converge. Angular 2 will be written in TypeScript and developers will be able to write their Angular 2 applications in this languag
  14. If you’ve ever searched for the name a capital city or a celebrity’s place of birth, then you’ll probably be familiar Google’s Knowledge Graph. It’s a cool little feature that picks out and displays the answers to questions, saving you from clicking through all of the links in your search results. After recently equipping it with the ability to dispense health advice, Google now reckons you might need a little help refining your bartending skills. Yep, you’re going to cocktail-making school. A simple “How do I make a …” search now will list the main ingredients and recommended garnishes for yo
  15. Bulging fenders? Check. Nubuck leather-wrapped everything? Check. V12 rumble? Ch– oh snap. For the first time an Aston Martin, car, albeit a concept, has an all-electric powertrain instead of pistons. The Brit carmaker says the all-wheel-drive DBX Concept is “a thought starter… that envisages a world where luxury GT travel is not only stylish and luxurious, but also more environmentally responsible.” Marketing buzz aside, the DBX is definitely packed with interesting tech. It has drive-by-wire electric steering, toughened, “auto-dimming” windows, heads-up displays, Tesla-like in-wheel motors a
×
×
  • Create New...