I'm using this code:
[code=php]
<?php
require_once "Mail.php";
$from ="__MUNGED__ ";
$to = "__MUNGED__ ";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "__MUNGED__ ";
$username = "pedjasmek" ;
$password = "********";
$headers = array ('From' => $from,
...
User Profile
Collapse
-
Sending email using PEAR
Last edited by pbmods; Jan 2 '08, 03:15 AM. Reason: Changed [CODE] to [CODE=php], removed email info. -
Forcing download dialog
I'm using this script to force browser's download dialog :
[code=php]
$fp=fopen('Surv ivor - Eye of tiger.mp3','r') ;
$name=basename( "Survivor - Eye of tiger.mp3");
$size=filesize( 'Survivor - Eye of tiger.mp3');
header('Content-Type: audio/mpeg');
header('Content-Length:$size');
header("Content-Disposition: attachment;file name= $name");
fpassthru($fp);
fclose($fp);... -
Cookie expire
Expire time in the cookie I use is next year but it expires few minutes later.Is there some setting(s) I'm missing? -
I've learned later that there is cure for that.It's output buffering.Use ob_start() function at the very beginning of the page(before any header was sent) and ob_clean() in the script where ever there is need for it. -
Redirecting
How can I redirect a user to a certain page depending on some condition?(If it is true go to page 1 else go to page 2).Is it possible? -
I could make some kind of voting system allowing users to vote only once in,say,24 hours or similar.This is just one example.Now you see why I've posted the questionLeave a comment:
-
I came up with the same idea but I want to know something else.Assume that certain user wants to remain logged in that means that he doesn't need to fill in username and password fields again.How can I know that it's him again?Leave a comment:
-
Storing sessions
Can anyone tell me what is the best way to store sessions into database in order to recognize that user next time he access the site?I thought about IP address but then I remembered that it is different every time.What thing regarding a user is always the same? -
How to pass variables from one page to another.
I have one link in the second script that leads to the first one.How can I pass variables from the second script to the first one?
I cannot use $_GET $_POST variables because I don't use those requests.Last edited by Atli; Nov 2 '07, 04:46 PM. Reason: Changed thread title to better describe it's contents. -
Of course.The problem was with the settings in the php.ini file.Every time you alter a value in the file,you have to stop and then start again the server.I figured that out
when I looked at the output of the phpinfo() function.It was really a small problem but it caused me many troubles.Funny thing.Leave a comment:
-
-
I've looked in httpd.conf file but there is no setting under name of "LimitRequestBo dy".I'm using Apache version 1.3.
Instalation came with book about PHP that I bought.Leave a comment:
-
Funny thing is that I don't get anything from the line
.Code:echo $_FILES['file1']['error'];
It works perfectly fine smaller files but for larger it doesn't work.Leave a comment:
-
-
File upload
I have these two php scripts which I use to upload a file on my server(I do everything offline):
First one is called prebacivanje fajla.php and it goes:
[code=php]
<html>
<head>
<title> Prebacivanje fajla </title>
</head>
<body bgcolor="yellow "><br><br>
<center><h1> <font face="papyrus">...
No activity results to display
Show More
Leave a comment: