Jump to content

TD

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by TD

  1. BIG BIG BIG Thanks Great community...
  2. There may be a space between the word and number, what should i do, it wont work!??!
  3. Yes i will have it always that word first and then the number comes. Many thanks it works very well! Cheers!
  4. Hello! I need to split words from numbers. $code = "Johny234"; $split = explode(" ", $code); $codetxt = $split[0]; $codenr = $split[1]; Hope that someone can help me... many thanks!
  5. I will post the whole script: if (empty($name)) { $nam = ""; $nam2 = ""; } else { $nam = "where (name='$name' or surname='$name')"; $nam2 = "and name='$name' or surname='$name')"; } if (empty($region)) { $regi = "$nam"; } else { $regi = "where (regions='$region' $nam2)"; } $sql = mysql_query("SELECT * FROM $tab $regi order by name, surname asc");
  6. Hi, I have a little problem, but can't figure it out, how can i fix it?!?!? I would very appreciate any help. DB: Name: Johny Texas Knight Surname: Walker Ranger Rider I have only one search box and when i search one string like Johny or Walker everything works fine, but when i write them together, they just don't show up. My php code looks so: if (empty($name)) { $nam = ""; $nam2 = ""; } else { $nam = "where (vards='$name' or uzvards='$name')"; $nam2 = "and vards='$name' or uzvards='$name')"; } How should I write it correctly so that the script understands? Many thanks, hope You understand, what am i asking.
  7. Hi, could please someone tell me, how can i limit the echo chars from database, example, i have in table a row where is many text written, but i need only to echo first 150 chars. $sql = mysql_query("SELECT * FROM $tab where (val=$vid and $subisa and $subisb and $subisc and $subisd) order by title asc limit $limitvalue, $user_view_limit"); while($r=mysql_fetch_array($sql)) { $title=$r["title"] ; $text=$r["content"] ; echo "<h2>$title</h2>"; echo "<br/><h3>$text</h3>";
  8. well i got it, everything is working just fine thx for helping
  9. the variables i'm getting from drop down menu. i am trying the code wich you suggested about the blank variable, i will later say if it works.
  10. yeah but the prob. is that when i select example 3 choices, then it shows all the tree, not those who are exact the 3. Example: Country City Region When i choose just country it should echo all the values, that have exact the same id country as it is selected in search criteria, but if the user chooses country, city and region, it should echo only the values, that have all the three variables, not just one.
  11. is it possible to do the same thing but with "AND" function? I tried but it just don't work ???
  12. Hi could please someone help me out: i'm coding search fields and need to select in database one table and many columns, but it just wont work, well what i meant you will get when you watch the code: <? if ( empty($suba)) $suba = ''; else $suba = $_REQUEST['suba']; if ( empty($subb)) $subb = ''; else $subb = $_REQUEST['subb']; if ( empty($subc)) $subc = ''; else $subc = $_REQUEST['subc']; if ( empty($subd)) $subd = ''; else $subd = $_REQUEST['subd']; $sql = mysql_query("SELECT * FROM r where (suba='$suba' and subb='$subb' and subc='$subc' and subd='$subd')"); while($r=mysql_fetch_array($sql)) { $title=$r["title"] ; echo "$title <br>"; } ?> Thanks in advance!
  13. yes it works - smoooth one.. Thanks!!!!!
  14. Well i just thinked about your 1 idea, yes thats a option, but maybe if you get it really quick, without prob. then the 2 option would be much better. I would very appreciate it. Thanks for helping! The code you can easy save with save target as.. http://www.racing.lv/car/
  15. Well yes with the back button it works, but mostly users just change immediatly all the form, they dont hit back, and if it's so, then the car vanishes and selects the first one.
  16. http://www.racing.lv/car/ You can easy simulate the buttons self http://www.racing.lv/car/reg.php?t1=Golf%201.6i And after hit submit you will see that it just dont work. You need reg.php and form.php
  17. well i'm not familiar to sessions, could you please make a little sample for one car. Thanks!
  18. allright the code looks now so and the option values work, but it just wont remember, when i hit submit form. if($_GET['t1'] == "Polo 1.4i") $isSelected = "selected"; if($_GET['t1'] == "Golf 1.6i") $isSelected2 = "selected"; if($_GET['t1'] == "Golf 1.9 TDI") $isSelected3 = "selected"; <option value="Polo 1.4i" title="Polo 1.4i" <?=$isSelected?>>Polo 1.4i</option> <option value="Golf 1.6i" title="Golf 1.6i" <?=$isSelected2?>>Golf 1.6i</option> <option value="Golf 1.9 TDI" title="Golf 1.9 TDI" <?=$isSelected3?>>Golf 1.9 TDI</option>
  19. no reaction, the same.. ???
  20. xmm i have not correctly tested, because the option box is always selecting the last option, so something is wrong it just wont remember.
  21. wow it works, big thx DeadEvil, many many thanks.
  22. Hi, could please someone help me out, i'm thinking how to do this for about a day, and can't solve the prob. When a user clicks on a car the option box selects what car has been choosed, after filling the form in and if he has forgotten to type some info, the script echos what did he forget, and the prob is, that the option value disappears. How can i save the value or post it over? Thanks ! P.S. sorry for my bad lang. <?php $t1=$_GET['t1']; switch($t1) { case "1": $t1v="selected='selected'"; $t2v=""; $t3v=""; break; case "2": $t1v=""; $t2v="selected='selected'"; $t3v=""; break; case "3": $t1v=""; $t2v=""; $t3v="selected='selected'"; break; } <form action="<? echo $_SERVER['PHP_SELF']; ?>" method="post"> <select name="auto"> <option value="Polo 1.4i" title="Polo 1.4i" <? echo $t1v?>>Polo 1.4i</option> <option value="Golf 1.6i" title="Golf 1.6i" <? echo $t2v?>>Golf 1.6i</option> <option value="Golf 1.9 TDI" title="Golf 1.9 TDI" <? echo $t3v?>>Golf 1.9 TDI</option> </select> </form>
×
×
  • 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.