Readme
Members-
Posts
33 -
Joined
-
Last visited
Everything posted by Readme
-
This is not possible?
-
It come "crossword database". If you can, please help.
-
How to make this: RED BOX IF I Search "Mobile" and choose 2 letters. Then result is Mobile LG IF 5 letters then Nokia Must use LEN or something? <?php mysql_connect("localhost", "", "") or die("Error connecting to database: ".mysql_error()); mysql_select_db("data") or die(mysql_error()); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Search results</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <div class="container"> <form action="search.php" method="GET"> Search: <input type="text" name="query" /> <input type="submit" value="Search" /> </form> <div> <label>Search categories</label> <select> <option value="1">Search all</option> <option value="2">2 letters</option> <option value="4">3 letters</option> <option value="5">4 letters</option> <option value="6">5 letters</option> <option value="7">6 letters</option> </select> </div> <?php $query = $_GET['query']; $min_length = 2; if(strlen($query) >= $min_length){ $query = htmlspecialchars($query); $query = mysql_real_escape_string($query); $raw_results = mysql_query("SELECT * FROM articles WHERE (`title` LIKE '%".$query."%') OR (`text` LIKE '%".$query."%')") or die(mysql_error()); if(mysql_num_rows($raw_results) > 0){ while($results = mysql_fetch_array($raw_results)){ echo "<p><h3>".$results['title']."</h3>".$results['text']."</p>"; } } else{ echo "No results"; } } else{ echo "Minimum length is ".$min_length; } ?> </div> </body> </html>
-
I asking PHP code. Look @ demo
-
Hi! Who are the good people who make me a simple code?
-
Not work or I make something wrong One checkbox coming up...
-
This functions used select data but I want use <input type="checkbox"/> Please help to modify. //----------get country via select option---------- function get_country() { $sql = "SELECT id,country FROM countries ORDER BY id ASC"; $res = mysql_query($sql); echo "<select id=\"country\" class=\"searchbox\" name=\"country\">"; echo "<option value=\"\">Select One</option>"; while ($row = mysql_fetch_assoc($res)){ echo "<option value=\"".$row['country']."\">".$row['country']."</option>"; } echo "</select>"; } //----------get countries via select option from users---------- function get_select_countries($id) { $id = secureInput($id); $sql = "SELECT country FROM countries ORDER BY country ASC"; $res = mysql_query($sql); $sql1 = "SELECT country FROM users WHERE id='".$id."'"; $res1 = mysql_query($sql1); $row1 = mysql_fetch_assoc($res1); if($row1){ echo "<select name=\"country\">"; echo "<option selected=".$row1['country']." value=\"".$row1['country']."\">".$row1['country']."</option>"; while ($row = mysql_fetch_assoc($res)){ echo "<option value=\"".$row['country']."\">".$row['country']."</option>"; } echo "</select>"; } else { echo "<select name=\"country\">"; while ($row = mysql_fetch_assoc($res)){ echo "<option value=\"".$row['country']."\">".$row['country']."</option>"; } echo "</select>"; } }
-
Work and thanks. But echo $data[0]."<br />".$data[2]."<br />"; Can make something like: echo ($data,0,2,8,100); ???
-
I need PHP script I have test.txt file and content is: Cat Dog Bird PHP must find line 1 and line 3 and show up in browser. Cat Bird Eng not good but I hope you understand me. Very thanks.
-
No, mraza. Example! textfile.txt - words I coming The file filename does not exist Tired of these ads? Not work but sample $replace = array("I coming","1 2 3"); $replace = array("The file filename does not exist","1 2 3 4"); $replace = array("Tired of these ads?","1 2 3 4 5"); textfile.txt - now looks like this 1 2 3 1 2 3 4 1 2 3 4 5
-
My English is not good but I try to explain. Now i want to use array function... can be used for multiple lines. This: $new_contents = str_replace("My name is", "is name my", $contents); Something like this: $contents= array( array(My name is, is name my), array(Hi,Hello), array(Come back, I coming)); <?php $file = 'textfile.txt'; if (file_exists($file)) { $ff = fopen($file, 'r+'); $contents = file_get_contents($file, FILE_TEXT); $new_contents = str_replace("My name is", "is name my", $contents); file_put_contents($file, $new_contents, FILE_TEXT); fclose($ff); $ff = fopen($file, 'r+'); fwrite($ff, $new_contents); fclose($ff); } else { echo "The file $filename does not exist"; } ?>
-
Takes the data from the file (.txt) and replace it - Saving changes? I searched the forum but did not find Bad code and slow <?php $string = 'My name is'; $patterns = 'My name is'; $replacements = 'is name my'; echo str_replace($patterns, $replacements, $string ); ?>
-
I do not know how to explain - My English is not good Someone who understands, can explain.
-
Pick 5 Wheels 1 Win(s), 3 out of 3, 11 Numbers (21 tickets) 11 Numbers Covered 1 Winning Ticket 3 Win Guarantee 3 Amount of Numbers Correct 21 Tickets It is necessary to the code that generates the numbers? Bad English
-
How do make that?
-
uups No im noobie
-
horrible GO TO GOOGLE Table 'link_counter.link_counter' doesn't exist <?php $dbhost = "localhost"; $dbuser = "root"; $dbpass = ""; $dbname = "link_counter"; //connect $db = mysql_pconnect($dbhost,$dbuser,$dbpass); mysql_select_db("$dbname",$db); $x=$_POST['x']; $x="GO TO GOOGLE"; echo "<a href='http://google.com'>$x</a>"; $sql="UPDATE link_counter set count=count+1 WHERE x='$x'"; $res=mysql_query($sql)or die(mysql_error()); ?>
-
hmm Connected to MySQL GO TO GOOGLENo database selected <?php $username = "xxx"; $password = "xxx"; $hostname = "xxx"; //connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); echo "Connected to MySQL<br>"; $x=$_POST['x']; $x="GO TO GOOGLE"; echo "<a href='http://google.com'>$x</a>"; $sql="UPDATE link_counter set count=count+1 WHERE x='$x'"; $res=mysql_query($sql)or die(mysql_error()); ?> Something wrong
-
Yes, I have DB just write one - low skill I need full code
-
I have a link on my website and would be very interested to find out how many people click that link. Does anyone know any free click counter scripts? Thanks
-
Yes! Thanks man
-
$nums = array(68,41,90,100,32,56) That it takes the first number (68) and creates a combination with other numbers; then further number 41 and creates new combination, etcetera. I would need it this way, that by giving it a number, the system would create a combination with other numbers. My English is not very good
-
rhodesa ?
-
How do! When creating a combination of numbers, the number sequence becomes too long, and to avoid this, you need to bring in an exact number (68). Example: $number = array([68],41,90,100,32,56 [68] is exact number 68 41 90 100 32 56 68 41 90 100 56 56 68 41 90 32 32 56 68 41 90 32 56 56 68 41 90 56 32 56 68 41 90 56 56 56