Jump to content

mikesta707

Staff Alumni
  • Posts

    2,965
  • Joined

  • Last visited

Everything posted by mikesta707

  1. taken from http://forums.digitalpoint.com/showthread.php?t=53570
  2. pretty cool, but its case sensitive. You should either convert everything to capital letters, or lower case letters. I broke it by changing FREAKS to FREAkS
  3. i would have to see your code to give an exact answer, but whereever you assign the value of the post variable to a php variable, instead of doing $username = $_POST['username']; do $username = $_POST['username'] . "@wherever.com";
  4. hmm well to help I'd really have to see more code than what you provided. But this is pretty much an HTML/CSS problem, so you may have better luck if you take this to that forum
  5. Im not sure exactly what you want to do? Do you want to strip numbers from strings? or just strip the number two? or also search for creed as well as creed2? can you perhaps explain a little better or provide more examples
  6. what to add depends on what results you want to get. How do you want to change your search query
  7. $username = "mikesta707"; $atWhere = "@phpfreaks.com"; $wholeAddress = $username . $atWhere;
  8. you can just set the font size. <div class="additional_info ie6fix" id='twitterbox'> <?php echo $feed[0]; ?> <span style="font-size:large" ><?php echo $feed[1]; ?></span> <span style="font-size:small" ><?php echo $feed[2]; ?></span> </div>
  9. heading tags automatically go to the next line. if you want to be next to each other you will have to set their float style, or some other display style try <div class="additional_info ie6fix" id='twitterbox'> <?php echo $feed[0]; ?> <h2 style="float:left"><?php echo $feed[1]; ?></h2> <h4 style="float:left"><?php echo $feed[2]; ?></h4> </div> I'm a little rusty on my CSS though, so that might be wrong
  10. because you are supposed to surround associative array strings with single quotes. a string that isn't surrounded by quotes is assumed to be a constant. For example DEFINE("MY_CONST", "SOME VALUE"); //if i want to use this constant echo MY_CONST; PHP is smart enough to realize that if a constant doesn't exist, you probably meant a string, but if you have a case where you want to say the string MY_CONST, instead of his value, when you do this echo MY_CONST when you meant echo "MY_CONST"; you will run into problems in your case, saying $myARR[mykey]; is technically OK as long as you dont have a constant named mykey, but its best practice to avoid instances when this could be a problem by surrounding your array keys with single quotes. oh and you surround it with curly brackets, because thats how you output associative arrays without concatenating strings
  11. you could also do this echo "<a href='".$row['link']."'>".$row['title']."</a>";
  12. $HTTP_POST_VARS still work in php4 and 5 but they are deprecated. if you notice you use the variable $recipientemail here mail($recipientemail,"$subject","$message","From: $Name <$Email>"); but that var is set as the string "BLANK" here $recipientemail = "BLANK"; that probably has something to do with your email script not working. Is there an error? What does the error message say?
  13. Both of those are perfectly fine. your "proper" syntax is "arguably" no better than what he had. you dont use the backslash to allow " symbols. you use it to escape symbols. For example the new line character \n or the tab character \t. inside strings surrounded with double quotes you need to escape any double quotes that are inside the string. same for single quotes. you can also do this echo '<a href="syntax">'; as cags said
  14. you can't return multiple values like that in PHP. if you want to return multiple values, put them in an array, and use the list function, like function censor($string){ if($string){ $sweararray = array('Fuck', 'bloody', 'shit'); $replacearray = array('F**k', 'b****y', 's**t'); $smilearray = array(''); $smileyarray2 = array('<img src=\'http://localhost/images/P.png\' width=\'60\' height=\'60\' />'); $new_string = str_ireplace($sweararray, $replacearray, $string); $new_string2 = str_replace ($smilearray, $smileyarray2, $string); return array($new_string,$new_string2); } } list($words, $smiles) = censor($someString); however, since there is only one string being passed in, why would you want two strings being passed out? function censor($string){ if($string){ $sweararray = array('Fuck', 'bloody', 'shit'); $replacearray = array('F**k', 'b****y', 's**t'); $smilearray = array(''); $smileyarray2 = array('<img src=\'http://localhost/images/P.png\' width=\'60\' height=\'60\' />'); $new_string = str_ireplace($sweararray, $replacearray, $string); $new_string = str_replace ($smilearray, $smileyarray2, $new_string); return $new_string; } } btw It returns that because this return statement return $new_string && $new_string2; is returning a boolean statement. this look familiar if ($new_string && $new_string2){ it returns 1 because that boolean expression is true
  15. it does as it name implies. it strips slashes from a string. for example <?php $str = "Is your name O\'reilly?"; // Outputs: Is your name O'reilly? echo stripslashes($str); ?> btw, googlek, and php.net are your friends. if you want to eliminate all spaces (Ie " ") then you want to use string replace, like so $newString = str_replace(" ", "", "Hello My name is Mikey!"); //output: HelloMyNameisMikey!
  16. also note, you can alter the style of the normal submit button via CSS
  17. you can create an image submit button <INPUT TYPE="image" SRC="images/submit.gif" HEIGHT="30" WIDTH="173" BORDER="0" ALT="Submit Form"> and for a link you can have it submit onclick <a href="#" onclick="document.form.submit()">submit</a> where form is the name of your form
  18. i've never heard of in_all_arr in my life, so unless you provide the definition for that function, it won't work. I did a google search for it to no avail. try this $photos = $f->photos_search(array("tags"=>".$pod.",".$loc.",".$act, "tag_mode"=>"any"));
  19. hmm im not sure how that junk would affect the PHP, but if you fixed it awesome. make sure you click the topic solved button at the bottom of the post. woot for virtual beer. cheers
  20. Hmm interested. Yeah just checked out it in Firefox. That doesn't really make sense since PHP is parsed by the server, so the browser doesn't really have anything to do with PHP. It seems as if it doesn't think you are submitting the post. Here try instead of this if (isset($_POST['submitted'])){//User did click. you just check that the submit button is checked, IE if (isset($_POST['submit'])){//User did click.
  21. Im in opera, and it works perfectly fine...
  22. Can you describe what happens when it doesn't work? do the cards not change? blank page? doesn't output anything?
  23. The only part of the method that is child specific will be the allowed file types. All subclasses of that parent will have a setFile() method, which will pretty much always look the same, baring the $this->allowedFiles array (which will be different for every class, but every class will have one). I guess I could always just override the setFile function, do the allowedFiles test, and then call the parent function. Oh well, I guess I will have to define it in every sub class. Thanks for all the info though! been a big help
  24. Hmm, didn't even know this thread existed. Name is Mike, 19 years old. Been coding php for about 5 years now, and been doin javascript for about 3. HTML for about 6 years, CSS for about 3 too. I dabble in flash every now and then. Go to college in New york City (pursuing a computer science degree) I also code in Java, C++, Python, and a couple of others I can't remember.
  25. If you haven't heard about this yet... take a read. cyborg beetles. Anyone remember the show BeetleBorgs? Yeah... its like that http://www.newscientist.com/article/dn17895-freeflying-cyborg-insects-steered-from-a-distance.html
×
×
  • 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.