-
Posts
1,285 -
Joined
-
Last visited
Never
Everything posted by ohdang888
-
ok so i want to take this (stored in a variable): 2010,02,15,23,59,59 and make it this: 2010,01,15,23,59,59 in other words, i want to take the value between the 1st and 2nd comma, and subtract it by 1. How would i go about doing this? Thanks
-
i would set it up like this... i'm not sure its the most effecient...but it should work. table "comments": articleID - id # of article page commentID - auto Increase...each row has a unique number isReplyTo - (either the commentID # or if it is a base comment (a comment on the article, not on another comment), simply 0) text - what they say and then whatever info you want
-
I'm having trouble getting the values from my drop down boxes
ohdang888 replied to adambedford's topic in PHP Coding Help
its most likely a variable used in the if statement.... isolate which if statement is the one not functioning like you need it to... and then echo its variables to see if the value is what it is supposed to be -
In my opinion, jQuery is the best tool to use when using AJAX, check it out http://docs.jquery.com/Ajax as far as the date goes, 2009-11-16 02:20:37 is not in the future. Nevertheless, you would get the unix timestamp of both dates, subtract them, and thats the amount of seconds between them.
-
Alright, i want to take a url like this: http://www.youtube.com/watch?v=CVWvCJcse8w&feature=youtube_gdata and just get the ID of the video ( value of v) I've tried preg match, but i'm terrible figuring out the way those combination of letters are supposed to go. How would it go? Thanks.
-
In your JavaScript, use if(!data.error){ or if(data.error == false){ in place of if(data.error == "false"){ will do, thanks. I will, but there are larger issues at hand for me. This puts the songs on the html list, but my other function rely on that "key"...the "0" or "1" in front of it.
-
AHHHHHHHHHHH no i have 5.2.11 any other solutions? any way i could modify my javascript possibly??
-
Well i'm assuming the issue is the JSON i created here is my old, handmade JSON, when i use it, my site works. playerData.music_lib = { error:"false", errorMessage: null, numberOfSongs:6, music:{ 1:{title: "Someday", artist:"Rob Thomas", album:"Unknown", time:"1:45", plays:4, songID:"234526", ytID:"CVWvCJcse8w"}, 2:{title: "Look Back At Me", artist:"Trina", album:"Unknown", time:"1:15", plays:1, songID:"153456", ytID:"xszqrOffFuw"} } }; when i use this (from json_encode): playerData.music_lib = {"error":false,"errorMessage":null,"numberOfSongs":6,"music":[{"title":"Someday","artist":"Rob Thomas","album":"Unknown","time":"","plays":"1","songID":"2","ytID":"CVWvCJcse8w"},{"title":"Testing title 1st","artist":"artist of 1st","album":"","time":"","plays":"0","songID":"1","ytID":""}]}; it doesn't work.. This is my JS function (which works with the handmade JSON) function loadBaseSongs(data){ if(data.error == "false"){ jQuery.each(data.music, function(key, song) { //FORMAT: title, artist, time, album, plays $("#current_playlist").append("<tr><td><a href='#' onClick='playNewSong(\"" + song.ytID + "\"," + key + ");'>" + song.title + "</a></td><td>" + song.artist + "</td><td>" + song.time + "</td><td>" + song.album + "</td><td id='" + key +"_playCount'>" + song.plays + "</td></tr>"); });//end each } } [code]
-
This array: Array ( [error] => [errorMessage] => [numberOfSongs] => 6 [music] => Array ( [0] => Array ( [title] => Someday [artist] => Rob Thomas [album] => Unknown [time] => [plays] => 1 [songID] => 2 [ytID] => CVWvCJcse8w ) [1] => Array ( [title] => Testing title 1st [artist] => artist of 1st [album] => [time] => [plays] => 0 [songID] => 1 [ytID] => ) ) ) with json_encode($my_array); is turning it into this: {"error":false,"errorMessage":null,"numberOfSongs":6,"music":[{"title":"Someday","artist":"Rob Thomas","album":"Unknown","time":"","plays":"1","songID":"2","ytID":"CVWvCJcse8w"},{"title":"Testing title 1st","artist":"artist of 1st","album":"","time":"","plays":"0","songID":"1","ytID":""}]}; Notice how there is no "0" or "1" array, it just simply puts it in there without something as the key...so i want this: {"error":false,"errorMessage":null,"numberOfSongs":6,"music":["0":{"title":"Someday","artist":"Rob Thomas","album":"Unknown","time":"","plays":"1","songID":"2","ytID":"CVWvCJcse8w"},"1":{"title":"Testing title 1st","artist":"artist of 1st","album":"","time":"","plays":"0","songID":"1","ytID":""}]}; How is that done?? Thanks.
-
you'll need to learn this from a tutorial.... http://lmgtfy.com/?q=php+form+handling+tutorial
-
change this: <tr><td><?=$v["url"]? __bxhref="<?=$v[">" title=<?=$v["name]?></td></tr> to: <tr><td><? echo $v["url"] ?> __bxhref="<? echo $v['YOUR VARAIBLE NAME HERE!!!!!']> " title="<? echo $v["name"] ?></td></tr>
-
var obj = {2:{"name":"Test for number 2", "other":"yup"}, 4:{"name":"What i want!", "other":"yup"} }; var test = 4; alert(obj.test.name);// Would say "What i want" var test = 2; alert(obj.test.name);// Would say "test for number 2" the variable "test" differs, so the path the values i'm looking for is differnt, how is this achieved? Thanks!
-
[SOLVED] IF Whitespace In $field Do This
ohdang888 replied to EternalSorrow's topic in PHP Coding Help
this should work to find it: $mystring = 'abc '; $findme = ' '; $pos = strpos($mystring, $findme); if($pos == true){ //there is white space } -
is it throwing any errors?
-
ya please elaborate
-
can you create a subdomain of your site through php, or do sites like blogspot just use mod rewrites and pass the name of the subdomain to a page, which processes it from there? Thanks
-
is there a function built (in the php library) that turns an xml document into an array? If not, is there any lightweight ones out there built? Thanks
-
ok i'm proficient in php, and LOVE its combination of effectiveness and simplicity.. but I've been hearing a LOT lately about pyhton... particularly facebook's open sourcing of "Tornado" ("Tornado is a relatively simple, non-blocking Web server framework written in Python. It's designed to handle thousands of simultaneous connections, making it ideal for real-time Web services.") So i'm a little confused. Can python be intergrated with a php site? And its wording is confusing as well... its a framework?? it doesn't actually handle, say for instance, form handling, user interface, etc. ??? Thanks
-
if you mean you're passing it in the url, that's very insecure and should NOT be done.
-
a secure application usually uses both cookies and sessions in different ways to keep track of a user
-
that completely wrong. the action attribute of the form does NOT have to be set to current page for it to be POST... in fact, i'd recommend using POST for 99.9% of the forms you create
-
what do you mean??? are you asking how to retireve the value of that field?? if so...its value will be stored in this var: $_POST['mode'];
-
do this: $value = $_REQUEST[$rad1[0]]; $sql="INSERT INTO section_c (`C1`) VALUES ('$value') ";
-
I don't know. Each API is built differently to serve the different needs of people who built it. I'm assuming they required you to encrypt the data you send them, however i'm not familar with the paypal API, so idk. Most companies that build an API also set up a wiki with all the information about the API in it. I'm not sure what paypal does.
-
Why do you say that ? i mean that mainly for social networks. Why would leave facebook, where all my friends are, to join a social network that is exactly like facebook, minus my friends.