inserari si afisari imagini.help!

Secţiune dedicată începatorilor.

Moderatori: Moderatori, Start Moderator


Troto
PHPRomania Coder Professional
Mesaje: 249
Membru din: Mar Iun 29, 2004 2:11 am
Localitate: Brasov

Mesajde Troto » Joi Iul 29, 2004 12:41 am


adi1971
PHPRomania Supporter
Mesaje: 24
Membru din: Dum Iul 25, 2004 9:46 pm
Localitate: pitesti

Re: re

Mesajde adi1971 » Joi Iul 29, 2004 3:44 pm

sigur ai scris session_start() in fiecare fisier in care ai nevoie de variabilele tinute in sesiune ? sau intr-un fisier pe care il incluzi in toate celelalte fisiere...[/quote]


nu am o astfel de problema
am verificat scriptul pe net si merge
problema este in calculatorul meu
te rog uita-te daca am setarile corecte in php.ini:
"
[Session]
; Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored.
session.save_path = C:\TEMP

; Whether to use cookies.
session.use_cookies = 1


; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =

; Handler used to serialize data. php is the standard serializer of PHP.
session.serialize_handler = php

; Percentual probability that the 'garbage collection' process is started
; on every session initialization.
session.gc_probability = 1

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

; Check HTTP Referer to invalidate externally stored URLs containing ids.
session.referer_check =

; How many bytes to read from the file.
session.entropy_length = 0

; Specified here to create the session id.
session.entropy_file =

;session.entropy_length = 16

;session.entropy_file = /dev/urandom

; Set to {nocache,private,public} to determine HTTP caching aspects.
session.cache_limiter = nocache

; Document expires after n minutes.
session.cache_expire = 180

; use transient sid support if enabled by compiling with --enable-trans-sid.
session.use_trans_sid = 1

url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"



"

adi1971
PHPRomania Supporter
Mesaje: 24
Membru din: Dum Iul 25, 2004 9:46 pm
Localitate: pitesti

Mesajde adi1971 » Joi Iul 29, 2004 3:47 pm


Avatar utilizator
ovi2ut
PHPRomania Coder Professional
Mesaje: 166
Membru din: Vin Sep 13, 2002 5:23 pm
Localitate: Middle of Nowhere
Contact:

Mesajde ovi2ut » Joi Iul 29, 2004 4:32 pm

Losing an illusion makes you wiser than finding a truth.

adi1971
PHPRomania Supporter
Mesaje: 24
Membru din: Dum Iul 25, 2004 9:46 pm
Localitate: pitesti

Mesajde adi1971 » Joi Iul 29, 2004 5:50 pm


Zamolxe
Average Member
Mesaje: 130
Membru din: Mar Ian 14, 2003 4:50 pm
Localitate: Bucharest

re

Mesajde Zamolxe » Joi Iul 29, 2004 6:08 pm

session.auto_start = 0;
session.save_path = C:\TEMP (care trebuie obligatoriu sa exista si sa nu fie readonly)

utilizeaza variabilele globale corect, adica cu caps:

$_POST['stuff']
$_SESSION['stuff']
$_GET['stuff']

vezi ca inainte de
[php]
<?php session_start();
[/php]
sa nu ai spatii goale

serban

adi1971
PHPRomania Supporter
Mesaje: 24
Membru din: Dum Iul 25, 2004 9:46 pm
Localitate: pitesti

Re: re

Mesajde adi1971 » Vin Iul 30, 2004 1:39 pm


Zamolxe
Average Member
Mesaje: 130
Membru din: Mar Ian 14, 2003 4:50 pm
Localitate: Bucharest

re

Mesajde Zamolxe » Vin Iul 30, 2004 4:21 pm

mai jos este codul corect.
ti-am spus, utilizeaza variabilele globale cu litere mari:

[php]
$_post[''] --> $_POST['']
$_session[''] --> $_SESSION['']
[/php]

[php]
<?php
session_start();
if(isset($_POST['Adauga']))
{
print $_POST['denprod'];
$_SESSION['denprod'][]=$_POST['denprod'];
$_SESSION['detprod'][]=$_POST['detprod'];
$_SESSION['cant'][]=$_POST['cant'];
$_SESSION['pret'][]=$_POST['pret'];
}
if(isset($_POST['Modifica']))
{for($i=0; $i<cout($_SESSION['denprod']); $i++)
{$_SESSION['cant'][$i]=$_POST['cant'][$i];
}

}
?>

<form action="start.php" method="post">
<table width="100%" border="0" summary="">
<tr>
<td>denprod</td>
<td><input type="text" name="denprod" size="40" maxlength="256" value="dfdfdfdf"></td>
</tr>
<tr>
<td>detprod</td>
<td><select name="detprod">
<option value="aaaa"> aaaa</option>
<option value="ddddd"> ddddd</option>
<option value="ffff"> ffff</option>
<option value="ttttt"> ttttt</option>
<option value="yyyyy"> yyyyy</option>
</select>
</td>
</tr>
<tr>
<td>cant</td>
<td><select name="cant">
<option value="1"> 1</option>
<option value="2"> 2</option>
<option value="3"> 3</option>
<option value="4"> 4</option>
<option value="5"> 5</option>
<option value="6"> 6</option>
</select>
</td>
</tr>
<tr>
<td>pret</td>
<td><input type="text" name="pret" size="40" maxlength="256" value="1">
</td>
</tr>
<tr>
<td><input type="submit" name="Adauga" value="Adauga">
</td>
</tr>
</table>
</form>

<?php
print'<table>';
$cantprod=count($_SESSION['denprod']);
for($i=0; $i<$cantprod; $i++)
{print'<tr>';
print'<td>'.$_SESSION['denprod'][$i].'</td>';
print'<td>'.$_SESSION['detprod'][$i].'</td>';
print'<td>'.$_SESSION['cant'][$i].'</td>';
print'<td>'.$_SESSION['pret'][$i].'</td>';
$total=$_SESSION['cant'][$i] * $_SESSION['pret'][$i];
print'<td>'.$total.'</td>';
print'</tr>';
$totalgeneral=$totalgeneral+$total;
}
print'</table>';

?>
<input type="submit" name="Modifica" value="Modifica">

<?php
print 'totalgeneral:'.$totalgeneral;
?>
[/php]

adi1971
PHPRomania Supporter
Mesaje: 24
Membru din: Dum Iul 25, 2004 9:46 pm
Localitate: pitesti

Re: re

Mesajde adi1971 » Vin Iul 30, 2004 7:55 pm

[quote="Zamolxe"]mai jos este codul corect.
ti-am spus, utilizeaza variabilele globale cu litere mari:

asa am facut
in calculator nu-mi funcioneaza sesiunile
tot nu stiu de ce?

am verificat online si-mi functioneaza exemplul meu dupa ce am scris variabilele globale cu litere mari(multumesc mult!);
deci, problema este ceva incorect in server(poate ca nu am drepturi de scriere in sesiuni)!


Înapoi la “PHP Incepători”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 22 vizitatori