Jump to content

pantinosm

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Everything posted by pantinosm

  1. Hi everyone. Well, i need help how to check a file line by line, (each line contains 1 ip address) and compare it with a variable. I have written some code but it doesn't work. Please help!! $refile=''; while(!feof($file)) { $refile=fgets($file); if (strcmp($refile,"YES") == 0) echo $refile ."OK". "<br />"; else echo $refile . "NO OK ". "<br />"; } fclose($file); ?>
  2. It reads it correctly but when it tries to compare with if (fgets($file)== $_SERVER['REMOTE_ADDR']), it seems like it doesn't work. Please, any suggestions?
  3. Hi to everyone. So, I have a little php code that reads line by line from a txt file, specifically i have 1 IP address for each line, and compares it with the current user's IP. It's like a little blacklist code. But it doesn't work. Can anyone see what i am doing wrong? $file = fopen("ipblacklist.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached $ipblacklist=''; $refile=''; while(!feof($file)) { if (fgets($file)== $_SERVER['REMOTE_ADDR']) $ipblacklist='error'; $refile=fgets($file); } fclose($file); Thank you in advance
  4. The funny part is that if i change the url as the function you gave me exists, to the second page i get the correct session!!!!!!!!!!!!! Now, if i remove your line, i get the "no session" message!!!
  5. Yes, my values are there. And the Post_(deposit) value is correct. But why it does not get transfered to the second page??????
  6. Well i think this is the problem. I have 3 radio buttons named deposit that each one has a diferent value. But this value is not inserted in the session. Thats why i dont get pass to the 2nd page.
  7. First page <?php session_start();require_once('Connections/pefkos.php');?> <?php $_SESSION['amount'] = $_POST['deposit']; function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO clients (Name, LastName, title, Address, country, town, email, telephone) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['lastname'], "text"), GetSQLValueString($_POST['title'], "text"), GetSQLValueString($_POST['address'], "text"), GetSQLValueString($_POST['ddlcountry'], "text"), GetSQLValueString($_POST['town'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['telephone'], "text")); mysql_select_db($database_pefkos, $pefkos); $Result1 = mysql_query($insertSQL, $pefkos) or die(mysql_error()); if ($_SESSION['amount']< 1) {echo "<script language=javascript>alert('The Dates you have Chosen are Wrong. Please Choose Again.')</script>";} else { $insertGoTo ="checkout.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; $_SESSION['days']= 20; } } header(sprintf("Location: %s", $insertGoTo)); } ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>rates.gif</title> <style type="text/css"> td img {display: block;}.style2 {font-family: "Book Antiqua"} </style> <!--Fireworks 8 Dreamweaver 8 target. Created Sun May 21 15:51:23 GMT+0200 (GTB Standard Time) 2006--> <script language="JavaScript1.2" type="text/javascript"> <!-- function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } //--> </script> </head> <body bgcolor="#ffffff" onLoad="MM_preloadImages('rates_r4_c2_f2.gif','rates_r6_c2_f2.gif','rates_r8_c2_f2.gif','rates_r10_c2_f2.gif','rates_r11_c7_f2.gif','rates_r13_c2_f2.gif','rates_r15_c2_f2.gif','rates_r17_c2_f2.gif','rates_r19_c2_f2.gif','rates_r23_c2_f2.gif','rates_r27_c9_f2.gif');"><form method="POST" action="<?php echo $editFormAction; ?>" name="form1"> <table border="0" cellpadding="0" cellspacing="0" width="1000"> <!-- fwtable fwsrc="rates.png" fwbase="rates.gif" fwstyle="Dreamweaver" fwdocid = "1822307916" fwnested="0" --> <tr> <td><img src="spacer.gif" width="28" height="1" border="0" alt="" /></td> <td><img src="spacer.gif" width="66" height="1" border="0" alt="" /></td> <td><img src="spacer.gif" width="50" height="1" border="0" alt="" /></td> <td><img src="spacer.gif" width="74" height="1" border="0" alt="" /></td> <td><img src="spacer.gif" width="41" height="1" border="0" alt="" /></td> <td><img src="spacer.gif" width="203" height="1" border="0" alt="" /></td> <td><img src="spacer.gif" width="66" height="1" border="0" alt="" /></td> <td><img src="spacer.gif" width="5" height="1" border="0" alt="" /></td> <td><img src="spacer.gif" width="182" height="1" border="0" alt="" /></td> <td><img src="spacer.gif" width="64" height="1" border="0" alt="" /></td> <td><img src="spacer.gif" width="221" height="1" border="0" alt="" /></td> <td><img src="spacer.gif" width="1" height="1" border="0" alt="" /></td> </tr> <tr> <td colspan="11"><img name="rates_r1_c1" src="rates_r1_c1.gif" width="1000" height="23" border="0" id="rates_r1_c1" alt="" /></td> <td><img src="spacer.gif" width="1" height="23" border="0" alt="" /></td> </tr> <tr> <td rowspan="2" colspan="4"><img name="rates_r2_c1" src="rates_r2_c1.gif" width="218" height="139" border="0" id="rates_r2_c1" alt="" /></td> <td colspan="6"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="561" height="114"> <param name="movie" value="Flash/PefkosBannerMovie1.swf" /> <param name="quality" value="high" /> <embed src="Flash/PefkosBannerMovie1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="561" height="114"></embed> </object></td> <td rowspan="28"><img name="rates_r2_c11" src="rates_r2_c11.gif" width="221" height="745" border="0" id="rates_r2_c11" alt="" /></td> <td><img src="spacer.gif" width="1" height="114" border="0" alt="" /></td> </tr> <tr> <td rowspan="8" colspan="6"><img name="rates_r3_c5" src="rates_r3_c5.gif" width="561" height="85" border="0" id="rates_r3_c5" alt="" /></td> <td><img src="spacer.gif" width="1" height="25" border="0" alt="" /></td> </tr> <tr> <td rowspan="26"><img name="rates_r4_c1" src="rates_r4_c1.gif" width="28" height="606" border="0" id="rates_r4_c1" alt="" /></td> <td colspan="3"><a href="http://www.pefkoshotel.com" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('rates_r4_c2','','rates_r4_c2_f2.gif',1);"><img name="rates_r4_c2" src="rates_r4_c2.gif" width="190" height="16" border="0" id="rates_r4_c2" alt="" /></a></td> <td><img src="spacer.gif" width="1" height="16" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><img name="rates_r5_c2" src="rates_r5_c2.gif" width="190" height="2" border="0" id="rates_r5_c2" alt="" /></td> <td><img src="spacer.gif" width="1" height="2" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><a href="http://www.pefkoshotel.com/rooms/guestrooms.htm" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('rates_r6_c2','','rates_r6_c2_f2.gif',1);"><img name="rates_r6_c2" src="rates_r6_c2.gif" width="190" height="16" border="0" id="rates_r6_c2" alt="" /></a></td> <td><img src="spacer.gif" width="1" height="16" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><img name="rates_r7_c2" src="rates_r7_c2.gif" width="190" height="2" border="0" id="rates_r7_c2" alt="" /></td> <td><img src="spacer.gif" width="1" height="2" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><a href="http://www.pefkoshotel.com/facilities/facilities.htm" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('rates_r8_c2','','rates_r8_c2_f2.gif',1);"><img name="rates_r8_c2" src="rates_r8_c2.gif" width="190" height="16" border="0" id="rates_r8_c2" alt="" /></a></td> <td><img src="spacer.gif" width="1" height="16" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><img name="rates_r9_c2" src="rates_r9_c2.gif" width="190" height="2" border="0" id="rates_r9_c2" alt="" /></td> <td><img src="spacer.gif" width="1" height="2" border="0" alt="" /></td> </tr> <tr> <td rowspan="2" colspan="3"><a href="http://www.pefkoshotel.com/rates/rates.htm" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('rates_r10_c2','','rates_r10_c2_f2.gif',1);"><img name="rates_r10_c2" src="rates_r10_c2.gif" width="190" height="16" border="0" id="rates_r10_c2" alt="" /></a></td> <td><img src="spacer.gif" width="1" height="6" border="0" alt="" /></td> </tr> <tr> <td rowspan="11" colspan="2"><img name="rates_r11_c5" src="rates_r11_c5.gif" width="244" height="100" border="0" id="rates_r11_c5" alt="" /></td> <td rowspan="10"><a href="http://www.pefkoshotel.com/rates/prices.htm" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('rates_r11_c7','','rates_r11_c7_f2.gif',1);"><img name="rates_r11_c7" src="rates_r11_c7.gif" width="66" height="85" border="0" id="rates_r11_c7" alt="" /></a></td> <td rowspan="11" colspan="3"><img name="rates_r11_c8" src="rates_r11_c8.gif" width="251" height="100" border="0" id="rates_r11_c8" alt="" /></td> <td><img src="spacer.gif" width="1" height="10" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><img name="rates_r12_c2" src="rates_r12_c2.gif" width="190" height="2" border="0" id="rates_r12_c2" alt="" /></td> <td><img src="spacer.gif" width="1" height="2" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><a href="http://www.pefkoshotel.com/special/specialoffers.htm" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('rates_r13_c2','','rates_r13_c2_f2.gif',1);"><img name="rates_r13_c2" src="rates_r13_c2.gif" width="190" height="16" border="0" id="rates_r13_c2" alt="" /></a></td> <td><img src="spacer.gif" width="1" height="16" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><img name="rates_r14_c2" src="rates_r14_c2.gif" width="190" height="2" border="0" id="rates_r14_c2" alt="" /></td> <td><img src="spacer.gif" width="1" height="2" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><a href="http://www.pefkoshotel.com/contact/contact.htm" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('rates_r15_c2','','rates_r15_c2_f2.gif',1);"><img name="rates_r15_c2" src="rates_r15_c2.gif" width="190" height="16" border="0" id="rates_r15_c2" alt="" /></a></td> <td><img src="spacer.gif" width="1" height="16" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><img name="rates_r16_c2" src="rates_r16_c2.gif" width="190" height="2" border="0" id="rates_r16_c2" alt="" /></td> <td><img src="spacer.gif" width="1" height="2" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><a href="http://pefkoshote.coml/links/links.htm" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('rates_r17_c2','','rates_r17_c2_f2.gif',1);"><img name="rates_r17_c2" src="rates_r17_c2.gif" width="190" height="16" border="0" id="rates_r17_c2" alt="" /></a></td> <td><img src="spacer.gif" width="1" height="16" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><img name="rates_r18_c2" src="rates_r18_c2.gif" width="190" height="2" border="0" id="rates_r18_c2" alt="" /></td> <td><img src="spacer.gif" width="1" height="2" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><a href="javascript:;" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('rates_r19_c2','','rates_r19_c2_f2.gif',1);"><img name="rates_r19_c2" src="rates_r19_c2.gif" width="190" height="16" border="0" id="rates_r19_c2" alt="" /></a></td> <td><img src="spacer.gif" width="1" height="16" border="0" alt="" /></td> </tr> <tr> <td rowspan="3" colspan="3"><img name="rates_r20_c2" src="rates_r20_c2.gif" width="190" height="23" border="0" id="rates_r20_c2" alt="" /></td> <td><img src="spacer.gif" width="1" height="3" border="0" alt="" /></td> </tr> <tr> <td><img name="rates_r21_c7" src="rates_r21_c7.gif" width="66" height="15" border="0" id="rates_r21_c7" alt="" /></td> <td><img src="spacer.gif" width="1" height="15" border="0" alt="" /></td> </tr> <tr> <td rowspan="8"><img name="rates_r22_c5" src="rates_r22_c5.gif" width="41" height="446" border="0" id="rates_r22_c5" alt="" /></td> <td colspan="4" rowspan="4" bgcolor="#C8B4B3"><table width="386" border="0" align="center"> <tbody> <tr> <th scope="row" width="70"><div align="left">Title</div></th> <td width="306"><select name="title" id="title"> <option value="Mr">Mr</option> <option value="Mrs">Mrs</option> <option value="Ms">Ms</option> </select></td> </tr> <tr> <th scope="row"><div align="left">Name</div></th> <td><input name="name" id="name" type="text" /></td> </tr> <tr> <th scope="row"><div align="left">Surname</div></th> <td><input name="lastname" id="lastname" type="text" /></td> </tr> <tr> <th scope="row"><div align="left">Address</div></th> <td><textarea name="address" id="address"></textarea></td> </tr> <tr> <th scope="row"><div align="left">Telephone</div></th> <td><input name="telephone" id="telephone" type="text" /></td> </tr> <tr> <th scope="row"><div align="left">Country</div></th> <td><select name="ddlcountry" id="ddlcountry"> <option selected="selected" value=""> (Select a Country)</option> <option value="USA"> United States of America</option> <option value="CAN"> Canada</option> <option value="DEU"> Germany</option> <option value="FRA"> France</option> <option value="GBR"> United Kingdom</option> <option value="IND"> India</option> <option value=""> --------</option> <option value="AFG"> Afghanistan</option> <option value="ALB"> Albania</option> <option value="DZA"> Algeria</option> <option value="ASM"> American Samoa</option> <option value="AND"> Andorra</option> <option value="AGO"> Angola</option> <option value="AIA"> Anguilla</option> <option value="ATA"> Antarctica</option> <option value="ATG"> Antigua and Barbuda</option> <option value="ARG"> Argentina</option> <option value="ARM"> Armenia</option> <option value="ABW"> Aruba</option> <option value="AUS"> Australia</option> <option value="AUT"> Austria</option> <option value="AZE"> Azerbaijan</option> <option value="BHS"> Bahamas</option> <option value="BHR"> Bahrain</option> <option value="BGD"> Bangladesh</option> <option value="BRB"> Barbados</option> <option value="BLR"> Belarus</option> <option value="BEL"> Belgium</option> <option value="BLZ"> Belize</option> <option value="BEN"> Benin</option> <option value="BMU"> Bermuda</option> <option value="BTN"> Bhutan</option> <option value="BOL"> Bolivia</option> <option value="BIH"> Bosnia and Herzegowina</option> <option value="BWA"> Botswana</option> <option value="BVT"> Bouvet Island</option> <option value="BRA"> Brazil</option> <option value="IOT"> British Indian Ocean Territory</option> <option value="BRN"> Brunei Darussalam</option> <option value="BGR"> Bulgaria</option> <option value="BFA"> Burkina Faso</option> <option value="BDI"> Burundi</option> <option value="KHM"> Cambodia</option> <option value="CMR"> Cameroon</option> <option value="CPV"> Cape Verde</option> <option value="CYM"> Cayman Islands</option> <option value="CAF"> Central African Republic</option> <option value="TCD"> Chad</option> <option value="CHL"> Chile</option> <option value="CHN"> China</option> <option value="CXR"> Christmas Island</option> <option value="CCK"> Cocoa (Keeling) Islands</option> <option value="COL"> Colombia</option> <option value="COM"> Comoros</option> <option value="COG"> Congo</option> <option value="COK"> Cook Islands</option> <option value="CRI"> Costa Rica</option> <option value="CIV"> Cote Divoire</option> <option value="HRV"> Croatia (local name: Hrvatska)</option> <option value="CUB"> Cuba</option> <option value="CYP"> Cyprus</option> <option value="CZE"> Czech Republic</option> <option value="DNK"> Denmark</option> <option value="DJI"> Djibouti</option> <option value="DMA"> Dominica</option> <option value="DOM"> Dominican Republic</option> <option value="TMP"> East Timor</option> <option value="ECU"> Ecuador</option> <option value="EGY"> Egypt</option> <option value="SLV"> El Salvador</option> <option value="GNQ"> Equatorial Guinea</option> <option value="ERI"> Eritrea</option> <option value="EST"> Estonia</option> <option value="ETH"> Ethiopia</option> <option value="FLK"> Falkland Islands (Malvinas)</option> <option value="FRO"> Faroe Islands</option> <option value="FJI"> Fiji</option> <option value="FIN"> Finland</option> <option value="FXX"> France, Metropolitan</option> <option value="GUF"> French Guiana</option> <option value="PYF"> French Polynesia</option> <option value="ATF"> French Southern Territories</option> <option value="GAB"> Gabon</option> <option value="GMB"> Gambia</option> <option value="GEO"> Georgia</option> <option value="GHA"> Ghana</option> <option value="GIB"> Gibraltar</option> <option value="GRC"> Greece</option> <option value="GRL"> Greenland</option> <option value="GRD"> Grenada</option> <option value="GLP"> Guadeloupe</option> <option value="GUM"> Guam</option> <option value="GTM"> Guatemala</option> <option value="GIN"> Guinea</option> <option value="GNB"> Guinea-Bissau</option> <option value="GUY"> Guyana</option> <option value="HTI"> Haiti</option> <option value="HMD"> Heard and Mc Donald Islands</option> <option value="HND"> Honduras</option> <option value="HKG"> Hong Kong</option> <option value="HUN"> Hungary</option> <option value="ISL"> Iceland</option> <option value="IDN"> Indonesia</option> <option value="IRN"> Iran (Islamic Republic of)</option> <option value="IRQ"> Iraq</option> <option value="IRL"> Ireland</option> <option value="ISR"> Israel</option> <option value="ITA"> Italy</option> <option value="JAM"> Jamaica</option> <option value="JPN"> Japan</option> <option value="JOR"> Jordan</option> <option value="KAZ"> Kazakhstan</option> <option value="KEN"> Kenya</option> <option value="KIR"> Kiribati</option> <option value="PRK"> Korea, Democratic Peoples Republic of</option> <option value="KOR"> Korea, Republic of</option> <option value="KWT"> Kuwait</option> <option value="KGZ"> Kyrgyzstan</option> <option value="LAO"> Lao Peoples Democratic Republic</option> <option value="LVA"> Latvia</option> <option value="LBN"> Lebanon</option> <option value="LSO"> Lesotho</option> <option value="LBR"> Liberia</option> <option value="LBY"> Libyan Arab Jamahiriya</option> <option value="LIE"> Liechtenstein</option> <option value="LTU"> Lithuania</option> <option value="LUX"> Luxembourg</option> <option value="MAC"> Macau</option> <option value="MKD"> Macedonia, The Former Yugoslav Republic of</option> <option value="MDG"> Madagascar</option> <option value="MWI"> Malawi</option> <option value="MYS"> Malaysia</option> <option value="MDV"> Maldives</option> <option value="MLI"> Mali</option> <option value="MLT"> Malta</option> <option value="MHL"> Marshall Islands</option> <option value="MTQ"> Martinique</option> <option value="MRT"> Mauritania</option> <option value="MVS"> Mauritius</option> <option value="MYT"> Mayotte</option> <option value="MEX"> Mexico</option> <option value="FSM"> Micronesia, Federated States of</option> <option value="MDA"> Moldova, Republic of</option> <option value="MCO"> Monaco</option> <option value="MNG"> Mongolia</option> <option value="MSR"> Montserrat</option> <option value="MAR"> Morocco</option> <option value="MOZ"> Mozambique</option> <option value="MMR"> Myanmar</option> <option value="NAM"> Namibia</option> <option value="NRU"> Nauru</option> <option value="NPL"> Nepal</option> <option value="NLD"> Netherlands</option> <option value="ANT"> Netherlands Antilles</option> <option value="NCL"> New Caledonia</option> <option value="NZL"> New Zealand</option> <option value="NIC"> Nicaragua</option> <option value="NER"> Niger</option> <option value="NGA"> Nigeria</option> <option value="NIU"> Niue</option> <option value="NFK"> Norfolk Island</option> <option value="MNP"> Northern Mariana Islands</option> <option value="MOR"> Norway</option> <option value="OMN"> Oman</option> <option value="PAK"> Pakistan</option> <option value="PLW"> Palau</option> <option value="PAN"> Panama</option> <option value="PNG"> Papua New Guinea</option> <option value="PRY"> Paraguay</option> <option value="PER"> Peru</option> <option value="PHL"> Philippines</option> <option value="PCN"> Pitcairn</option> <option value="POL"> Poland</option> <option value="PRT"> Portugal</option> <option value="PRI"> Puerto Rico</option> <option value="QAT"> Qatar</option> <option value="REU"> Reunion</option> <option value="ROM"> Romania</option> <option value="RUS"> Russian Federation</option> <option value="RWA"> Rwanda</option> <option value="KNA"> Saint Kitts and Nevis</option> <option value="LCA"> Saint Lucia</option> <option value="VCT"> Saint Vincent and the Grenadines</option> <option value="WSM"> Samoa</option> <option value="SMR"> San Marino</option> <option value="STP"> Sao Tome and Principe</option> <option value="SAU"> Saudi Arabia</option> <option value="SEN"> Senegal</option> <option value="SYC"> Seychelles</option> <option value="SLE"> Sierra Leone</option> <option value="SGP"> Singapore</option> <option value="SVK"> Slovakia (Slovak Republic)</option> <option value="SVN"> Slovenia</option> <option value="SLB"> Solomon Islands</option> <option value="SOM"> Somalia</option> <option value="ZAF"> South Africa</option> <option value="SGS"> South Georgia and the South Sandwich Islands</option> <option value="ESP"> Spain</option> <option value="LKA"> Sri Lanka</option> <option value="SHN"> St. Helena</option> <option value="SPM"> St. Pierre and Miquelon</option> <option value="SDN"> Sudan</option> <option value="SUR"> Suriname</option> <option value="SJM"> Svalbard and Jan Mayen Islands</option> <option value="SWZ"> Swaziland</option> <option value="SWE"> Sweden</option> <option value="CHE"> Switzerland</option> <option value="SYR"> Syrian Arab Republic</option> <option value="TWN"> Taiwan</option> <option value="TJK"> Tajikistan</option> <option value="TZA"> Tanzania, United Republic of</option> <option value="THA"> Thailand</option> <option value="TGO"> Togo</option> <option value="TKL"> Tokelau</option> <option value="TON"> Tonga</option> <option value="TTO"> Trinidad and Tobago</option> <option value="TUN"> Tunisia</option> <option value="TUR"> Turkey</option> <option value="TKM"> Turkmenistan</option> <option value="TCA"> Turks and Caicos Islands</option> <option value="TUV"> Tuvalu</option> <option value="UGA"> Uganda</option> <option value="UKR"> Ukraine</option> <option value="ARE"> United Arab Emirates</option> <option value="UMI"> United States Minor Outlying Islands</option> <option value="URY"> Uruguay</option> <option value="UZB"> Uzbekistan</option> <option value="VUT"> Vanuatu</option> <option value="VAT"> Vatican City State (Holy See)</option> <option value="VEN"> Venezuela</option> <option value="VNM"> Viet Nam</option> <option value="VGB"> Virgin Islands (British)</option> <option value="VIR"> Virgin Islands (U.S.)</option> <option value="WLF"> Wallisw and Futuna Islands</option> <option value="ESH"> Western Sahara</option> <option value="YEM"> Yeman</option> <option value="YUG"> Yugoslavia</option> <option value="ZAR"> Zaire</option> <option value="ZMB"> Zambia</option> <option value="ZWE"> Zimbabwe</option> <option value="UNK"> Not Listed___________________________ </option> </select></td> </tr> <tr> <th scope="row"><div align="left">Town</div></th> <td><input name="town" id="town" type="text" /></td> </tr> <tr> <th scope="row"><div align="left">Email</div></th> <td><input name="email" type="text" id="email" value="" /></td> </tr> <tr> <th colspan="2" scope="row"><div align="left"><span class="style2">Deposit required through our Verification System </span></div></th> </tr> <tr> <th colspan="2" bgcolor="#D6B6AD" scope="row"><p align="left"> <label> <input type="radio" name="deposit" value="20" /> Up to 3 days stay - 20 CYP</label> <br /> <label> <input type="radio" name="deposit" value="50" /> From 4 to 6 nights stay - 50 CYP</label> <br /> <label> <input type="radio" name="deposit" value="100" /> From 7 nights and up - 100 CYP</label> <br /> </p></th> </tr> <tr> <th bgcolor="#D6BDB5" scope="row"> </th> <td bgcolor="#D6BDB5"><input name="Save Details" id="Save Details" value="Submit" type="submit" /></td> </tr> </tbody> </table></td> <td rowspan="5"><img name="rates_r22_c10" src="rates_r22_c10.gif" width="64" height="415" border="0" id="rates_r22_c10" alt="" /></td> <td><img src="spacer.gif" width="1" height="5" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><a href="http://www.pefkoshotel.com/photogallery/photogallery.htm" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('rates_r23_c2','','rates_r23_c2_f2.gif',1);"><img name="rates_r23_c2" src="rates_r23_c2.gif" width="190" height="18" border="0" id="rates_r23_c2" alt="" /></a></td> <td><img src="spacer.gif" width="1" height="18" border="0" alt="" /></td> </tr> <tr> <td colspan="3"><img name="rates_r24_c2" src="rates_r24_c2.gif" width="190" height="347" border="0" id="rates_r24_c2" alt="" /></td> <td><img src="spacer.gif" width="1" height="347" border="0" alt="" /></td> </tr> <tr> <td rowspan="5"><img name="rates_r25_c2" src="rates_r25_c2.gif" width="66" height="76" border="0" id="rates_r25_c2" alt="" /></td> <td rowspan="3"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="50" height="50"> <param name="movie" value="Flash/pefkosmusic.swf" /> <param name="quality" value="high" /> <embed src="Flash/pefkosmusic.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="50" height="50"></embed> </object></td> <td rowspan="5"><img name="rates_r25_c4" src="rates_r25_c4.gif" width="74" height="76" border="0" id="rates_r25_c4" alt="" /></td> <td><img src="spacer.gif" width="1" height="39" border="0" alt="" /></td> </tr> <tr> <td colspan="4"><img name="rates_r26_c6" src="rates_r26_c6.gif" width="456" height="6" border="0" id="rates_r26_c6" alt="" /></td> <td><img src="spacer.gif" width="1" height="6" border="0" alt="" /></td> </tr> <tr> <td rowspan="3" colspan="3"><img name="rates_r27_c6" src="rates_r27_c6.gif" width="274" height="31" border="0" id="rates_r27_c6" alt="" /></td> <td rowspan="2" colspan="2"><a href="http://www.amitydata.com" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('rates_r27_c9','','rates_r27_c9_f2.gif',1);"><img name="rates_r27_c9" src="rates_r27_c9.gif" width="246" height="8" border="0" id="rates_r27_c9" alt="" /></a></td> <td><img src="spacer.gif" width="1" height="5" border="0" alt="" /></td> </tr> <tr> <td rowspan="2"><img name="rates_r28_c3" src="rates_r28_c3.gif" width="50" height="26" border="0" id="rates_r28_c3" alt="" /></td> <td><img src="spacer.gif" width="1" height="3" border="0" alt="" /></td> </tr> <tr> <td colspan="2"><img name="rates_r29_c9" src="rates_r29_c9.gif" width="246" height="23" border="0" id="rates_r29_c9" alt="" /></td> <td><img src="spacer.gif" width="1" height="23" border="0" alt="" /></td> </tr> </table><input type="hidden" name="MM_insert" value="form1"> </form> </body> </html> and second <?php session_start(); function show_session($endnow = false) { $content = 'Showing SESSION vars for SID: ' . session_id() . '<br><br><pre>'; $content .= print_r($_SESSION); $content .= '</pre><br>'; if ( $endnow ) { die("$content"); } return $content; } ?> <p><?php if (session_is_registered('amount')) echo "The session is " . $_SESSION['amount']; else echo "No session"; echo show_session(); // will dump all session vars (including the Session ID), and continue with the rest of your script. echo show_session(true); // will dump all session vars (including the Session ID), and immediately end your script. ?></p> This making me crazy. I would like to thank you in advance for any help given so far.
  8. Ok, still get Array ( [amount] => ) Showing SESSION vars for SID: 8e438a187fb4889daf447df5b6f9965e 1
  9. The session IDs are the same. I get Showing SESSION vars for SID: 4b7908ccf4f48ce639a74ac0f683481b Array ( [amount] => ) It means that the value does not pass through?
  10. Ok. I get Array ( [amount] => ) Showing SESSION vars for SID: 4b7908ccf4f48ce639a74ac0f683481b 1 What is 1 stand for? I am sorry for my stupid questions but i am new in php.
  11. I changed my second page to <?php session_start(); function show_session($endnow = false) { $content = 'Showing SESSION vars for SID: ' . session_id() . '<br><br><pre>'; $content .= print_r($_SESSION); $content .= echo '</pre><br>'; if ( $endnow ) { die("$content"); } return $content; } ?> <p><?php if (session_is_registered('amount')) echo "The session is " . $_SESSION['amount']; else echo "No session"; echo show_session(); // will dump all session vars (including the Session ID), and continue with the rest of your script. echo show_session(true); // will dump all session vars (including the Session ID), and immediately end your script. ?></p> And now i get an PHP Parse error: parse error, unexpected T_ECHO in line 6.
  12. I have a php page where i have a session var that i transfer to another page. Whatever i do the value isn't transfered. I have session start to both pages. Below is the code of both pages. //1st page <?php session_start();require_once('Connections/pefkos.php');?> <?php $_SESSION['amount'] = $_POST['deposit']; session_register('amount'); function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO clients (Name, LastName, title, Address, country, town, email, telephone) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['lastname'], "text"), GetSQLValueString($_POST['title'], "text"), GetSQLValueString($_POST['address'], "text"), GetSQLValueString($_POST['ddlcountry'], "text"), GetSQLValueString($_POST['town'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['telephone'], "text")); mysql_select_db($database_pefkos, $pefkos); $Result1 = mysql_query($insertSQL, $pefkos) or die(mysql_error()); if ($_SESSION['amount']< 1) {echo "<script language=javascript>alert('The Dates you have Chosen are Wrong. Please Choose Again.')</script>";} else { $insertGoTo ="checkout.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; $_SESSION['days']= 20; } } header(sprintf("Location: %s", $insertGoTo)); } ?> and second page <?php session_start(); ?> <p><?php if (session_is_registered('amount')) echo "The session is " . $_SESSION['amount']; else echo "No session"; ?></p> Any help will be greatly appreciated.
  13. I use this script here which someone gave to me. <?php function highlight($str) { $tmp = ''; foreach(explode(' ', $str) as $word) $tmp .= "<span style=\"background-color:pink\">$word</span> "; return trim($tmp); } ?> This function runs when i call echo preg_replace("/$searchterm/ise", 'highlight("\\0")', $result); The problem is that not all keywords are highlighted. It leaves many words back. Sometimes ithighlights, sometimes no. Why is this happenning?
  14. Hello everybody. So i have a textbox like google. I want to highlight all the text in my result records that contain ALL the words or ANY of the words in the textbox. Is there a coding i can use? Any help greatly appreciated.
  15. The problem is that i get the highlighted resultls in 70% right. Some keywords are not highlighted all the time. I can see the same keyword somewhere highlighted and somewhere not. Is this a bug or something?
  16. Thank you that worked. The only thing now is that i want to make it case in-sensitive. Is there any way of doing that?
  17. The code is [code] <?php function highlight($str) { $tmp = ''; foreach(explode(' ', $str) as $word) $tmp .= "<span style=\"background-color:pink\">$word</span> "; return trim($tmp); } ?> <?php $result = $row_rsfindwebsitesearch['Description']; $searchterm = $_GET['txtsearch']; echo preg_replace("/$searchterm/is", 'highlight("\\0")',  $result);   ?> [/code] What am i doing wrong?
  18. Hi all, i am developing a search engine and by using this code [code]SELECT *,MATCH(URL,Title,Keywords,Description) AGAINST ('" . stripslashes (str_replace ("&quot;", "\"", ($colname_rsfindwebsitesearch))) . "') FROM tblLinks WHERE MATCH(URL,Title,Keywords,Description) AGAINST ('" . stripslashes (str_replace ("&quot;", "\"", ($colname_rsfindwebsitesearch))) . "' IN BOOLEAN MODE) ORDER BY URL"[/code] i try to get the resulting pages in a table. The problem is that i want the first results to be the ones that contain all the keywords (in the above code the $colname_rsfindwebsitesearch), and then the individual keywords. Now if i try to do a search like thewriters-club.com instead of getting the url thewriters-club.com first, i get it somewhere in the middle. Any ideas?
  19. Because now the keywords in the result instead of highlight they get replaced with "highlight ("keywords")" string!!!!
  20. Yes but why you call the highlight function with highlight("\\0")? Where do you send the string?
  21. Exactly, i am trying to develop a seach engine, and when i click to redirect to a page, it goes to the page like www.cnn.com. I just want to add a vote to a counter in my db.
×
×
  • 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.