Jump to content

izzy

Members
  • Posts

    31
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by izzy

  1. The problem was not the query but it was the database fields. For some reason these fields were set as BLOB. When i converted them to TEXT the problem was solved. BLOB fields can not be case-insensitive. I thank you all for your help. Problem solved :-)
  2. Unfortunately this did not solve the problem. I already had a *_ci collation set for the database. I could not succeed in setting a lowercase command for the full text example you gave me. (that's all me.. i know :-( but still it didn't solve the problem) In the first example i have the exact same outcome as before. The text in the first field returns the right records. Yet the other fields don't return records when searching for a word that contains a captital letter.
  3. Hi, My search query will not return any records when i search for words that are entered into my database with a capital letter. The problem seems to be that i am searching in 3 different database fields and only one field returns records containing a capital letter. here is the an example of the code: $qeury = SELECT * FROM table WHERE LOWER(field_1) OR LOWER(field_2) OR LOWER(field_3) LIKE '%$search%' ORDER BY date The search works well on field_1. When i enter a search that i know is in one of the other fields and contains a capital letter then there is no match. field_2 and field_3 are not converted to lower-case for some reason. Your help will be greatly appreciated!
  4. I am trying to get my language selection to work by using a dropdown menu and saving the selection in a session variable. It will not switch the language and just stay on the default language. Even if the default language is changed and the script uploaded again the language will not change untill the browser is closed and openened again. It seems like the value in the session does not change. Thanks in advance!! Here is the code. It might be a mess by now because i have tried so many things. <? if (isset($_SESSION['lang'])){ $lang = $_SESSION['lang']; } else if (isset($_POST['langselect'])){ $lang = $_POST['langselect']; } else if (isset($_GET['langselect'])) { $lang = $_GET['langselect']; } switch ($lang) { case 'nederlands': $_SESSION['lang'] = 'nederlands'; include ("nl_lang.php"); break; case 'enlish': $_SESSION['lang'] = 'enlish'; include ("eng_lang.php"); break; default: $_SESSION['lang'] = 'nederlands'; break; } langheader(); ?> <div align="right"> <select name="langselect"> <option value=<?""$lang""?>>Language selection</option> <option value="english">Enslish</option> <option value="nederlands">Nederlands</option> </select> </div>
  5. Thanks for your feedback and answers. brotherZ, What you mention is the route i was thinking about too. Do you have an example of how to get the values from an external file?
  6. Hi guys and gals, I would like to make my site a multi language site. As this might involve a lot of work i prefer to only have to do this once and do it right. So i would like to have suggestions on how to do this the right way so that: * visitors can easily change the language of the site * other languages can easily be added when needed * this function does not make the website slow in any way Any and every sugestion is welcome. Thanks in advance!!
  7. Thanks a lot!!! Greetings, Izzy
  8. Hi, I've got a script that opens a url that is placed in my database. The only thing is that it opens in the same window as my site. It replaces my site. How can i make the page open in a new window? here is the script... <table width="300" border="0"> <tr>   <td class="lightheader">     <span><?php echo "<a href=\"".$link['url']."\">"?><strong><?php echo $link['name']?></a></strong></span>   </td> </tr> <tr>   <td class="footer">     <span><?php echo $link['description']?></span>   </td> </tr>       </table>     <td width="200">          <span><?php echo "<a href=\"".$link['url']."\">"?><strong><?php echo $img?></span>   </td> </table>
  9. I'll chek it out. Thanks for the info. Greetings, Izzy
  10. How can i stop people from getting to my database by entering php/mysql code into the forms i use on my site. Think of ... login field registration form search field etc. Greetings, Izzy
  11. Sorry everyone... Database connection wasn't good... :-[
  12. Thanks But still nothing has changed. I keep looking over the scripts but i can't see the problem  ??? >:( HELP !!!
  13. I'm trying to make a very simple form that places information in my database. I used a part of an existing script i have made some time ago. All i'm getting is a blanc page once i submit the form. Can someone tell me what is going wrong? Here is the code from the different scripts. This is the form: <html> <head> <title>Add a link or banner to the directory</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="hotbabevote.css" type="text/css"> </head> <body bgcolor="#FFFFFF" text="#000000" class="stdheaderconfig"><p><br> <p><br>   <span class="infosmallconfig">Use this form to add you link/banner to the directory. </span></p> <form action=entry.php method=post enctype="multipart/form-data">   <table width="700" border="0" cellspacing="2" cellpadding="2">     <tr valign="middle" bgcolor="F9F9F9">       <td class="stdtextconfig" width="122">Last Name:</td>       <td width="564">         <input type="text" name="lastname" size="45">       </td>     </tr>     <tr valign="middle" bgcolor="F9F9F9">       <td class="stdtextconfig" width="122">First Name:</td>       <td width="564">         <input type="text" name="firstname" size="45">       </td>     </tr>     <tr valign="middle" bgcolor="F9F9F9">       <td class="stdtextconfig" width="122">Company Name:</td>       <td width="564">         <input type="text" name="company" size="45">       </td>     </tr>     <tr valign="middle" bgcolor="F9F9F9">       <td class="stdtextconfig" width="122">Company URL:</td>       <td width="564">         <input type="text" name="companyurl" size="45"><br>         (ie.  http://www.myfashionshop.com )       </td>     </tr>     <tr valign="middle" bgcolor="F9F9F9">       <td class="stdtextconfig" width="122">Business Description:</td>       <td width="564">         <input type="text" name="description" size="45">       </td>     </tr>     <tr valign="middle" bgcolor="F9F9F9">       <td class="stdtextconfig" width="122">Country:</td>       <td width="564">         <input type="text" name="country" size="45">       </td>     </tr>     <tr valign="middle" bgcolor="F9F9F9">       <td class="stdtextconfig" width="122">City/State:</td>       <td width="564">         <input type="text" name="city" size="45">       </td>     </tr>     <tr valign="middle" bgcolor="F9F9F9">       <td class="stdtextconfig" width="122">Sales Rep. Name:</td>       <td width="564">         <input type="text" name="repname" size="45">       </td>     </tr>     <tr valign="middle" bgcolor="F9F9F9">       <td class="stdtextconfig" width="122">Banner upload:</td>       <td class="stdtextconfig" width="564">         <input type="file" name="fotopath">       </td>     </tr>     <tr bgcolor="F9F9F9">       <td colspan="2">         <div align="center">           <input type="hidden" name="action" value="insert">           <input type="submit" name="Submit" value="OK">         </div>       </td>     </tr>   </table> </form> <p>&nbsp; </p> </body> </html> here is the script that is supposed to enter the info into the database: //Een verbinding met de database maken include("system/connect.inc.php"); //parameters lezen if(isset($_GET['action'])) $action=$_GET['action']; if(isset($_POST['action'])) $action=$_POST['action']; if(isset($_REQUEST['action'])) $action=$_REQUEST['action']; //Hier worden nieuwe huizen toegevoegd if($action=="insert"){ //parameters lezen $last_name=$_POST['lastname']; $first_name=$_POST['firstname']; $company_name=$_POST['company']; $company_url=$_POST['companyurl']; $link_description=$_POST['description']; $link_country=$_POST['country']; $link_city=$_POST['city']; $rep_name=$_POST['repname']; if($_FILES['fotopath']['size']>0){ //Eventueel nieuwe afbeelding uploaden $source=$_FILES['fotopath']['tmp_name']; $afbeeldingnaam=time() . $_FILES['fotopath']['name']; //URL samenstellen $dest="banners/" . $afbeeldingnaam; $check1=copy($source,$dest); } $link_SQL_insert="INSERT INTO linkdir (lastname,firstname,company,companyurl,description,country,city,repname,fotopath) VALUES ('$last_name','$first_name','$company_name','$company_url','$link_description','$link_country','$link_city','$rep_name','$afbeeldingnaam')"; } Here is the page that is supposed to show the records. //Een verbinding met de database maken include("system/connect.inc.php"); $link_SQL="SELECT * FROM linkdir ORDER BY firstname"; $link_result=mysql_query($link_SQL); //In dit deel worden de gegevens weergegeven while($link=mysql_fetch_array($link_result)){ //afbeelding voorbereiden $img=""; if($link['fotopath']) $img="<img width=150 height=150 src='../banners/" . $link['fotopath'] . "'>"; ?> <table width="410" border="0"> <tr> <td width="100">Last Name: </td>   <td>     <span><?php echo $link['firstname']?></span>   </td> </tr> <tr> <td width="100">First Name: </td>   <td>     <span><?php echo $link['firstname']?></span>   </td> </tr> <tr> <td>Company: </td>   <td>     <span><?php echo $link['company']?></span>   </td> </tr> <tr> <td>Company URL: </td>   <td>     <span><?php echo $link['companyurl']?></span>   </td> </tr> <tr> <td>Description: </td>   <td>     <span><?php echo $link['description']?></span>   </td> </tr> <tr> <td>Country: </td>   <td>     <span><?php echo $link['country']?></span>   </td> </tr> <tr> <td>City/State: </td>   <td>     <span><?php echo $link['city']?></span>   </td> </tr> <tr> <td>Rep. Name: </td>   <td>     <span><?php echo $link['repname']?></span>   </td> </tr>       </table>     <td width="200">          <span><?php echo $img?></span>   </td> </table> <p><p></p></p> <?php } mysql_close ?> Help me please, This is supposed to be simple... :-(
  14. [!--quoteo(post=389195:date=Jun 29 2006, 12:45 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 29 2006, 12:45 PM) [snapback]389195[/snapback][/div][div class=\'quotemain\'][!--quotec--] Also how is <?php echo"$id";?> going to work? How is the $id variable going to be set on the other persons site they post it on? [/quote] Sorry... that part is actually not supposed to be in plain text, that is supposed to echo/display the user id in question. Could you please help me with that too?
  15. Hi, I'm trying to display a bit of HTML code on my page so my users can copy this to their websites if they want to. It is supposed to be a direct link to their own userpage on my site. This is what i want to display on my page. In plain text <a href="http://www.mypage.com/index.php?id=<?php echo"$id";?>"<img src="http://www.mypage.com/bnt-logo.png"</a> Every way i've tried it just keeps recognising parts as HTML or PHP. Can someone tell me how to fix this problem?
  16. Thanks alot!!! It works. except for the layout of the table. This changes after the first record. but at least i'm getting all the records that i asked for.
  17. [!--quoteo(post=379033:date=Jun 1 2006, 01:54 PM:name=samshel)--][div class=\'quotetop\']QUOTE(samshel @ Jun 1 2006, 01:54 PM) [snapback]379033[/snapback][/div][div class=\'quotemain\'][!--quotec--] Please post code.... [/quote] Here it the code... $search_SQL="SELECT * FROM huis WHERE naam LIKE '%".$_POST['searchall']."%' ORDER BY naam" or die("kan geen gegevens vinden"); $search_result=mysql_query($search_SQL); $result=mysql_fetch_array($search_result); //afbeelding voorbereiden $img=""; if($result['fotopath']) $img="<img width=150 height=150 src='../afbeeldingen/" . $result['fotopath'] . "'>"; ?> <table width="410" border="0"> <tr> <span><strong><?php echo $result['naam']?></strong></span> <td width="350"> <table width="210" border="0"> <tr> <td width="100">prijs: </td> <td> <span><?php echo $result['prijs']?></span> </td> </tr> <tr> <td>regio: </td> <td> <span><?php echo $result['regio']?></span> </td> </tr> <tr> <td>plaats: </td> <td> <span><?php echo $result['plaats']?></span> </td> </tr> <tr> <td>Opp. huis: </td> <td> <span><?php echo $result['opphuis']?></span> </td> </tr> <tr> <td>Opp. perceel: </td> <td> <span><?php echo $result['oppperceel']?></span> </td> </tr> <tr> <td>inhoud: </td> <td> <span><?php echo $result['inhoud']?></span> </td> </tr> <tr> <td>omschr.: </td> <td> <span><?php echo $result['omschr']?></span> </td> </tr> </table> <td width="200"> <span><?php echo $img?></span> </td> </table> <p><p></p></p> <?php mysql_close ?>
  18. Hi, I have built a search part for my site, but this only returns one record where more than one should appear. Kan anyone tell me what i should do or what part of my script i should look at? greetz, Izzy
  19. Nearly there... just a little more help. Please ? [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]
  20. So far i've got this... i'm still doing somethig wrong but nearly there. keep up the good work... you're really helping me along. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\albinus\search\searchprijsresults.php on line 20 naam: prijs: HERE IS THE FORM <form method="post" action="searchprijsresults.php"> <select name="price_range"> <option value="1"> tot 100.000 </option> <option value="2"> 100.000-200.000 </option> <option value="3"> 200.000-300.000 </option> <option value="4"> 300.000-400.000 </option> <option value="5"> 400.000-500.000 </option> <option value="6"> 500.000-600.000 </option> <option value="7"> 600.000-700.000 </option> <option value="8"> 700.000-800.000 </option> <option value="9"> 800.000-900.000 </option> <option value="10"> 900.000-1.000.000 </option> <option value="11"> 1.000.000 & meer </option> </select> <input type="submit" name="submit"> </form> // THIS IS THE RESULT PAGE <? if ($price_range == 1){ $value1="0"; $value2="100.000"; } if ($price_range == 2){ $value1="100.000"; $value2="200.000"; } if ($price_range == 3){ $value1="200.000"; $value2="300.000"; } if ($price_range == 4){ $value1="300.000"; $value2="400.000"; } if ($price_range == 5){ $value1="400.000"; $value2="500.000"; } if ($price_range == 6){ $value1="500.000"; $value2="600.000"; } if ($price_range == 7){ $value1="600.000"; $value2="700.000"; } if ($price_range == 8){ $value1="700.000"; $value2="800.000"; } if ($price_range == 9){ $value1="800.000"; $value2="900.000"; } if ($price_range == 10){ $value1="900.000"; $value2="1.000.000"; } if ($price_range == 11){ $value1="1.000.000"; $value2="99.000.000"; } $prijs_SQL="SELECT * FROM huis WHERE (prijs BETWEEN value1 AND value2)"; // i've also tried $value1 AND $value2 $prijs_result=mysql_query($prijs_SQL); $result=mysql_fetch_array($prijs_result); ?> <table width="410" border="0"> <tr> <span><strong><?php echo $result['naam']?></strong></span> <td width="350"> <table width="210" border="0"> <tr> <td width="100">prijs: </td> <td> <span><?php echo $result['prijs']?></span> </td> </tr> ...AND SO ON...
  21. [!--quoteo(post=378657:date=May 31 2006, 12:43 PM:name=appeland)--][div class=\'quotetop\']QUOTE(appeland @ May 31 2006, 12:43 PM) [snapback]378657[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hello,here you go[code]SELECT <column_name> FROM <table_name> WHERE (<column_name> BETWEEN value1 AND value2)[/code]Cheers, Andi [/quote] But there is only one value. isn't there? for example the earlioer given example... <form method="post" action="someaction.php"> <select name="price_range"> <option> 0-10 </option> <option> 10-20 </option> <option> 20-30 </option> <option> 30-40 </option> <option> 40-50 </option> <option> 50-60 </option> </select> <input type="submit" name="submit"> Please keep helpin me and we'll get there [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]
  22. [!--quoteo(post=378646:date=May 31 2006, 12:09 PM:name=appeland)--][div class=\'quotetop\']QUOTE(appeland @ May 31 2006, 12:09 PM) [snapback]378646[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hello, are you looking for help with the build of the select list out of the database or the search function ? Regards, Andi [/quote] I'm looking for help in the search function. How would i make the database show the objects that are in the selected price range? I'm not getting it aaarrrrgggg !!! [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]
  23. I'm making a search section for my site. What i would like is a pulldown menu were visitors can selct a price range for their search in the database. I already have a search that works, but now i would like them to be able to search i a price range. The prices for objects are in my database and the pulldown would look like this for example: make a selection... 0 - 10 10 - 20 20 - 30 30 - 40 40 - 50 50 - more how can i write the script to do this. What would be different than a normal search script?
  24. I am building a admin area where information put in to a database kan be viewed but also deleted and edited. Existing of 3 scripts (pages). list.php (where the list of records is shown.) contains queries and functions for new.php and edit.php and to delete records. new.php (the input form for new records) edit.php (this form shows information to edit existing records) all of the funtions POST and GET a id from the database to the other script or funtion so that function knows what record to edit, delete, or show. The problem i have is that... after every edited or added or deleted record the function seems to repeat itself when the page is refreshed. what can i do to solve this? I didn't add the code becouse it's 8 pages.
×
×
  • 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.