adv
-
Posts
179 -
Joined
-
Last visited
Posts posted by adv
-
-
sorry about this . please can u delete it
-
madtechie thanks
-
thanks for your answer but i dont quite undetstand what u mean
When you curl the first page it's likes will have the "11f08c542531d23d" code.
and i wanna find out if theres a way with curl .. not other methods
-
hello is there a way to read emails with curl ?
like in gmail ... inbox or trash
after i log in with curl and then go to lets say:
http://mail.google.com/mail/?shva=1#inbox
is there a way to open each message in inbox
i see that when u read a message it shows like this
http://mail.google.com/mail/?shva=1#inbox/11f08c542531d23d
but how do i do it without knowing /11f08c542531d23d
just to get all messages one by one ...
something like that thanks
-
thanks alot friends its works good
corbin u misspelled
function InValue($array, $valpiece) { foreach($array as $val) { // $val instead of array if(strpos($val, $valpiece) !== false) return true; } return false; } if(InValue($array, '76')) echo 'Found!'; else echo 'Not found .';
anyway thanks alot
edit : ahh just instead of array
-
thanks alot i see know
is there just one thing that i want to know if there`s possible
is there a way to echo just one value if it doesnt find any results... something like this
if($result===false){ echo 'not found'; // loop through all the arrays and if no results in ALL of them just show that echo }
-
ahh i modify it and figure about die;
russel i tried ur way... but it finds both ways
NOT found it
found it
$array=array('first','second','third','3423a','76676'); foreach($array as $arrays){ $result=strpos($arrays,'76'); if($result!==false){ echo 'found it<br />'; die; } else { echo 'NOT found it<br />'; } }
i`ve use it like this
edit : ive tried like that and it shows
i understand why but i dont know how to limit to only the valid one
NOT found it
NOT found it
NOT found it
NOT found it
found it
-
hello i`m trying to loop over and over the arrays
and try to find some words
the thing is it doesnt work .. i wanna find even a piece of it
but its not working and cant understand why.....
$array=array('first','second','third','3423a','3423'); $c=count($array); for($i=0;$i<$c;$i++){ $result=strpos($array[$i],'3423'); if($result!==false){ echo 'found it'; }else{ echo 'NOT found it'; } }
-
wow thanks alot premiso
-
anybody? :|
-
another quick question
in aa.txt i have
spring:notcool summer:cool winter:bad
and the php file:
<?php echo '<pre>'; $aa1=file('aa.txt'); foreach($aa1 as $aaaa){ $expl=explode(chr(58),$aaaa); echo $expl[0].'<br /><br />'; // shows first values /* spring summer winter */ echo $expl[1]; // shows second values /* notcool cool bad */ } echo '</pre>'; ?>
there is not problem with it
my question is.. can it be done with for() ? to be able to access it just the same
and if it can can u please show me an example ... i just want to see how its done
-
thanks alot both
-
thanks Aaron but it get an error here
list($thirdfile ,$fourfile) = explode(':',$lines[$n+1]);
Notice: Undefined offset: 2 in C:\wamp\www\tst\aa.php on line 8
Notice: Undefined offset: 1 in C:\wamp\www\tst\aa.php on line 8
i`ve tried something like this and it works,but is it good?
for($n=0;$n<count($lines);$n=10){ $res=list($a,$b)=explode(':',$lines[$n]); echo '<pre>'; print_r($res); echo '</pre>'; $n++; $res1=list($c,$d)=explode(':',$lines[$n]); echo '<pre>'; print_r($res1); echo '</pre>'; }
this is what is shows
Array
(
[0] => firstfile
[1] => secondfile
)
Array
(
[0] => thirdfile
[1] => fourfile
)
if works just for 2 lines it must work if i have even 10 lines in the aa.txt
-
hello i`m trying to grab 2 kinds of texts from a file
in the file grab.txt i have
firstfile:secondfile
thirdfile:fourfile
each one separated by a new line
and in php i`m trying this
<?php $file=file('aa.txt'); foreach($file as $files){ $split=explode("\n",$files); $split=explode(':',$files); /* echo '<pre>'; print_r($split); echo '</pre>'; */ } ?>
how do i access $split[0] and $split[1] to rise automaticaly?
i mean when i use them
$split[0]=firstfile $split[1]=secondfile
$split[0]=thirdfile $split[1]=fourfile
something like this
:|
-
thanks alot ken i`ve got it :*
-
thanks ken
but how do i invoke it ?
-
thanks
i have another question and i dont think is needed to open a new thread
my question is this
i have email.php
<?php if(isset($_GET['sendEmail'])){ $sendEmail=1; $value1=$_GET['value1']; $value2=$_GET['value2']; $value3=$_GET['value3']; } if($senEmail==1){ mail('email.com','subject','testing'); } ?>
and in another file i have this
<?php $remote_send='http://site.com/email.php?'; $send_mail=1; $value1='firstvalue'; $value2='secondvalue'; $value3='thirdvalue'; if($send_mail==1){ $remote_send.='sendEmail=&value1='.urlencode($value1).'&value2='.urlencode($value2).'&value3='.urlencode($value3); } ?>
but it doesnt send , i dont understand why
if i do this :
http://site.com/email.php?sendEmail=&value1=firstvalue&value2=secondvalue&value3=thirdvalue
if sends the email
-
ken i knew all that
i`ve used file_get_contents intentionally
i just wanted to know how php memorize it all
but the thing is i dont understand how it keeps it .. where it keeps the strings made into variables how does it know..
not to show me i can echo it :|
-
hello i`ve played a little in php and there`s a thing that i don`t understand.
I have a file : test.txt , inside of it i have
&test=testing&value=cool&blabla=ok
and in php
$h=file_get_contents('test.txt'); parse_str($h);
i know that parse_str() makes strings into variables
and u can acces $test as a variable
but the thing is i dont understand how it keeps it .. where it keeps the strings made into variables
how does it know..
kinda weird question :| sorry if i didnt make myself clear ... my english is buggy
-
thanks alot all for ur answers i see now
-
hello i have this function to generate random letters and numbers with any length that u want
<?php function randomPassword($length = { // all the chars we want to use $all = explode( " ", "a b c d e f g h i j k l m n o p q r s t u v w x y z " . "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z " . "0 1 2 3 4 5 6 7 8 9 _"); for($i=0;$i<$length;$i++) { srand((double)microtime()*1000000); $randy = rand(0, 61); $pass .= $all[$randy]; } return $pass; } echo $new_filename = randomPassword(15); ?>
i didnt make this myself i found it from google
but the thing that i dont understand is here
$pass .= $all[$randy];
why does it need to concatentate ??
i tried without the "." but it will show only one random letter or number
how is the concatentate operator makes such a big difference ::|
any oppion is good
thanks
-
hello
i`m having a problem that i just can`t seem to figure it out
its start like this :
i`m trying to get the content of 'file.txt' and what i wanna do is login with curl with the users and passwords from the 'file.txt'
<?php //get the file with file() - its an array $file=file('file.txt'); ?>
in file.txt i have
its just an example in the file.txt
user1:password1 user2:password2
// i`ve tried with for() and then using explode to get user and password separatly $file=file('file.txt'); for($i=0;$i<count($file);$i++){ $res=explode(':',$file[$i]); $LOGINURL = "http://www.phpfreaks.com/forums/index.php?action=login2"; // here at postfields i cant get it done // ived tried $res[0] for user and $res[1] for password $POSTFIELDS = 'user='.$res[0].'&passwrd='.$res[1].'&cookielength=-1&openid_url=&hash_passwrd='; $agent='Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'; $cookie_file_path='cook.txt'; $reffer='http://phpfreaks.com/'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$LOGINURL); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_REFERER, $reffer); curl_setopt($ch, CURLOPT_COOKIE,$cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); $result = curl_exec ($ch); curl_close ($ch); //echo $result; if(stristr($result,'<li id="name">Hello')){ $match=strip_tags(substr($result,strpos($result,'<li id="name">Hello')+14,40)); } echo $match; } //its prints Hello adv Hello adv
I want to achive :
1 - loop until it reached end of line;
2 - try all the users in the 'file.txt' file and echo message like Hello username
-
i was just wondering how doest xcart works
how does it crypts the data?
i downloaded the script and saw the functions
this is crypted in xcart
Snhmsmoljmdmmmg
how does this works
just letters .. how does it knows
-
the problem is when i submit the page and is empty one of the values is shows the second form
but if i submit the second form and the inputs are not empty it redirects me to the first form
i`ve tried with $_SESSION and it works ... but i wanna know is there is a way just with variables
when i submit the second form and the values are not empty i just wanna show lets say
thanks in advance
you didnt understand my point
read carefully what i was saying
check username
in PHP Coding Help
Posted
hey i am trying to make a script that checks if the username exists or not but i have a problem
i`m trying first to enter the site then the register page where u can check if a user exists or not
that is link check
this is the error i`m getting