inserari si afisari imagini.help!
Moderatori: Moderatori, Start Moderator
- smallAdmin
- Average Member
- Mesaje: 117
- Membru din: Vin Mai 21, 2004 11:20 am
- Localitate: Bucuresti
- Contact:
Re: re
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"
"
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"
"
re
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
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
re
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]
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]
Re: re
[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)!
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)!
Cine este conectat
Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 21 vizitatori
