
ankhmor
Members-
Posts
46 -
Joined
-
Last visited
Never
Everything posted by ankhmor
-
I'm puzzeled as to why this is happening. I have a form with enctype="text/plain". And then I have a php code that takes whatever is in that form and echo s it. Everything works fine as long as the form method is set to get, but once the method is set to post the php script just doesnt seem to recieve the field values. The only solution to that is removing enctype="text/plain". any help?
-
make it go in a loop and then every time a loop completes and some value to the image size the concept $image_size = 10 while{ code $image_size = $image_size + 30 }
-
I have a page of code. I'm using preg_match_all('/(<a href="){1}([a-zA-Z0-9:\/.?=]{1,})(">){1}/' ... to find all the links. However theres a line of code full of links which I actually need that seems to be not recognized by preg_match_all. its starts like this ยป <a href="[link]">[name of the link]</a><br> and just keeps repeating. The problem is I dont get any results the preg_match_all just seems to skip that line without matching it. Anyone has an idea on how to solve this.
-
Hi I'm looking for a class or a program that can be used with php for optical character recognition. Here's an example of what I'm trying to use the optical character recognition for: http://www.zaycev.net/captcha.php?id=d39ea9b37f8accc869a59bcacae620b3 Thanks
-
I wrote a script to log into PHPFreaks. It logs in perfectly fine but the problem is the cookies are not saved. Could you please tell me whats wrong with my script? Thanks. Here's my code: $user_id = "ankhmor"; $pin = "password"; $postfields = "username=$user_id&password=$pin"; $init = curl_init(); $fp = fopen('cookie.txt', 'w'); curl_setopt($init, CURLOPT_HEADER, 1); // Get the header curl_setopt($init, CURLOPT_FOLLOWLOCATION, 1); // Allow redirection curl_setopt($init, CURLOPT_USERAGENT, "$_SERVER[HTTP_USER_AGENT]"); curl_setopt($init, CURLOPT_URL,"http://www.phpfreaks.com/user/login"); curl_setopt($init, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($init, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt($init, CURLOPT_SSL_VERIFYPEER, TRUE); // this line makes it work under https curl_setopt($init, CURLOPT_CRLF, 1); curl_setopt ($init, CURLOPT_RETURNTRANSFER, 1); curl_setopt($init, CURLOPT_POST, 1); curl_setopt($init, CURLOPT_POSTFIELDS, "$postfields"); $log_in = curl_exec($init); echo $log_in; curl_close($init); fclose($fp);
-
I have a login curl script When I try to use it the website tells me You have Per-Session Cookies disabled. However I have this in my code curl_setopt($init, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($init, CURLOPT_COOKIEFILE, "cookie.txt"); Can you tell me what's the problem Thank you.
-
Here's a situation: I need to log in into a site. But instead of a normal submit button they have an image with onclick="document.getElementById('safemls-login').submit(); return false;" When I just type javascript:document.getElementById('safemls-login').submit() into browser address bar i can log in. When i try to use curl_setopt($init, CURLOPT_URL,"javascript:document.getElementById('safemls-login').submit()"); I get a search page displayed. Can someone tell me how to log in into this website Thank you Here's my complete code: $user_id = "pass"; $pin = "pass"; $auth = ""; $user_agent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)"; $postfields = "username=$user_id&pin=$pin&password=$auth"; $init = curl_init(); curl_setopt($init, CURLOPT_HEADER, 1); // Get the header curl_setopt($init, CURLOPT_FOLLOWLOCATION, 1); // Allow redirection curl_setopt($init, CURLOPT_USERAGENT, $user_agent); curl_setopt($init, CURLOPT_URL,"http://www.torontomls.net/Login.asp"); curl_setopt($init, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($init, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt ($init, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($init, CURLOPT_RETURNTRANSFER, 1); curl_setopt($init, CURLOPT_POST, 1); curl_setopt($init, CURLOPT_POSTFIELDS, "$postfields"); curl_setopt($init, CURLOPT_URL,"javascript:document.getElementById('safemls-login').submit()"); ob_start(); // prevent any output $log_in = curl_exec($init); ob_end_clean(); // stop preventing output echo $log_in; curl_close($init);
-
Hi Here's my code: <style> ul{ margin: 0 auto; } ul.horizontal_list li{ margin: 0 auto; text-align: left; float: left; list-style: none; padding: 3px 10px 3px 10px; margin: 5px; border: 1px solid #CCC; } </style> <div style="font-size: medium;border-color: #a7e3ff;border-style: solid;border-width: 1px;"> <ul class="horizontal_list"> <li> hey </li> <li> hey1 </li> <li> hey2 </li> </ul> </div> And here's my problem. The UL doesnt want to go into the DIV. The DIV appears as a thin strip and the UL is outside of it. Here's a screenshot : Could you tell me how to fix this? Thanks.
-
make sure that the file ends with .php if that's the case try what dropfaith suggested. FYI You can try XAMPP. It has apache, php, mysql, and much more. The installation is not hard either.
-
[SOLVED] prevent from REPETITIVE ENTRANCEs in DB
ankhmor replied to msafvati's topic in PHP Coding Help
I can show you how its done in mysql but ur not using mysql are u. -
This works "/(<td colspan=\"2\">)(<font style=\"\">)*/" but it doesnt find the (<font style=\"\">) part And This works "/(<td colspan=\"2\">)(<font style=\"){1}/" but they are not exactly what i'm looking for
-
The way the script should work is (my guess): 1. You get the name and the id from the last (second) table. 2. You search the first (top) table for the id 3. Then get the current time and if its inbetween the lesson time u show that the staff is busy. If this is right and you need coding help then pm me.
-
Well I dont think you can loop all of them but im pretty sure u can at least loop those ones imageline($captcha,rand(0,50),rand(0,100),rand(0,200),rand(0,200),$color); imageline($captcha,rand(0,50),rand(0,100),rand(0,200),rand(0,200),$color); imageline($captcha,rand(0,50),rand(0,100),rand(0,200),rand(0,200),$color); imageline($captcha,rand(0,50),rand(0,100),rand(0,200),rand(0,200),$color); imageline($captcha,rand(0,50),rand(0,100),rand(0,200),rand(0,200),$color);
-
Sorry that doesnt seem to work.
-
Alright, I need to match a string which is: <td colspan="2"><font style="">382 Queen St E </font></td> I'm trying to use preg_match() with the regex below "/(<td colspan=\"2\">){1}(<font style=\"\">){1}/" I get a blank result. I've tested the regex and it seems that everything works fine till i put the second " after style= Thanks.
-
I think that the best way of keeping the trak of all the people who voted is to get their ip and store it because (at least me) people delete their cookies after using the browser. About the code. Not sure what's the problem but maybe you should try doing something like this: echo "<img src='barack.png' width='".$obama_perc."' height='20'><br><br>"; instead of this: echo "<img src='barack.png' width='$obama_perc' height='20'><br><br>";
-
Anyone? Sorry but this is really urgent. ???
-
[SOLVED] Display only single record set title on page
ankhmor replied to yandoo's topic in PHP Coding Help
Hi. Sorry but I think I cant really tell you what is the problem until you post what is $result. Is it an array or a reslut of mysql query? And anyways this should be the template for your thing: <table> <tr><td>PUT HERE YOUR TITLES</td></tr> <? to read an array or whatever $result is you need to create a loop like so: while(){ echo "<tr></td>INFO YOU WANT TO DISPLAY</td></tr> } ?> </table> -
What im trying to do is to get data from a website (it is perfectly legal because it is a special type of website (radion fan one)); And I must do it continiously or every 3 minutes. Because I cant run html in Linux bash i want to put my script in continuous loop.
-
this is the original code: $q="SELECT * FROM dd_rating WHERE ItemID = $ItemID AND username = '$_SESSION[username]"; $r2 = mysql_query($q); if (mysql_num_rows($r2) = 0) { echo '<b><center>You have not yet rated this joke </center></b><br>'; } else { echo '<b><center>You have given this joke a rating of ' . $rate = $row['Rating] . </center></b><br> ?> First mistake: $q="SELECT * FROM dd_rating WHERE ItemID = $ItemID AND username = '$_SESSION[username]"; Should be: $q="SELECT * FROM dd_rating WHERE ItemID = '$ItemID' AND username = '$_SESSION[username]'"; Second: if (mysql_num_rows($r2) = 0) Should be: if (mysql_num_rows($r2) == 0) third: what is $row? I think what you meant was $rate = mysql_result($r2, 0, 'Rating'); I fogot you can use mysql_fetch_row too. (but I never use it and not sure how to excactly)
-
I have a script that works perfectly (I run it in Linux in terminal(bash)); However when it is put in a neverending loop it doesn't work anymore. What it does it works once and then doesnt work properly. I added echo "executing.." so I whould know if the scripts is working. It show excecuting... but the rest of the script doesn't work. Someone help please. Oh and heres the script (without the neverending loop); mysql_connect("localhost", "root", "new-password") or die("Couldnt connect"); mysql_select_db("profiles") or die("Couldnt select"); echo "excecuting ..."; $array = file("http://oh2aq.kolumbus.com/dxs/dx250.html?"); $last = mysql_query("SELECT `id`, `call` FROM `list` ORDER BY id DESC LIMIT 1") or die(mysql_error()."\nline 8"); $a = 1; $count = count($array) - 2; $test = mysql_result($last, 0, 'call'); while($test != $info[0]){ $info = preg_split("/ /", $array[$a], -1, PREG_SPLIT_NO_EMPTY); $a++; } $b = 0; $a = $a - 2; while($a > $b ){ $info_2 = preg_split("/ /", $array[$a], -1, PREG_SPLIT_NO_EMPTY); $comments = explode ("\n", chunk_split($array[$a], 30, "\n")); $comment = str_replace("'", '"', $comments[1]); echo $info_2[0]."|--|".$info_2[1]."|--|".$info_2[2]."|--|".$comment."|--|".$a."\n"; mysql_query("INSERT INTO `list` (`call`, `frequency`, `other_call`, `comments`) VALUES ('$info_2[0]', '$info_2[1]', '$info_2[2]', '$comment')") or die(mysql_error()."\nline 25"); $a--; } mysql_close();