|
yornsocheat wrote: How many parameter are there I need?
Need for what? As the designer this is a question for you. However, some of these[^] may help you decide.
|
|
|
|
|
First thing, you need to know what you need to create??
1. You need to create a pop3 client. Its possible using php.
2. as you are planning to access gmail account, in that case you also need to implement ssl communication so that you can read the data actually,
As a matter of fact you can create a global pop client that will be able to access any pop server.
|
|
|
|
|
|
هر کی سورس کد می خواهد بگه من در خدمتم سورس کدهای که به ذهنتون هم نماید 
|
|
|
|
|
Please post in English only.
الرجاء نشر باللغة الانكليزية فقط
|
|
|
|
|
leading by example, are we?
|
|
|
|
|
|
Hi,
I'm new in PHP.
define('BUFSIZ', 4095);
$url = $_GET["addr"];
$msk = $_GET["key"];
$msklen = count($msk);
$rfile = fopen($url, 'r');
$lfile = fopen(basename($url), 'w');
while(!feof($rfile))
{
$content = fread($rfile, BUFSIZ);
while($i=0; $i < BUFSIZ; $i++)
$content[$i] = $content[$i] ^ &msk[$i % count($msk)];
fwrite($lfile, $content, BUFSIZ);
}
fclose($rfile);
fclose($lfile);
this code is not working after performing towice in a file my file will be change.
what is wrong with my while statement?
thanks.
No Comment.
|
|
|
|
|
One thing that struck me when reading your code is you don't care about the actual length of the file: you request a read of 4095, however the file length could be more (in which case you ignore the extra data), or less in which case you are looping over non-existing bytes. The $i < BUFSIZ test is bound to be wrong.
|
|
|
|
|
Hi,
You are right but this might cause some data error in last block of file but my problem is that i have file changing data in whole entire of my file. Let ignore last block, in other block we shoud have any problem in converting file towice but there is some problem.
This code in c++ working well but in php i don't know what happen if I accesing my data with index ([$i]) and change it with xor operation it looks that my original data will be growup.
thanks
No Comment.
|
|
|
|
|
Hi,
I looked a bit closer, here is your code again, then my comments:
1 define('BUFSIZ', 4095);
2 $url = $_GET["addr"];
3 $msk = $_GET["key"];
4 $msklen = count($msk);
5 $rfile = fopen($url, 'r');
6 $lfile = fopen(basename($url), 'w');
7 while(!feof($rfile))
8 {
9 $content = fread($rfile, BUFSIZ);
10 while($i=0; $i < BUFSIZ; $i++)
11 $content[$i] = $content[$i] ^ &msk[$i % count($msk)];
12 fwrite($lfile, $content, BUFSIZ);
13 }
14 fclose($rfile);
15 fclose($lfile);
1.
your code does not compile, there are several mistakes.
2.
line 10 is wrong; a while statement takes one argument, you intended to use a for loop?
3.
line 11: &msk needs a dollar sign, not an ampersand.
4.
line 11: you can't silently convert a character to an integer; when you want the ASCII index of a character, use the ord function[^]. The reverse operation is performed using the chr function[^].
Finally, here is some code that might help you:
function par($string) {
echo "<p>$string</p>\n";
}
function hexdump($title, $filename1) {
$BUFSIZ=20;
$hex="0123456789ABCDEF";
$dump="";
$rfile = fopen($filename1, 'r');
$content = fread($rfile, $BUFSIZ);
$len=strlen($content);
for($i=0; $i < $len; $i++) {
$val=ord($content[$i]);
$dump=$dump." ".$hex[$val/16].$hex[$val%16];
}
par("");
par($title);
par($dump);
}
|
|
|
|
|
Hi,
Thanks alot. That was very helpful.
No Comment.
|
|
|
|
|
How can I prevent click jacking in php?
I just have the concept of click jacking , If i implement click jacking in php from code search from internet , then how can i know it is implemented? Kindly clear my concept and tell me Click-Jacking Preventing demo Code in php...
I am waiting for your positive and Quick response...
Thanks....
|
|
|
|
|
I think best solution for you to make sure that your webserver is well protected.
|
|
|
|
|
How r u dear frnds?
can anybody help to create currency converter using PHP & rates automatically update??
MAT
|
|
|
|
|
|
I wouldn't worry about a PHP currency converter, but about the missing keyboard-keys, if I was you.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Currently I'm develop an application same as CRM. To generate report in PDF,i'm using FPDF as my tools. The problem is, to retrieve the data from database,I create temporary file e.g:dldata.php and call that page in my pdf viewer file. U can access the data and easily view the actual data(if you know the address).By using explode(),I retrieve the data and display it on my pdf viewer page. The dldata.php will be delete (using unlink()) after user load the quotation form. Below are the flow to create quotation in pdf:
fill form data(createquotation.php)->insert data to database->create session,dldata.php & write data into it from mysql->redirect page to viewquotation.php(here I call dldata.php)->click print quotation or back to createquotation.php & destroy dldata.php. Anyone that have experience using FPDF to advise me about this issue. I'm afraid the conflict arise when 2 or more users doing the same process at the same time. TQ. 
|
|
|
|
|
What is your actual problem?
Creating the PDF File?
or
Downloading the PDF File?
|
|
|
|
|
I have no problem with either download or creating the pdf file. The problem is method that i used. I used this code to call dldata.php after i create it.
$pdf = new PDF();
$header = array('Product ID', 'Product No', 'Product Description', 'Subtotal#39;);
// Data load from the file and it will be=>1;#13,21321;Pencil;$1.00
$data = $pdf->LoadData('dldata.php');
I followed tutorial based on fpdf official website.
Tutorial:
http://www.fpdf.org/en/tutorial/tuto5.htm[^]
Example for dldata.php shape of data:
http://www.fpdf.org/en/tutorial/countries.txt[^]
After load back to the createquotation.php,I destroy dldata.php file. I'm afraid, it will be issue if more than 2 user do this process at the same time. It will be last in,first out. Only The last data store will be appear. Can I just use dldata.php without delete it and call the data without any user can access it by type the url.
|
|
|
|
|
Click Here to review of Python Tools for Visual Studio
|
|
|
|
|
Please don't do this. Unless your post adds value to a question, don't go linking to external websites. If you do, your account will be banned and your IP will be tracked. Repeated violations will see your IP being permanently banned.
|
|
|
|
|
Hi,
Just have set of around 100 xml files that need to be displayed on HTML.
Each file consists of same 40 elements and then sub elements as well. While looking for the best way to display the xml in html - i found w3s solution i.e.
http://www.w3schools.com/xml/xml_to_html.asp[^]
But this process is quite cumbersome. I mean, if i go with this process, I have to enter all the elelments and sub elements name and then only i can get that to display my xml in html.
Is there any other way, that can read the xml file itself and display each elements and sub elements in html ??
Thanks
Andyyy
|
|
|
|
|
You might want to look into using XSLT for translating your XML into something HTML friendly.
|
|
|
|
|
yes, php has a new (to me) class you can read about it here. http://www.php.net/manual/en/class.domdocument.php[^]
I found it very easy to use on html sources. But if you look in the comments you will see some examples of how xml to html can be done.
Chris J
www.redash.org
|
|
|
|