Jump to content

monkeytooth

Members
  • Posts

    1,129
  • Joined

  • Last visited

    Never

Everything posted by monkeytooth

  1. also wasn't fully sure how those solutions may have tried o approach it so i was tryin to figure it out here..
  2. I did, I just wanted to see if it was something I could build on my own...
  3. Yea, I figured there would be something a bit easier about it lol. I'll stick with my regular means of screen capping for now I think, as Im not about to build a browser within a browser based on PHP to just take a snap of a couple sites now and again. I figured if it was a task I could do in a day or 2 maybe I'd consider doing it. But this sounds like a much larger scale concept than what I want to sink my teeth into right now so, yea.. lol, thanks for the input though at least it gives me an idea should I change my mind about such a larger task.
  4. I'm curious. Is it possible with lets say the GD lib and cURL to come up with a concept that can grab a screenshot of a particular site? I would like to take screen shots of sites in my "network" and display them / catalog them but I am wondering if this is something thats even possible, and if its possible would it be possible on a production server thats provided by someone like lets say hostgator, or would I need a dedicated box to pull something off like this? I guess what I am looking to figure out ultimately which technologies revolving around PHP would I need to use in order to get a screenshot of a page like I would like to get.
  5. $myNewVariable = $_GET['id']; echo $myNewVariable;
  6. not a problem, your welcome that's what I hang around here for :-)
  7. Well that's dependent upon how you choose to UPDATE your table.. You can choose to update where one column goes to the other and the new value gets inserted so to speak. Or you can leave the original the same til the day you take down the site. That part of it is not automated in any sense, without coding to make it as such.
  8. monkeytooth

    SUM

    this might be off a little, but... SELECT credits SUM(credits) FROM mytable GROUP BY credits
  9. There is no true difference in what the do, with exception of if you happen to include the same file within a set of files more than once it will ignore it the second, thrid, forth, time it is attempted to be loaded. Most people put there sites together in a template format similar in nature to that of which you imply your attempting to do. they will call several files into an index.php to do various things but want to keep them all separate for easier editing down the road. However sometimes people will make an index2.php that loads various other files up to and including one or more of which index.php may have loaded into it, then include within index.php index2.php
  10. monkeytooth

    SUM

    Sure, but first can you tell us what the "column "credits"" is? Its your code, your database, we have no idea what it is as we have never seen it.. If your talking about a database.. and adding values to it, then you would need to INSERT to add new data UPDATE to change existing SELECT to poll results from existing data. and use mySQL queries to do it, assuming your DB is mySQL
  11. With sessions.. no.. sessions only last a temporary amount of time on the server, and cookies would be just as bad cause they only store on your local machine and if you wipe your history or anything else the data is lost. and in both cases the cookies would have to be some what elaborate in storing so you can store them all. this is why I say add an extra column to the table your querying where you can leave your quote unquote original price alone, and then have the other row update regularly with the new updates. If you change your prices often and want to keep a history of that then make an all new table in your database where you keep your product id the same as on the other table and then add a datetime column, and pricechange column to it so you can poll results from that table and the first table to your desire..
  12. I'm not sure exactly myself with this as I never finished one of my projects doing the same yet. So with that I can tell you this much $_FILES is an array.. try submitting your form with multiple files to a php file that just has the following echo "<pre>"; print_r($_FILES); echo "</pre>"; The above will show you the construct of the array, and what data there is in it to work with. From that you should be able to construct a foreach loop that will in return upload the files one by one. Bare in mind also most providers of the hosting have some limit or another on there servers. Ususally 64mb as that I believe is the default in the php.ini of what makes php run so to speak, so try not to upload to much or you'll get time out errors.
  13. I think your going to have to elaborate a wee bit more to me and the rest of the users here on the site. As we don't know exactly what your really attempting to ask us. You created a service? ok what does that service do exactly. What do you mean by connect with the php? Call xml rpc? please provide a little more detail in depth so we can better attempt to assist you. More details the merrier.
  14. I'm not 100% sure I understand exactly what your tryin to do here. Well I do, but the approach your code seems to imply is confusing me. What results from where when how do you want them?
  15. I know this may be a silly question but is "index.php" really above session_start in the file or are you signifying it here as index.php and you forgot to wrap your code in the code block? That error you are receiving is only due to something somewhere some how outputting to your browser prior to that function even so much as hitting enter on the file so there's a bit of white space at the top.. or a space or literally anything output prior to that session start will kill it.. Or, maybe your hosting co has sessions off for some odd reason?
  16. well, you could add a new column to your DB table so this way the original always stays the same in then with the new column keep the updated new value there. So now when you query the DB you can query for both with ease. Unless you have some other concept at hand here that's not explained this option sounds the easiest all around.
  17. PHP and JavaScript don't mix like that. In terms of page loading rendering etc.. PHP does its thing server side and renders everything before any initial output to the browsers. Where JavaScript loads there after when the page is done loading. So in order for you to pull off what you want to do is go the AJAX route, make a small javascript that detects the cookies like you already have define it as a var instead of writing it to the body of the document. then post it to a php file thats going to do whatever it is you wanna do based on if the result is true or false.
  18. function toAddorNottoAdd($name) { $name = mysql_real_escape_string($name); $query = mysql_query("SELECT COUNT(1) FROM categories WHERE name = '{$name}'") or die(mysql_error()); $wasItFound = (mysql_result($query,0)=='0')? false: true; if($wasItFound === false) { $name = mysql_real_escape_string($name); mysql_query("INSERT INTO categories SET name='{$name}'")or die(mysql_error()); echo $name . " inserted into DB"; } else { echo $name . " found in DB"; } } quick correction #1 :-\
  19. Your going to have to query your DB first to see if there is a match, if there is a match then no insert should be made. Which your on the right track kinda between the 2 functions you show as example. You should combine them in a manner of speaking. Kinda like not guaranteeing this will work as i am just using your code to re-sample the idea with function toAddorNottoAdd($name) { function category_exist($name) $name = mysql_real_escape_string($name); $query = mysql_query("SELECT COUNT(1) FROM categories WHERE name = '{$name}'") or die(mysql_error()); $wasItFound = (mysql_result($query,0)=='0')? false: true; if($wasItFound === false) { $name = mysql_real_escape_string($name); mysql_query("INSERT INTO categories SET name='{$name}'")or die(mysql_error()); echo $name . " inserted into DB"; } else { echo $name . " found in DB"; } }
  20. I figured it out, I was approaching what I was doing all wrong and being a novice with cURL in specific that didn't help much either. I appreciate the efforts set for as they did send me in the right direction.
  21. Whats going to be helpful here is a sample of your actual database layout. And the PHP/MySQL code you are quering for updates/inserts/selects. This way we can see what your doing currently then attempt to assess it easier. Also if your page is currently displaying any specific errors from the code, give us that too
  22. http://mobilewebsites.com/mobile-preview/ is primarily an spot on example of what I want to recreate, but I don't want to have to go to there site every time to do what I want to do, and I want to elaborate on it some as well. My current example is http://chrishacia.com/demo/try/browseragent.php?v=example.com but its running it to issues it only half works, example if I go to mp3.com or tacobell.com with mine I get issues about object moved. or if I go to facebook.com I get issues where nothing is displayed at all. However if I use the link that shows what I am trying to do and go to the same urls they actually work. So this is turning into more of a question of how should I handle this better? I am fairly new to curl, I can't seem to make the alternative $_SERVER['HTTP_USER_AGENT'] = 'some_mobile_device_value'; concept work. So any idea's?
  23. no problem, and yea, squash the little things when you can as soon as you can, you never know when it may become a much larger issue in the future.
  24. Yea my fault i didnt pay to well attention. If its a hassle like you say you could dump the output in xml format, json format and iterate through that if its easier for you. Maybe a concat in the query but thats a tough one to call on my part.
  25. $_GET is retrieving the value of the id= from the URL view.php?id=xxx xxx being the value of id. You get the data from the database by comparing that $_GET value (or $_POST, or $_COOKIE, or $_SESSION, or even $_REQUEST.. all depending on what your doing and how.) to that of whats stored in your DB like QuickOldCar's example shows. Now on to QuickOldCar's example might I suggest doing a little light reading on mysql_real_escape_string() as well so you can attempt to prevent SQL injection attacks. As for the question of the users last post, well thats all in the query.. you query for the user, then you query I believe in Asending order to get that users last post first, then you display that post..
×
×
  • 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.