-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
why not use curl in the first place?
-
[SOLVED] How to return an array from with in a class method?
.josh replied to willaguila's topic in PHP Coding Help
put the return outside of your loop. Once it's triggered the first time, it exits the loop and whole method. -
if it works fine in phpmyadmin but not in your script, check to make sure the vars are holding what you expect them to be holding (echo them out). Then check logic you have in place for displaying the message.
-
$implode_array = preg_replace('~,+~',',',trim($implode_array,','));
-
blog / tutorial commenting privileges
.josh replied to nrg_alpha's topic in PHPFreaks.com Website Feedback
I don't think we should have a min post req for main site comments. Some people get to it from google searches or RSS feeds from other places, etc.. and don't necessarily have a need/intention for posting shit on the forums. I think the solution would be to do some verification. Captcha, honey pot, etc.. do we even have any of that up for regular users? I don't see any, but it could be because of my membergroup... -
edit: eh.. I guess that's not the same thing. You're right. I can do (?<!b|bl) coulda swore that wasn't the case.
-
That's actually not true when dealing with PCRE in PHP. But I found out that my pattern is not working as intended, and solved it by using a negative lookahead as you suggested: No sir, you are incorrect. Perl (and therefore PCRE) regex does not support non-fixed length lookbehinds. Here is a very simple example: <?php $string = "blahblah"; preg_match('~(?<!.*).*~',$string,$matches); print_r($matches) ?> Produces: You could have relative paths beginning with either of those values, so I kept the colons. True, didn't think of them being dir names. Okay you got me there.
-
MadTechie: You have a | in your quote char class. This won't break it, though it will match a literal | in the off-chance it exists in the tag... IOW, don't need to do alternation inside a char class, because it is already built-in to character classes to match a OR b OR c OR etc... Also, this: (?!(?:javascript|mailto|aim) can be this: (?!javascript|mailto|aim) because lookaheads (and lookbehinds) have zero width assertion. edit: I think I know why you did that for the neg lookahead: wanted to move the : outside of it since it is present on all 3. My thought though is that since all links starting with javascript|mailto|aim will have that : anyways, no need to further look for the :.
-
actually you need to use a negative lookahead, not lookbehind, because with a lookbehind, you have to have the same amount of chars for each alternation.
-
hmm I don't think he's being ignorant. I'm not getting the impression that his mindset is simply due to a lack of knowledge. I think a better word would be biased, or stereotyping. Or <insert some other word here> that signifies knowing, and yet disregarding in favor of preference/whatever.
-
make another script for your ajax. lol2.php or something. Interact with lol2.php for ajax. lol2.php then calls lol.php as needed. You can then do any of the following with lol.php : - write a condition to see if request is coming from anything other than lol2.php. If not, GTFO. - change the chmod on lol.php so only server can access it. This will allow lol2.php to call it, but not the user. No custom GTFO per se... - move lol.php outside of the public web directory (httpdocs, public_html, whatever). Same thing as above.
-
eval though 95% of the time there is a way better solution to doing whatever it is you're doing that involves wanting to do that...
-
I have to admit though, I'm a huge sucker for foreign accents...
-
Free till 40 sounds great to me, i can do whatever i want - if your married you proberly find this irritating and you have grounds to be cause it AWESOME to be free and happy while your young Well don't get me wrong...bachelor life is great, such and all. I guess my question was more along the lines of, if you're gonna wait until 40, why bother at all?
-
I guess you're fucked if you're an asian-american woman, right?
-
I'm more wondering why you are waiting until 40 to get married...
-
you shouldn't have closed your dispute. The fact that they told you they'd "give it to you" if you closed the dispute should have sent all kinds of red flags up. Upon receiving that email you should have contacted paypal with that info and work with them to get your money back.
-
is it printing nothing? maybe your actual var name (improper use of quotes)? And anyways, is there any reason you have register globals on and are trying to use them?
-
yeah i tried it out during closed beta too. I thought it would be cool but after trying it, even barring the bugs (being closed beta and all...) it was annoying and seemed like it was adding extra steps to things instead of making things easier. I had fun throwing files/folders around the place, and spreading them out like cards and shit though...for like 5m....
-
Word of advice, you're more likely to get someone's help if you post the relevant part of your script (in code tags) instead of making people download some zip. The relevant part of your script would be the part that happens after you submit the form (where the form action points to). Offhand, without looking at your file or seeing what it's doing or using, I'd say the easiest thing for you to do is $_FILES['userfile']['name'] = strtolower($_FILES['userfile']['name']); $_FILES['userfile']['tmp_name'] = strtolower($_FILES['userfile']['tmp_name']); $_FILES['userfile']['type'] = strtolower($_FILES['userfile']['type']); at the top of the script the action="..." points to. You probably only need one of those, and you probably can just strtolower some other var grabbing it already, but again, I'm not going to download and sift through some script.
-
Google Analytics /js implementation – usage of addItem() – Help needed
.josh replied to ts2000abc's topic in Javascript Help
are you using the same SKU in the SKU argument (or not supplying one at all)? If that value is the same for all your _addItem, they are all treated as the same product. -
User rankings / ratings for Solved topics
.josh replied to gr1zzly's topic in PHPFreaks.com Website Feedback
do you have the ability to custom order that list? Because rank-wise, guru and pfr need to be swapped. -
DOM
-
If you do this: <form action = '' method = 'post'> <input type = 'checkbox' name = 'something[1]' value = '1' /> one <br/> <input type = 'checkbox' name = 'something[2]' value = '2' /> two <br/> <input type = 'checkbox' name = 'something[3]' value = '3' /> three <br/> <input type = 'submit' value = 'submt' name = 'submit' /> </form> And you check 1 and 3, you will get this: $_POST['something'][1] => 1 $_POST['something'][3] => 3 So yes, you will be able to do for instance, this: if (isset($_POST['something'][2])) { ...} or whatever.
-
In general, this is how it basically works: <?php echo "<pre>"; print_r($_POST); ?> <form action = '' method = 'post'> <input type = 'checkbox' name = 'something[]' value = '1' /> one <br/> <input type = 'checkbox' name = 'something[]' value = '2' /> two <br/> <input type = 'checkbox' name = 'something[]' value = '3' /> three <br/> <input type = 'submit' value = 'submt' name = 'submit' /> </form> Notice in the name attribute of the checkbox elements, you have a generic "something[]" for each one. If you check for instance value 1 and 3, you will get a 2 element array $_POST['something'][0] and $_POST['something'][1]. If you want to specifically keep track of which ones were tracked, you can explicitly name the array like so: <?php echo "<pre>"; print_r($_POST); ?> <form action = '' method = 'post'> <input type = 'checkbox' name = 'something[1]' value = '1' /> one <br/> <input type = 'checkbox' name = 'something[2]' value = '2' /> two <br/> <input type = 'checkbox' name = 'something[3]' value = '3' /> three <br/> <input type = 'submit' value = 'submt' name = 'submit' /> </form> This will cause all checked values to be posted to the specific elements.