Jump to content

blic

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

blic's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi All, I wanted to have in a page a link (or button) that, when clicked, called a function that would change some php variables. The piece of the the code would be someething like this: echo "<a href='#' onclick='foo()'><b>call foo</b></a>"; ?> <script> foo(){ <? $la = new MyClass(); $la->addver($ver); ?> } </script> <? I know this is not correct, so I was wondering if anybody has a simple solution to that. Cheers
  2. I thought it would work with php using $_SESSION, but it was just a guess..
  3. Hi, I have 2 radio buttons and one field. I want to be able to, depending on the user clicking on the field, set the radio button to disabled before submitting the form. How do I do it? I have this, and I wanted the function set_radio to disable the radio buttons: $v1=$v2 = "" <input TYPE="radio" NAME="prtype" VALUE="nose" <?= $v1 ?>>Nose <input TYPE="radio" NAME="prtype" VALUE="mouth" <?= $v2 ?>>Mouth <input type="text" name="text1" maxlength="10" class="entry" onclick="set_radio()" value="<?= $text1 ?>"> function set_radio(){ //set v1 and v2 to disabled } I
  4. ok.. i just got it! i have to use preg_quote($str,'/') sorry to bother
  5. Hello everybody! i'm trying to use preg_replace to find some piece of strings in a bigger string and highlight it, but for some it's not working. So here is what's going on: $str1 = abc aei abc qwerty $str2 = abcd/acb/acd_123/aac99/qwe.xc $bigtext = lalalalala abc aos abc qwerty lalala abcd/acb/acd_123/aac99/qwe.xc $replace = '<SPAN style="COLOR: red; font-weight: bold">\1</SPAN>'; $replacement1 = preg_replace( "/($str1)/" ,$replace, $bigtext); $replacement2 = preg_replace( "/($str2)/" ,$replace, $bigtext); So it happens to work for replacement1 but not replacement2. I have also tried $str2 = preg_quote($str2) but it still doesnt work. Would anyone know how this could be fixed? Thanks!!
  6. Hey, that helped, thanks! But I thought the solution would be different, so I'm still not sure how to find which line in my string contains a certain substring. I can find the position in terms of number of characters, but not in lines.. How can I find which line contains my string? thanks!
  7. Hi there, I have a string $str, and this string has a text with multiple lines. So let's say: $st= "hello everybody" So, if I echo that, I'll get: echo $st ===> hello everybody. If I use tag <pre>, I get: hello everybody So, how can I count the lines (in this case it would be 2)? In my problem I have a big string with several lines, and I want to extract a few lines, around a specific string. So I think if I can count the lines, I can do that.. Thanks!!
  8. thanks for the reply.. I know it works when there's only + But when there's + and spaces is when it get's confused.. Try the same example but instead of value=1+2+3+4 try value=1+2 +3+4 the space after "2" is the one I can't get..
  9. _GET does urldecode automatically.. I do enconde, in order to get the "+", but all original spaces also becomes "+" that's my problem. I want to get the original "+" as well as the spaces
  10. Hi all, I need to get a parameter from an url, but the GET variables are passed through urldecode(). Some of my variables may have characters such as "+", ":", spaces, etc. When I use GET, all "+" are converted to spaces. I can use urlencode to get the "+" back, but also everything that was previously a space also turns into "+". Example: variable = abc+ c+ Then I can get either: abc c or abc++c+ but I want to get abc+ c+ Would anybody know how to help me? Thanks!
  11. I actually downloaded the previous version of Xampp and it worked. I read a post somewhere where lots of people were complaining about it, and they all were saying that they had a 64bit machine and that the other version worked. so i tried and it worked! Thanks for your help! Cheers
  12. Hey, thanks for the reply, but I've restarted Apache but nothing happens.. I know the modifications I do take effect because, although what I want won't work, some other things I've modified just for testing worked. One person suggested me that it might have to do with the fact that I'm using a 64bit machine, and the pg dll might not work with that. What do you think? Thanks!
  13. Hi All, I'm trying to get xampp working, but I'm getting the following error: Fatal error: Call to undefined function pg_connect() I've checked php.ini to uncomment the lines: extension=php_pdo_pgsql.dll extension=php_pgsql.dll But I still don't get it to work. I using windows 7 64bits. I've downloaded the latest available version of Xampp for Windows: v1.7.4 Also, when I check phpinfo() I don't see postgre loaded. I've tested loading other extensions, and they work, but not the one i need. Would anybody know how to solve this? Thanks!
×
×
  • 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.