Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by computermax2328

  1. Hey Guys, Anyone try Atom.IO yet? It is a new text editor that GitHub just put out. It is currently in beta. Although it is a lot like Sublime, I like the way it looks better as well as its command functions. It has a web based core as well, which means you can style and customize it with LESS and Node, so that is kinda cool. Just trying to see what other people thing about it. I like it better than Sublime right now, but support is limited and it is kind of buggy. Plus, it is missing basic functionality, such as when you split the panels, you can't resize the panels unless you use LESS. You can split the panels horizontal and vertically which is kind of cool. If anyone wants a beta key let me know. They gave me three I think.
  2. Thanks for responding That is definitely a method to consider. I guess the difficult part would be structuring the form data into CSS and then turning it into a string. I will look into it. Does anyone else have a suggestion?
  3. Hi All, Right now I am working a project where I want to use a PHP form to ultimately create a CSS file. The idea is that a user can fill in a a form with questions like hex color and fonts, and then that form will process those values into a CSS stylesheet. I know that SASS and LESS do this with Ruby, but I was wondering if there was a way with PHP. Maybe go from PHP to CSS or PHP to SASS to CSS. If anyone has any recourses, docs or videos, on different methods that would be much appreciated. Again, I'm not even sure if PHP can do this. It is just an idea. Thanks in advance,
  4. Hey Halben, If you are using two different scripts to process the data then yes. Could you explain your data flow a little more? Right now I am assuming that you have two different scripts, one that is a part of Wordpress' core files and another one that you created. If that is the case then yes because that would be two different data processes. If you are somehow extracting the data from the Wordpress database to the external database then I think you should be good, but I don't think that is the case here. Wordpress would be synthesizing that data for you. Let me know about your data flow,
  5. Thanks Trq, I was actually about to start a topic about web development books and web development theory. I will make sure I add this to my list.
  6. Process.php is a super secret PHP form handling script that I use on all of my super secret websites. No, I'm just kidding. I was just creating a contact form for a site I am building and I was going over all of the worst case scenarios. I wanted to get some input on this one. You know, stir up some conversation on the topic. I guess the solution is just to code better.
  7. Hey Dalecosp, So you are saying that I could use something like $_SERVER['REQUEST_URI'] to say if it is this file then redirect them somewhere else or something like that?
  8. Ok, so how about some work arounds? Any advice there?
  9. Hi All, I am looking into different methods to prevent users from directly accessing a php file. For example, if you have a form with an action="whatever.php" on it, a user can inspect the element in see in the DOM what the action is as well as the file path to that action. As shown in the form below: <form id="contact" name="contact" method="POST" action="php/process.php"> <input type="text" value="email" name="email" id="email" class="width" > <input type="submit" value="Submit" name="submit" id="submit" class="button"> </form> The action is "process.php." What are some of the different methods that prevents a user from typing that URL into the address bar and going directly to the file? Right now, if a user goes to that file they get an error that says something like "The variable $email does not exist." But someone can just type that parameter into the URL and the file would be exposed. One method that comes to mind is checking if "submit" is set. Then if it is not, redirect the user back to index.php. Does that make sense? Does anyone have any other methods in mind? Thanks in advance,
  10. Awesome! Thanks guys. I am gonna check out Apigility and 9lessons tonight. Does anyone else have some input?
  11. Hey, You never close your "in_array()" $child = (in_array ($child->name, $tt ); Should be.... $child = (in_array ($child->name, $tt )); Unless you close it somewhere else that you did not paste into the forum.
  12. I am gonna answer my own question on this, but if anyone wants to chime in with any best practices or experiences they have had building an API with PHP, please feel free. Below is a link to an O'Reilly's book on creating API's with PHP. The link lets you download the ebook for free! #winning! http://it-ebooks.info/book/2268/
  13. Hey All, Does anyone have any good articles or books on how to create a public API with PHP. I understand how API's work, although it wouldn't hurt to read up on them, but I am really just looking to understand how one can be built with PHP. Thanks in advance,
  14. So I was gonna do something like "SELECT title, content, id FROM posts," then loop it through, and assign variables to the values that come out. Then run a query through like "SELECT * FROM other_table WHERE id=$id." Does that make sense. I know that isnt right. I just don't know know to unique variable into the first query.
  15. I don't understand how to get the "specific post id" variable into the where clause. My first idea was to loop the query after another query, but I was told not to do that ever.
  16. Hi All, I have been trying to figure out this query for a couple of days now. I have been coming back to it over and over again and I still can't wrap my head around it. Care to give some help or ideas? I did not design this database so I am not stumping myself. I have a table of posts which have an ID associated with them. When I associate an image with this post the URL of that image gets put into a separate table along with the post's ID. The image URL has it's own ID as well, which is different than the post's. So it looks like this. Table 1: Post id Table 2: Post id, image URL id, image URL These images are going to be in a loop of posts so I can't pull the id as a variable into the query. It is almost like I need to say SELECT * FROM table WHERE id="This specific post's id"; Does that make sense? Thanks in advance,
  17. Hi All, It is nice to be back on the forum again! I was wondering if anyone knew about any cost effective API's for geocoding. For anyone who does not know what geocoding is, it is when a user submits an address and you then convert or geocode that address into latitude and longitude. A project that I am starting up requires an API that uses latitude and longitude and the parameters in the method. I know that Google, Map Quest and Yahoo all have API's for geocoding, but I am looking for something a little more cost effective that can take a little more traffic before hitting the limit. Thanks in advance!
  18. Hey Man, What a coincidence!? I was just chatting with these guys the other day on Twitter. I have been using Kodery for a while, even before alpha and they reached out to me to give me another key. The guys who are building it are awesome and they have some really cool ideas that they are going to be launching soon. Definitely, something to keep your eye on!
  19. Hi All, I having trouble finding a way to show all of the tables within my database. The goal is to get the current database structure. I am working on a project for a friend and they are running the site from a private server, so there is no CPanel and I don't have access to PHPMyAdmin. Also, I just downloaded MYSQL workbench, but I can't seem to connect. Working that out with my friend now. Any ideas would help. Thanks,
  20. That was a good point, but not the right answer. I am going to rehash some code and then I will update what I did. Any other ideas, let me know.
  21. Hey All, I am relatively new to jQuery and AJAX. Doing pretty fine with basic jQuery functions, but I am having a hard time understanding AJAX. Here is what I am trying to do: I have a PHP generated nav-bar, which works and generates fine, and each link in this nav-bar gets an id number that is provided to them from a database of photo galleries. I store this id number in each link using HTML data-type. When one of these links is clicked, it passes its id number to a jQuery on click function using .data("id"). This number is stored in a variable x. Here is where I am getting messed up. I have an AJAX request that on click asks for a PHP file, get-gallery.php, and this PHP file queries the database to get all of the photos in the photo gallery. Get-gallery.php works fine. I tested it and it echos each photo perfectly. The file paths are wrong right now, but I am not worried about that. I was wondering, how do I get the gallery-get.php to echo where I need it to in the DOM? Take a look below and let me know what you think. Thanks in advance, PHP generated nav bar: <ul id="categories"> <?php $go = "SELECT * FROM `wp_ngg_gallery` ORDER BY `gid` DESC LIMIT 30"; $look = mysqli_query($con, $go); if(!$look) { echo "This does not work " . mysqli_errno(); } while ($find = mysqli_fetch_array($look)) { $name = $find['name']; $gid = $find['gid']; echo "<li><a href='#' data-id='" . $gid . "'>" . $name . "</a></li>"; } ?> </ul> jQuery AJAX request: <script type="text/javascript"> $(document).ready(function() { $("#categories li").on("click", "a", function(){ var x = $(this).data("id"); $.ajax({ url: "php/gallery-get.php", data: {"p": x}, success: function(response){ $(this).html(response).insertAfter("#content"); }; }); }); }); </script> gallery-get.php <?php $id = $_GET['p']; $select = "SELECT * FROM wp_ngg_pictures WHERE `galleryid`=$id"; $query = mysqli_query($con, $select); echo "<ul id='gallery' class='width'>"; while ($row = mysqli_fetch_array($query)) { $file = $row['filename']; $pid = $row['post_id']; $alt = $row['alttext']; echo "<li><img alt='" . $alt . "' src='images/" . $file . "'></li>"; } echo "</ul>"; ?> EDIT: If you can see a database connection in gallery-get.php, refresh the page. That was in there for testing pages on my local machine.
  22. I mean the Wordpress photo uploader isn't bad, I was really just looking for alternate methods. You know, just picking brains for best practices. It doesn't have to be based around Wordpress. I am thinking about getting rid of Wordpress anyway if I can find an alternate. Either host or script.
  23. Hi All, Long time no speak. I haven't been on here in a while because I landed a real job in NYC doing custom Facebook campaign work. Not much PHP there, but I do still get to code. Lots of jQuery. Anyway, the real reason I am here is because I am working on website for a friend. She is a photographer and I was just wondering how other people go about handling photo uploads. I have been building her site on Wordpress with a custom theme, but I am open to other options. My plan, using Wordpress, is to have her upload the photos, not exactly sure how yet, and then query the database for the links. I really don't have much time to build her a custom uploader using PHP, nor do I want to have to keep updating and fixing bugs once I launch it. Let me know what you think,
  • 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.