[PHP] Pagina is verlopen [POST verplicht]

Pagina: 1
Acties:
  • 221 views sinds 30-01-2008
  • Reageer

  • BierPul
  • Registratie: Juni 2001
  • Laatst online: 23-08 22:21

BierPul

2 koffie graag

Topicstarter
Ik heb een beeldbank geproggeld daarbij kan een melding komen dat een bestand met dezelfde naam al op de machine aanwezig is.

Men krijgt dan een melding of ze hem willen hernoemen overschrijven bla bla bla.

Eenmaal in het hernoemen veld aangekomen wil ik ook een mogelijkheid geven om terug te gaan.

Via "javascript:history.go(-1)" liet ik ze terug gaan .
logischerwijs kreeg ik de error, omdat ik het form via POST method submitte :)

Verander ik dat echter in GET dan wordt mn file niet meer geupt :(

Iemand een id voor een workaround :?

Ja man


  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

$_SERVER [ 'HTTP_REFERER' ]; gebruiken?

edit:
:X * drm leest niet goed...

Je kunt in het bestand waar de post verwerkt wordt een redirect opgeven naar een bestand waarnaar wel teruggegaan wordt.
code:
1
2
3
4
if ( post ) {
   // verwerk meuk
   Header ( "Location: bestandje.php" );
}

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


  • BierPul
  • Registratie: Juni 2001
  • Laatst online: 23-08 22:21

BierPul

2 koffie graag

Topicstarter
thnx voor de tip *D

echter heb ik hem nog niet ok :(
PHP:
1
<?if(plaatje bestaat niet op de server) {     stop de info in de db , en move de file} else {     header($PHP_SELF);      $show = "duplicate";     $bldbnk_naam=$_FILES [  'bestand'  ][ 'name' ];}?>

$show = "duplicate";

Geeft een keuze scherm terug van wat te doen (overschrijven, hernoemen etc)

Als ik een keuze maak bv hernoemen en ik kies dan voor back blijf ik de pagina is verlopen houden :(

Ja man


  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

code:
1
2
3
4
5
6
if ( post ) {
   // verwerk plaatje, verplaats melp, ende spef
   redirect naar php_self?done=true
} elseif ( done == 'true' ) {
   echo "woei, 't is allemaal gelukt :P
}

afgezien van de nodige _GET, _POST en isset meuk :P

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


  • BierPul
  • Registratie: Juni 2001
  • Laatst online: 23-08 22:21

BierPul

2 koffie graag

Topicstarter
Dat gaat bij mij niet werken aangezien alles in 1 script staat :)

Een hele berg if elsjes en switches :P

Ja man


  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

't is toch gewoon een extra if-je of case-je d'r bij :?

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


  • BierPul
  • Registratie: Juni 2001
  • Laatst online: 23-08 22:21

BierPul

2 koffie graag

Topicstarter
Ik kreeg hem niet werkend maar ik ga het toch nog ff proberen dan :)

Je bent er dus wel >:)

Ja man


  • [ash]
  • Registratie: Februari 2002
  • Laatst online: 23-08 12:03

[ash]

Cookies :9

ff een vraagje:

wat staat er in je HTML header ??

  • BierPul
  • Registratie: Juni 2001
  • Laatst online: 23-08 22:21

BierPul

2 koffie graag

Topicstarter
ff een testje van www.delorie.com
code:
1
2
3
4
5
6
7
8
9
10
11
HTTP/1.1 302 Found
Date: Tue, 16 Jul 2002 11:25:13 GMT
Server: Apache/1.3.26 (Unix) PHP/4.2.1
X-Powered-By: PHP/4.2.1
Set-Cookie: PHPSESSID=e0d20ef50b01eae8bf81d633d30ee2d9; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
location: index.php
Connection: close
Content-Type: text/html

Ja man


  • [ash]
  • Registratie: Februari 2002
  • Laatst online: 23-08 12:03

[ash]

Cookies :9

gebruik jij dit ook in jouw headers ??
code:
1
2
3
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache

Zoals je ziet staat de Expire date ergens in het verleden en is de pagina dus altijd verlopen. ;)

  • BierPul
  • Registratie: Juni 2001
  • Laatst online: 23-08 22:21

BierPul

2 koffie graag

Topicstarter
nope ik heb daar niks in staan |:(

Dus als ik het goed begrijp als ik hem zo instel dat ie nooit expired , zal mn probleem gefixed moeten zijn :)

Ja man


  • [ash]
  • Registratie: Februari 2002
  • Laatst online: 23-08 12:03

[ash]

Cookies :9

Zoals hierboven staat expired ie wel :)
Pagina: 1