-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
Well I'm not psychic, the OP didn't mention that. Also I just modified what Zanus already did. Thanks for pointing that out though. It is a common occurrence in this forum for people to not fully explain what a string/value can be/contain. As they say, GIGO.
-
$yObj = "<object width='480' height='385'>\n <param name='movie' value='http://www.youtube.com/v/\\1&hl=en_US&fs=1'></param>\n <param name='allowFullScreen' value='true'></param>\n <param name=allowscriptaccess' value='always'></param>\n <embed src='http://www.youtube.com/v/\\1&hl=en_US&fs=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='385'></embed>\n </object>\n"; $yLink = preg_replace("#http://www.youtube.com/watch?v=([a-zA-Z0-9]+)is", $yObj,$subject);
-
If I had to take a guess, for example....user selects "shoes" and picks a particular brand of shoe and then refines it to just black shoes and then shoes with high heels. But then wants to change brands but keep those properties. Well the new brand may carry options the other brand did not, so there might be more properties. Of course I could be way off base here, just a random shot in the dark... but if th is is the case, to the OP I would ask..why not build your object to take an optional argument for an object and build from it? Or maybe a method that creates a new specified object using existing properties? Then you could "cast" it like $object->convertToProductB() or something. idk. random thoughts.
-
yes it is possible. It is called session hijacking. Session variable names and their values are stored on the server in a temporary file. When you start a session, a unique key - an id - is created (by default it is randomly generated, though you can specify what the id is if you want to). This key (id) is stored in a cookie on the user's computer. If cookies are disabled, it is possible to pass the session key (id) as a url parameter instead. It is not possible to directly access a session variable or its value, because it is stored on the server. What happens with session hijacking is someone changes the session key (id) cookie value to another value that matches someone else's session key (id). Virtually every browser out there makes it super easy to alter cookie values via built-in developer tools or addons. Also it's really not that hard to just edit the cookie file directly. Or specifies it in the url when making a request to the server, which is as easy as just entering in the appended url into your browser url box and pressing the go button. This is why when you are on a public or shared computer, it is a good idea to clear your cookies, history etc.. before leaving. Yes, if someone guesses another user's session key (id) they can send that key in their next request and be logged in as that user. This is why most sites do not show particularly sensitive account information, even within account settings (like credit card numbers, ss numbers, passwords, etc...), and also prompt for info before changing key information (like prompting for old pw to change your pw, etc...).
-
you don't technically need to only echo it out on a condition...if it doesn't exist nothing will be output. Also, for chunks of html it is a lot cleaner to use heredoc style syntax: echo <<<FORMENT <form id="add_category" name="add_category" method="post" action="" class="form"> <input type="text" id="category" name="category" style="width:400px" maxlength="100" title="Enter a new category name here" value="{$_POST['category']}" /> <input type="submit" id="submit" name="submit" class="submit" value="Submit"/> </form> FORMENT; It gives you the benefit of parsing the string like double quotes but without having to escape quotes. Also, you don't need to break out of quotes for variables (if you are using double quotes or heredoc). Wrapping {..} around the variable will tell php your intended variable boundaries. This will also keep your code more readable.
-
actually I lied... I thought if you just did like document.getElementById("iframeidhere").src it would give you the current url but it will only give you the initially loaded url in the iframe, so if the user is navigating to other places within the iframe, you can't grab that value. If the currently loaded page is on the same domain as the main page then you can use (IE) document.getElementById("iframeidhere").contentWindow.location.href (other browsers) document.getElementById("iframeidhere").contentDocument.location.href But if the currently loaded page is not on the same domain as the parent then it is considered cross-site scripting and is not allowed (will throw you an error) - so you are just shit out of luck if that is what you are needing.
-
...or just format it in your query so the result returned from the query is already formatted...
-
if the iframe url is changing, you can't grab the current one with php. You will have to use javascript (client-side scripting).
-
Don't most schools ban cell phones or make students keep them off/in their locker or some shit? Is your school actually an exception?
-
If she were a decent wife, you'd always be talking over her head, as she'd be down on her knees giving you a ...
-
That would be because when the people who were trying to help asked you for information asked what was up, instead of giving us information you called us idiots and other things. Which is why others started attacking you back. You didn't start giving any kind of useful information about your situation until your last post.
-
Officially Eric (The owner of phpfreaks) has left all matters phpfreak related into the hands of the admin. There is literally nothing he can report to Eric that Eric won't say "tough shit, the buck stops at the admin" or just outright ignore it because well, the buck stops at the admin. I suppose if someone were trying to tell Eric that the admin were running some illegal kiddie pr0n ring or something then he'd take notice...but other than that...yeah. I didn't bother to mention that before because this guy seems pretty determined to believe that we are all idiots and the only person that can help him is Eric himself. I suppose my most helpful advice to offer up is for him to contact one or more of the other admin of the site, because really, Eric is a dead-end for this, despite the fact that he's "king of the hill.". And FYI in all fairness Mr. paddyhaig is clearly the one being an ass. He has now taken to PMing others with derogatory stuff for no good reason. Here is what he personally PMed me: I have no idea what he's talking about, nor have I communicated anything to him outside of this thread, so judge for yourself who is being an ass.
-
Dunno what to tell you man...there's a reason why coding is considered an artform. It's not just about memorizing functions..it's the art of using putting it altogether, or putting on a detective hat to hunt down issues, etc... it's not something anybody can just pick up. Have to have a certain aptitude for it. As for me, I am not some great and genius coder either. But I'm fairly clever so I get by :/ a lot of it, especially with working with clients involves working on non-coding skills, like having strong communication skills.
-
paddyhaig, multiple people have reviewed the posts and we don't see anything wrong with what Thorpe has said. I asked you to point specifically at what you found offense to and your only response is to call all of us idiots as well. The contact information posted above is correct, though I don't really know what you are hoping to accomplish, considering it is quite obvious you are the one being the ass.
-
No worries... that wasn't necessarily directed at you specifically, I was just trying to explain how it is with the 3rd Party forum in general. It is practically impossible to solve the problems asked there because when it comes to solving problems with code...well like for instance, you look at a snippet of code and some common, basic questions might be "Where is $xyz coming from?" "Where do you output $xyz?" "What is the intent of xyz()?" etc... Most of these basic questions, the average poster cannot answer because it's some 3rd party script they know nothing about, don't really know how to code in general, etc... it's not that people are unwilling to help per se, it's just that most of the time it's simply impossible to help because solving the problem needs to be a 2-way street.
-
Let me give you an analogy: It's like not knowing a damn thing about fixing cars and asking a mechanic to walk you through fixing your car over the phone. Is it impossible? No. But it is too hard for most people to bother trying to help with, esp if they are doing it for free. Even a noob coder trying to learn is either asking basic questions with basic code, or knows the basics and is asking about more complex code. That's usually not the case with a non-coder asking for a fix with 3rd party scripts.
-
each iteration of the foreach loop overwrites the previous value of $white (and the other variables) with a new value... if you are wanting to save the data from each iteration, store it in an array: $white[] = str_replace('White ', "", $whiteNo); then for instance you can access the value of the first iteration with $white[0], 2nd iteration with $white[1], etc...
-
Quite likely, but we don't want to keep patching it every time the forum is upgraded. File a bug report with SMF. This.
-
yeah good luck on that. I was looking into that a couple years ago as a possible solution to something and I have to say it was a mindfuck trying to wrap my head around it. Although...that was a couple years ago, and my code-fu skills have significantly improved since then...might have to look into it again.
-
I assure you, you are not the first person who needed a generic url regex validator.
-
hmm okay you may have got me there... I'm not sure...I guess I assumed in the admincp you can add new links via interface. But I don't have access to any of that. Well if that's the case, then...I apologize for the hasty scolding...
-
I love how people like to post SMF bugs/issues to us like we made it or something. Take that up with the SMF team. We didn't make the forum software.
-
Cags: Right, listing similar artists is fine and dandy, no beef with that. Problem is it sounded like he's just wanting to scrape last.fm for their content and paste it on his site. But if they have an API that lets you do that then more power to him. I would suggest he read the API ToS very carefully though. I have a sneaking suspicion it probably requires mention of the content coming from last.fm and maybe a link to it or something. IOW no passing it off as your own content.