Jump to content

markvaughn2006

Members
  • Posts

    108
  • Joined

  • Last visited

Everything posted by markvaughn2006

  1. Anyway to make it find everything after the exampleleftside= up until the first double quote?? Thanks for the help!
  2. ...exampleleftside=thedataIwant">examplerightside How would one go about capturing the data I want from some html code similar to the one above? I know how and would be using file_get_contents, running a while loop, putting the captured data in a variable, and storing it to a database, I'm just not getting regex... Any help would be greatly appreciated, thanks!
  3. Do you think that google uses setTimout or setInterval to keep refreshing a file to check for new messages? I wouldn't think so.. but if not, anyone have any ideas how a new message pops up in the inbox when you get one? It must be pushed or auto-refreshing some code to check right? How are they doing this?? driving me crazy..
  4. I have a website hosted at godaddy and a website hosted at hostgator (don't flame). How would I go about sending data from one website into a database on the other website? Is that possible?? Thx!!
  5. as usual... the simple act of posting my question, leads me to the answer, solved... for anyone else that needs the answer to this question, the code I posted works, but for what I was doing, i just replaced the static number with a variable... silly
  6. I am trying to calculate a moving average. Example: Column names: id, date, price $result = mysql_query("SELECT * FROM mytable WHERE id > '10' ") or die(mysql_error()); while($row = mysql_fetch_array($result)){ $thisid = $row['id']; $sql2 = "SELECT AVG(price) FROM mytable WHERE id < '$thisid' ORDER BY id DESC LIMIT '10' "; $result2 = mysql_query($sql2); $row2 = mysql_fetch_array($result2); echo $row2['AVG(price)']."<br>"; } So, what this code is intended to do, is go through each row from mytable, and calculate an average of the 10 cells with an id less than $thisid. But.... no worky.. It is coming up with some kind of an average but it is not correct. The number it comes up with is close though, but wrong enough that it is definitely doing something wrong. Any help would be extremely appreciated!!
  7. If this is the wrong section sorry, I'm thinking this some kind of ajax call. On Facebook, if you scroll all the way down and click "Older Posts" and it looks like it is loading and then drops down with older posts. Could someone please point me in the right direction of how this might be done?? Thanks sooo much!
  8. sorry, I know this is simple, but stuck on it... how would one go about converting 1/21/11 to a UNIX timestamp, something like 1293035229? and while we are at it, how to convert 1293035229 to 1/21/11 ? (i know the timestamp is wrong, just for example) THX!!!!!
  9. Please help me, I know this should be simple... I need to capture everything between the <example> tags on a page and can only capture the first instance of it. here's my code (exampled out) $string = file_get_contents("http://www.example.com"); preg_match('~<example>(.*)</example>~isU', $string, $example); $example1 = $example[1]; $example1 will return the first instance of what I'm looking for. I know that preg_match_all comes into play somewhere here but not sure how to make it work... what is wrong with this.. preg_match_all('~<example>(.*)</example>~isU', $string, $example); $example1 = $example[1]; $example2 = $example[2]; $example3 = $example[3]; etc... Thanks for any help!!
  10. Hello, i know this is probably pretty simple but still very new to regex stuff... how would i go about retreiving - 0.008025 from this <span class="sg"> <span id="ref_73025_l">0.008025</span> so actually i would need to get everything in between '<span class="sg"><span id="ref_*">' and '</span>' the 73025_1 would be changing (sometimes 4,5,or 6 characters long)so I would need to wildcard that part somehow... and capturing the result in a variable? thanks!!!!!!!! :D :D
  11. i'm fairly fluent in php but don't really know where to even start with this....so please don't bite my head off for not posting code :-\ i just need a point in the right direction Example: if a user types in MSFT i need to be able to go to http://www.google.com/finance?q=msft (i know how to do this part) but then i need to be able to return just the price which in the source of that page is.. <span class="pr"> <span id="ref_358464_l">29.77</span> so i just need to have it so a user types in MSFT on my site and it goes to http://www.google.com/finance?q=msft, grabs the price ($29.77) and spits it out all on my site without the user actually being sent to google finance, a point in the right direction would be greatly appreciated!!!! love you guys, lifesavers!!
  12. I am allowing users to upload a picture for their profile, and renaming their file basically time().$username. But this will lead to users having multiple pictures on the server but only one of them being used, so I want to prune the unused pics, when they upload a pic, it saves that picture name in the user table in a field called 'userpic', how would I go about searching for user images that are not also in the 'userpic' field? and delete them?? would I use ftp_delete function?? thanks for any help, i'm a little worried about having an ftp_delete function in my script, kinda scary...
  13. i'm not seeing the cookie where all the other IE cookies are stored, i see the favicon cookie but thats it...to be honest i'm not having the problem, a bunch of users are having it though. When they close their browser and open it back to page, they are logged out. Session is fine though...Firefox is fine of course though too... any help??
  14. oh and btw, i've tried several computers, and different privacy settings to include "accept all cookies" and when i look for the cookies, i don't see them in there, but firefox stores them just fine...
  15. I'm having a problem keeping users logged in, in Internet Explorer. The session is working fine and the cookies are working fine in FireFox (of course)... here is my cookie code: setcookie("user_id", $_SESSION['user_id'], time()+60*60*24*60, "/"); setcookie("user_name", $_SESSION['user_name'], time()+60*60*24*60, "/");
  16. For some reason, no matter what I do I can only upload 1264 rows from a CSV file, keep getting Invalid field count in CSV input on line 1265 error. The csv file is 128 kb and has 2390 rows. It's not a problem with row 1265 because I've tried deleting that row, replacing it with another row, etc... the table structure is UTF8, sym is the index sym varchar(15) utf8_general_ci name varchar(100) utf8_general_ci ppschange varchar(25) utf8_general_ci pps varchar(25) utf8_general_ci bid varchar(25) utf8_general_ci ask varchar(25) utf8_general_ci volume int(25) No trades int(25) No 10dayvol int(25) No any idea what could be causing this??
  17. cool thanks, i'll give it a shot!
  18. I can't figure this out.. How would I make the below text (the directions) display: 66t 329p 235 Kansas City 52t 443p 18t 44p 347 Warrenton The below text is what I want to manipulate..(basically I want to capture everything inside the curly brackets and get rid of everything else) Mile Instruction Summary: 472.6 miles (8 hours, 12 minutes) 0.0 Depart Omaha on Capitol Ave (East) 0.1 Turn LEFT (North) onto N 16th St 0.3 Turn RIGHT (East) onto Chicago St 0.4 Take Ramp onto I-480 [Gerald R Ford Fwy] 1.2 Entering Iowa 1.5 Turn RIGHT onto Ramp 1.6 Take Ramp (RIGHT) onto I-29 4.6 At exit 1B, turn RIGHT onto Ramp 4.8 Turn LEFT (North) onto S 24th St 5.4 Turn RIGHT (East) onto 23rd Ave 5.5 Turn LEFT (North) onto Local road(s) 5.5 Arrive {66t} [51501] 5.5 At {329p} [51501], stay on Local road(s) (South) 5.6 Turn RIGHT (West) onto 23rd Ave 5.7 Turn LEFT (South) onto S 24th St 6.3 Take Ramp (LEFT) onto I-29 [i-80] 57.0 Entering Missouri 136.8 At exit 44, turn RIGHT onto Ramp 137.0 Turn LEFT (East) onto I-29 Bus [uS-169] 137.0 Road name changes to US-169 138.7 Turn LEFT (North) onto Riverside Terrace SE 139.3 Turn RIGHT (East) onto Saxton Easton Rd SE 140.5 Turn LEFT (North) onto Local road(s) 141.0 At {235} [64507], return South on Local road(s) 141.4 Turn RIGHT (West) onto Saxton Easton Rd SE 142.6 Turn LEFT (South) onto Riverside Terrace SE 143.2 Turn RIGHT (West) onto US-169 144.9 Road name changes to I-29 Bus [uS-169] 144.9 Take Ramp (LEFT) onto I-29 [uS-71] 191.0 At exit 6A, take Ramp (RIGHT) onto Armour Rd 191.3 Road name changes to SR-210 [Armour Rd] 192.5 Turn RIGHT onto Ramp 192.7 Take Ramp (RIGHT) onto NE Chouteau Trafficway 194.2 Turn LEFT (East) onto E Front St 194.7 Turn LEFT (North) onto N Topping Ave 194.8 Turn RIGHT (East) onto E Connecticut Ave 195.0 Turn RIGHT (South) onto Local road(s) 195.1 At {Kansas City} [64120], return North on Local road(s) 195.1 Turn LEFT (West) onto E Connecticut Ave 195.3 Turn LEFT (South) onto N Topping Ave 195.5 Turn LEFT (East) onto E Front St 196.3 Take Ramp (RIGHT) onto I-435 200.7 At exit 63B, take Ramp (LEFT) onto I-70 [George Brett Super Hwy] 221.0 At exit 28, turn RIGHT onto Ramp 221.2 Turn LEFT (North) onto SR-F [sR-H] 221.3 Road name changes to SR-H [N Broadway St] 222.0 Turn LEFT (West) onto E Jim Owens Rd 223.1 Turn LEFT (South) onto Local road(s) 223.3 At {52t} [64075], return North on Local road(s) 223.4 Turn RIGHT (East) onto E Jim Owens Rd 224.5 Turn RIGHT (South) onto SR-H [N Broadway St] 225.2 Road name changes to SR-F [sR-H] 225.3 Take Ramp (LEFT) onto I-70 [uS-40] 246.3 At exit 49, turn RIGHT onto Ramp 246.5 Turn LEFT (North) onto SR-13 250.0 Turn RIGHT (East) onto Mt Moriah Rd 251.0 Turn LEFT (North) onto Shelby Rd 251.7 Road name changes to Shelby St 251.7 Turn LEFT (West) onto Local road(s) 251.8 At {443p} [64037], return East on Local road(s) 251.9 Turn LEFT (North) onto Shelby St 252.5 Turn RIGHT (East) onto SR-T [E 26th St] 252.7 Keep STRAIGHT onto SR-T 257.3 Keep STRAIGHT onto SR-T [1st St] 257.7 Keep STRAIGHT onto SR-T 259.3 Road name changes to Blue Jay Rd 259.4 Turn LEFT (East) onto Old Highway 40 261.9 Turn LEFT (North) onto CR-263 [MO-KK] 262.0 Turn RIGHT (East) onto Mulkey Station Rd 263.0 Turn RIGHT (South) onto Zoar Rd 263.8 Turn RIGHT (South) onto Cooks Store Rd 264.3 Turn LEFT (East) onto Local road(s) 264.6 At {18t} [64020-0745], return West on Local road(s) 264.9 Turn LEFT (South) onto Cooks Store Rd 265.5 Turn LEFT (East) onto Minuteman Rd 267.8 Turn LEFT (North) onto SR-23 268.5 Keep STRAIGHT onto SR-23 [s Main St] 269.8 Keep STRAIGHT onto SR-23 [N Main St] 270.0 Take Ramp (RIGHT) onto I-70 [uS-40] 314.7 At exit 103, turn RIGHT onto Ramp 314.9 Turn RIGHT (South) onto SR-B 317.2 Turn RIGHT (West) onto Local road(s) 317.3 Turn RIGHT (North) onto Local road(s) 317.5 Arrive {44p} [65233] 317.5 At {347} [65233], stay on Local road(s) (South) 317.7 Turn LEFT (East) onto Local road(s) 317.9 Turn LEFT (North) onto SR-B 320.1 Take Ramp (RIGHT) onto I-70 404.7 At exit 188, turn RIGHT onto Ramp 404.9 Turn RIGHT (South-West) onto SR-B 406.5 Keep STRAIGHT onto MO-Ee 407.1 Turn LEFT (South) onto Pendleton Lost Creek Rd 408.0 Turn LEFT (East) onto Local road(s) 408.0 Bear LEFT (North-East) onto Local road(s) 408.1 Turn RIGHT (East) onto Local road(s) 408.2 At {Warrenton} [63383], return West on Local road(s) 408.2 Turn LEFT (South) onto Local road(s) 408.4 Bear RIGHT (West) onto Local road(s) 408.4 Turn RIGHT (North) onto Pendleton Lost Creek Rd 409.3 Turn RIGHT (East) onto MO-Ee 409.9 Keep STRAIGHT onto SR-B 411.4 Take Ramp (RIGHT) onto I-70 [uS-40] 432.9 At exit 210A, take Ramp (RIGHT) onto US-40 [uS-61] 442.9 At exit 9, road name changes to I-64 [uS-40] 470.9 At exit 37A, turn RIGHT onto Ramp 471.0 Road name changes to Market St 472.3 Turn RIGHT (South) onto S 21st St 472.5 Turn RIGHT (West) onto Local road(s) 472.6 Arrive St. Louis SUMMARY Driving distance: 472.6 miles Trip duration: 8 hours, 12 minutes Driving time: 8 hours, 12 minutes Cost: $68.27
  19. Hello, not sure if this is more of a php or mysql question, but i'm making a simple forum and am trying to make it so when a user inputs a message it can be displayed with the same spacing and line breaks they used. For example if they pressed enter here it would drop down a line much like it is in this message. Currently my forum would display this whole message in one big paragraph. Any idea how to do this? all i need is a point in the right direction, thanks guys!!
×
×
  • 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.