Jump to content

shiftJIS

Members
  • Posts

    87
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://kashi.freelancedreams.com/

Profile Information

  • Location
    Japan

shiftJIS's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Haha, I guess everybody is as confused as me.Actually, the habit is coming from C, where you have to type all of your variables and functions. I'm actually not all that specific about typing in php, but my current project will be offered to the public eye, so I've been trying to take all steps into making it clean and legible to others.I suppose my confusion starts at the php docs: As you notice, they describe all the functions and tell you 1) the type the function returns, and 2) the types it takes as arguments.I do know that we don't have to declare types of variables, but I wanted to - I suppose what I wanted was for the functions I declared to throw an error if it was sent the wrong type (that is, without having to rely on the error catching code).Also, in the IDE that I use, functions you declare get added to the autocomplete list. My neurotic side wanted the little description to include those types.Anyhow, I suppose I'll leave it be for now and just stick with what works. Thanks for everybody's input!--UpdateGrr, If I only knew what to look for in the docs. Seems the answer was right there:http://us3.php.net/manual/en/language.oop5.typehinting.phpQuote from the little text at the bottom:
  2. That doesn't answer my question. I'm not worried about what happens after the function is called, I'm confused as to why calling the function using the syntax $this->some_method("some string") doesn't pass it a string.
  3. So, here's a watered down snippet of what I've been working on: class SOMETHING{ public $TEXT; public function some_method(string $var){ $this->TEXT = $var; } public function __construct(){ $this->some_method("default"); }} This has an error "Fatal error: Argument 1 passed to SOMETHING::some_method() must be an object of class string, called in.."So, the thing is, if I changed that function some_method to some_method($var), it'd work as intended. But the results aren't what I expected them to be. Doesn't calling the function with ("default") pass a string?Any ideas what's up?
  4. shiftJIS

    IE sucks :(

    The #nav div doesn't need to be first. The float will set it where it needs to be regardless. And actually, some people prefer the navigation to come after the content as it'll show up that way in text browsers. Where you put it is up to you.
  5. The issue is that both your .menu and .content divs are absolutely positioned. It's a bit of in issue if you cannot guarantee that the content will be longer than the menu div. I've been thinking about this problem a lot, and my method is to float the menu and div. Since you're using a fixed-width layout, just float those two divs, and put in a <div style="clear: both; height: 1px; margin-bottom: -1px"> </div> before the footer. The "clear:both" is what will push the footer below all other floated content, and you could very well just apply it to the footer. I personally prefer having a spacer div there.
  6. It doesn't do anything because you deleted the starting <form> tag.
  7. foreach is used to parse through elements of an array.Thus, it's expecting $_POST['radio'] to be an array. It then cycles though each element of that array, setting the value of the element to $value. I'm assuming you're deleting multiple messages (I mean, that count is there), so you need that foreach. I'd go look at your html and make sure that the form is returning an array into 'radio'.
  8. shiftJIS

    IE sucks :(

    If you add a float:left on your #nav div then it should be where you want it.
  9. Again, it can be done with CSS as I've shown on my test page. I'm sure you've just made some oversight on the part of your CSS style.
  10. What CSS did you try?I set up a few boxes:http://kashi.freelancedreams.com/textarea.htmlYou can use the readonly attribute, and either set the border color to match your background, or just set it to border: none; Either should be fine. I tested it with firefox 2.0, IE7, Opera9, SeaMonkey. Style doesn't work right on the PSP or sidekick though >_<;
  11. First of all, I'm assuming that you're taking data out of a <textarea> tag and directly inserting that data into <pre> tags. If that's not the case, you'll need to explain a little more (source code would be ideal).The pre tag is for text where you want the whitespace and line breaks to show up. The issue here - I'm assuming you're seeing lines wrap when you type in the textarea. The thing is, these line wraps AREN'T line breaks. The <pre> treats it as one long line and it renders as such.It's better to use a textarea field again in the preview. Set the attribute disabled="disabled" or readonly="readonly" (described here: http://w3schools.com/tags/tag_textarea.asp)If you then keep the textarea the same dimensions as the previous, it'll look exactly the same.
  12. Notice how you have <!-- and --> surrounding all of your CSS style? Also notice that where your javascript starts (line 78), you have a <!--, and the ending --> shows up around line 101. You need to move that further down to right before the ending </script> tag.
  13. shiftJIS

    Image Slices

    Don't use <img> for background images, style the table cells.The HTML way: http://w3schools.com/tags/tryit.asp?filena..._cellbackgroundUsing CSS: http://w3schools.com/css/pr_background-image.asp
  14. What exactly is the error that you get? It'd be nice if you could copy and paste the exact error message here. And the problematic code too.
  15. No wonder!The reason for this is because the code destroys the array.When "foreach($_POST as $key => $val)" reads $_POST['list'], it sets $key as "list" and $val as the array. However, the next line changes $_POST['list'] to whatever the result you get when you stripslashes and strip_tags from an array. Either it forced it to a string or resulted in a FALSE. Be more careful about these things! >_<;
×
×
  • Create New...