Jump to content

void

Members
  • Posts

    76
  • Joined

  • Last visited

Everything posted by void

  1. Hi, I came across something which would look pretty straightforward, but apparently is not. Or that's just me and 2am on the clock. Anyways, the code: var text = 'blahblahblah'; document.getElementById('whatever').onmouseover = function() { myfunction(text); } the problem is that i want to parse the variable 'text' right here. that is, i need 'whatever' object to bind function myfunction('blahblahblah'), not myfunction(text). how do i do that?
  2. void

    Charset?

    very likely that mysql_query("set names utf8"); at the top will help.
  3. nevermind - turns out the <form> tag wasn't in the correct place. took me forever to figure out, especially since it worked perfectly on IE.
  4. as far as I know, you shouldn't use arrays in form element names.
  5. Okay, I'm back to this problem. Thanks for your replies. Here's the thing. I have something like: <form action="" method="post"> <div id="extra"> </div> <input type="text" name="something" value="test" /> <input type="submit" name="submit" value="Submit!" /> </form> So let's say I call this javascript function from somewhere: document.getElementById('extra').innerHTML = '<input type="text" name="field1" value="" />'; The text field appers on a page, but if I enter some text and submit the form, it doesn't post the info from that field. For example, if I do print_r($_POST); I see [field1] => [something] => test. Any idea what's the problem?
  6. i'm not sure if javascript can change css styles, but my idea would be to make an array of all the fields and then use a simple loop to change all their classes. for instance: var fieldset = ['name','email','address','phone']; for(var i in fieldset) document.getElementById(fieldset).className = 'active'; hope you get the gist.
  7. hi guys, I've come across an issue. looks like if I add an input field in a simple way, that is, appending html code of a field to innerHTML on a div, it doesn't actually create an element. it appears visually, but if i submit the form, there is no sign of that field. any ideas why could that be? thanks.
  8. elseif { ??? there's no condition. else { will work.
  9. <input type="radio" name="Query" value="Logistics" checked\> if ($emailgroup == "logistics") logistics != Logistics
  10. or, probably session_start(); session_destroy(); unset($_SESSION); :-)
  11. echo $username = $_POST ['username']; // check if this variable isn't empty setcookie('username', $username); echo "<a href="login2.php">LINK</a>";
  12. Well, if it was up to me, first I'd replace word "morning" in $images array with something like "[PARTOFDAY]". Then, I'd create a function, which, according to time, replaces [PARTOFDAY] with the corresponding part. it would look something like that: function PartOfDay($string) { $hour = date("H",time()); if($hour >= 6 && $hour < 12) $replace = 'morning'; elseif($hour >= 12 && $hour < 18) $replace = 'afternoon'; elseif($hour >= 18 && $hour < 24) $replace = 'evening'; else $replace = 'god knows what'; return str_replace("[PARTOFDAY]",$replace,$string); } and, to make this work, you'll just write <?php echo PartOfDay($caption); ?> hope I got this right, good luck
  13. don't worry man, employers always tend to exaggerate with the skills needed when they put up ads. i'm sure you won't need half what's mentioned there. and in interview emphasize things you're experienced in, not the ones you aren't familiar with. good luck, you'll do fine.
  14. definately, but the thing is I have to display list of templates in my own website. and that is what i'm trying to find a solution for, because i didn't find any distributor that offers, let's say, renewable XML feeds, which I would use to retrieve new lists of templates with php and then display them in the process of ordering a whole website.
  15. hi any of you guys could recommend a web template distributor that offers integration to your website? right now i'm working on a project where i need an option to sell templates for my clients along with my cms, but i would not like to redirect them to something like templatemonster.com. i need some, possibly xml, interface, so that people could see the templates from my own site (not that i'd be taking credit for them). also, i'd prefer lighter templates, because the majority of my clients are interested in small and stylish websites for their companies. thanks.
  16. this is completely written from my mind, you might get some errors, but should get the idea. $next_month = strtotime("+1 month",mktime(0,0,0,date("n"),1,date("Y"))); $next_month_label = date("F",$next_month); $link = strtolower($next_month_label).'.html'; echo '<li><a href="schedules/'.$link.'" class="navText">'.$next_month_label.'</a></li>';
  17. good. you can start by reading about sessions :-)
  18. table `forum_question` probably isn't there.
  19. If result=same code you had above. Assigning function to a variable and just checking whether it's empty doesn't mean anything for sure. if($result) echo 'success'; this will execute function assigned to $result and print out success.
  20. http://www.php.net/manual/en/function.mail.php take a look at $headers variable mate.
  21. umm, why would you use empty() ? wouldn't just if($result) do the trick?
  22. have you checked if it really adds addiotonal parameters to the query?
  23. allright, just what concerns your first post, try the 's' modifier: $code = preg_replace("/\[center\](.*?)\[\/center\]/s","<center>\\1</center>",$code);
  24. it's easier than it looks. ORDER and LIMIT commands will do the trick. SELECT id FROM table ORDER BY id DESC LIMIT 1,1 # 2nd biggest id SELECT id FROM table ORDER BY id ASC LIMIT 1,1 # 2nd lowest id
  25. oh, come on guys. $str = 'any.title.with.many.dots.wmv'; $title = substr($str,0,strrpos($str,"."));
×
×
  • 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.