|
I don't know if it was you who 1-voted my reply, but I was at least answering the question the OP asked. He showed that he can write php to serve the pdf file. What he wants to do is to get the browser to display the file rather than offer a download. The way to do this is through the content-disposition header as I indicated.
|
|
|
|
|
Never mind my friend.
I am not here to vote anyone, I am just replying on what I know.
Jinal Desai - LIVE
|
|
|
|
|
PDF required adobe or post script plugin, close your browser and install adobe reader or some plugin that have pdf support for your browser., The second choice better you write book renderer like google books, this require ajax to load images that you created before , OR you can hunt library that can display pdf on the fly... REGARD!!!!
|
|
|
|
|
Friends , I have a code which uses Depreciated functions:
I have Marked that code BOLD, please help me if you could provide alternative statements to them ... like through PREG..
Please Help..
if (ereg("HTTP/[0-9.]+ (([0-9])[0-9]{2})", $answer, $regs)) {
$httpcode = $regs[2];
full_httpcode = $regs[1];
if ($httpcode <> 2 && $httpcode <> 3) {
$status['state'] = "Unreachable: http $full_httpcode";
$linkstate = "Unreachable";
}
}
if (ereg("Location: *([^\n\r ]+)", $answer, $regs) && $httpcode == 3 && $full_httpcode != 302) {
$status['path'] = $regs[1];
$status['state'] = "Relocation: http $full_httpcode";
fclose($fp);
return $status;
}
if (eregi("Last-Modified: *([a-z0-9,: ]+)", $answer, $regs)) {
$status['date'] = $regs[1];
}
if (eregi("Content-Type:", $answer)) {
$content = $answer;
$answer = '';
break;
}
if (eregi("Content-Type: *([a-z/.-]*)", $content, $regs)) {
if ($regs[1] == 'text/html' || $regs[1] == 'text/' || $regs[1] == 'text/plain') {
$status['content'] = 'text';
$status['state'] = 'ok';
} else if ($regs[1] == 'application/pdf' && $index_pdf == 1) {
$status['content'] = 'pdf';
$status['state'] = 'ok';
} else if (($regs[1] == 'application/msword' || $regs[1] == 'application/vnd.ms-word') && $index_doc == 1) {
$status['content'] = 'doc';
$status['state'] = 'ok';
} else if (($regs[1] == 'application/excel' || $regs[1] == 'application/vnd.ms-excel') && $index_xls == 1) {
$status['content'] = 'xls';
$status['state'] = 'ok';
} else if (($regs[1] == 'application/mspowerpoint' || $regs[1] == 'application/vnd.ms-powerpoint') && $index_ppt == 1) {
$status['content'] = 'ppt';
$status['state'] = 'ok';
} else {
$status['state'] = "Not text or html";
}
Please HELP me soon ..please REPLY!!!
|
|
|
|
|
is Google not working where you are? it gave me many links including this one[^].
|
|
|
|
|
Well friend i am googling from 5 days.
And i have found many links and studied them too.
and these BOLD queries that i have mentioned
are not being able to be resolved by me..
Actually i have to look for alternative for these
expression!!!
Hope u can help....with some solution or with a link which could
guide me how to resolve them!!
Its a new change by PHP and I can't catch it so soon..
So please help me
Or you can do another thing...
I am using XAMPP with php 5.3
is there any way to stop displaying those deprecated errors
|
|
|
|
|
I use XAMPP myself, however I don't want to hide error or warning messsages, I work on my code to avoid them in the first place.
From the link I provided it seems the new ereg and the old preg stuff is very similar; so I suggest you study where they differ and fix things in your code. Start with the very first occurence and fix that. From then on, it should be easy.
|
|
|
|
|
USE : PERL REGEX , preg_replace,preg_match; HONEY
|
|
|
|
|
hello all,
I want to know which is the best php framework to use in any
general php project.
The project size lies between medium scale project to
large scale project.
So from overall points of all frameworks like ease of use
to scalability, which is best ??
Jinal Desai
|
|
|
|
|
There is literally dozens of PHP Frameworks. Decide what you need and try to match it from this comparison site, then make your choice(s) http://www.phpframeworks.com/[^]
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Thanks It will help me a lot.
Jinal Desai
|
|
|
|
|
|
I'm not even really being sarcastic when I say there isn't a best one, and you'll probably hate them all and eventually convince yourself that your only recourse is to write your own.
Honestly Illustrated
<Pretentious> Raid tha manyuhl. :E
<Pretentious> Aw raid eh own mah meaxbile. :E
|
|
|
|
|
hello, i am in the process of making a download counter for external link, so when the user clicks the link to dilesharing site the download is noted and 1 is added to the mysql database ...
here is how i make the id...
echo"<a href=\"download_count.php?id=". $row['upload_id'] . "\">Download</a>";
now i get this when i click download ...
http://localhost/website/download_count.php?id= 54
now thats related to the record in a mysql databas, as you have probably guessed ....
how do i get that id in the url so i can use it in the download_count.php file which will allow me to make a function to add 1 ??
thanks for all your help in advance ...
|
|
|
|
|
a little Google action would have yielded pages such as this one[^].
|
|
|
|
|
hello guys....can we install Zorine OS on virtualbox??...thanx for the answer
|
|
|
|
|
Yes.
However, as seen as it will be running in a VM, you should find out if the OS supports the virtual hardware (ie. network adapters).
|
|
|
|
|
I have a great website that is my capture page. Others would like to use it also. How do I add a parameter that would allow me to add a user to my site like website.com/username..
I'm normally a .net programmer, this is my first php programm..
Could I have an code sample too...
Thanks..
|
|
|
|
|
Are you talking about a parameter (GET or POST) or somehow fiddling with the URL? I'm not sure I follow what you want to do.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
I want to have 3 or 4 people to sell products from my website by sending others to view it. They need to send them there with a link that contains an input parameter that is their id so they can get credit for the online sale. So what is the best way to do this?
|
|
|
|
|
I'd probably use a HIDDEN field to send a GET or POST parameter to a PHP page that looks at the parameter and figures out who to give credit to, then sends them on to the link.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
hello, i am hoping someone will be able to help me with this, i have a basic login form using md5 encryption....
Login.php (the form)
<?php echo '<div id="errors">'.$err.'</div>'; ?><br/>
<table><tr><td>
<form method="post" action="login_go.php">Username:
</td><td>
<input typ="text" name="user">
</td></tr><tr><td>
Password:
</td><td>
<input type="password" name="passcode">
</td></tr><tr><td>
<input type="submit" value="Log In"></td></tr></table><br/>
login_go.php (the processing)
<?php
session_start();
Include("connect.php");
$username = ($_POST['user']);
$password = md5($_POST['passcode']);
$q = mysql_query("SELECT * FROM users WHERE user = '$username' AND pass = '$password'") or die (mysql_error());
$r = mysql_num_rows($q);
if ($r == 1) {
$_SESSION['logged'] = TRUE;
$_SESSION['user'] = $username;
$_SESSION['email'] = $email;
$_SESSION['date'] = $joined;
header("Location: members.php");
exit();
} else {
$err.='Incorrect username/password!';
Include("login.php");
}
?>
On my database, the password is encrypted correctly but when i come to login i only need to enter the user and i gain access, and when i put a password into it, i then get an error .... what have i done wrong ? ?
Thanks
Steve
|
|
|
|
|
First, you should really escape the $_POST['user'] value before putting it into an SQL query:
$username = mysql_real_escape_string($_POST['user']);
As for why it logs you in when the password is left blank, my guess is that the hashed password is actually the MD5 hash of an empty string. In other words, the correct password is a blank password.
SELECT MD5('') gives me d41d8cd98f00b204e9800998ecf8427e - is that what you have?
|
|
|
|
|
yeh actually, i have just took the md5 encrypting off and it inserts nothing into the db and i do get d41d8cd98f00b204e9800998ecf8427e .... how do i fix this ?
modified on Friday, April 23, 2010 6:19 PM
|
|
|
|
|
Fixed it , thanks for all your help ...
|
|
|
|