Help With POST And GET Method


Subject: Help With POST And GET Method
Hi GUys,

I am using ICY Version 1.......53,

I have modified a page which calls upload2.php, which is basically the same as upload.php, below is the calling routine.

Code: [Download] [Hide] [Select]


<form method="GET" action="javascript:Popup('upload2.php')"show popup enctype="multipartform-data">
<p><img src="{life.LIFE_PICTPATH}"></p>
<input type="hidden" name="RECID" value="{life.UPDATE_TICKED}" />
<p><input type="submit" name="submit" value="Add / Change Picture"></p>
</th></form>



And a the line in my upload2.php code of

Code: [Download] [Hide] [Select]

$recordID = $_REQUEST["RECID"]; //ID of specie being uploaded



what i an trying to do is when the form is submitted it opens in a pop up upload2.php, which works , but i cannot pull through the RECID variable, can someone please shine some light on this please.

Regards

Subject: Re: Help With POST And GET Method
<form action="upload2.php" enctype="multipart/form-data" method="post">

Profile PM  
Subject: Re: Help With POST And GET Method
Use <form target="_blank" ...

Profile PM  
Subject: Re: Help With POST And GET Method
Informpro wrote: [View Post]
Use <form target="_blank" ...


It's a PopUp, why would it need target_blank? Else it will open in a new tab or window?

Profile PM  
Subject: Re: Help With POST And GET Method
I've been posting some strange things here and there ...
I meant this :
Code: [Download] [Hide]
  1. <form action="upload2.php" onsubmit="window.open('about:blank', 'formpopup', 'width=320,height=240,resizeable=no');" enctype="multipart/form-data" method="post" target="formpopup"> 

Profile PM  
Subject: Re: Help With POST And GET Method
Mort,

Your code does not work, doesnt open as a pop up and i still cannot retrieve the data into upload2.php

Informpro

Have tried - <form action="upload2.php" onsubmit="window.open('about:blank', 'formpopup', 'width=320,height=240,resizeable=no');" enctype="multipart/form-data" method="post" target="formpopup">

and i have messed about with the retrieval code in upload2.php.

Code: [Download] [Hide] [Select]
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
include(IP_ROOT_PATH . '/newticklist/ticklistconfig.'.PHP_EXT);

$recordID = $_POST['RECID']; //ID of specie being uploaded


Have i got it perhaps in the wrong location in upload2.php ?

this is driving me nutz

Subject: Re: Help With POST And GET Method
$_REQUEST has _POST variables too.

Profile PM  
Subject: Re: Help With POST And GET Method
Still not happening guys

Subject: Re: Help With POST And GET Method
AndyGpy wrote: [View Post]
Your code does not work, doesn't open as a pop up


It wasn't meant to. It's up to you to add the javascript.

AndyGpy wrote: [View Post]
Have i got it perhaps in the wrong location in upload2.php ?


<form is html - not php.

The form is used to "call" the php file after it has been loaded.

You will have to call the php first and call the html from that. As in .tpl file.

Of course the simplest way is to have the html in the php file and echo ' it.

Unfortunately phpBB doesn't work that way. :(

Profile PM  
Subject: Re: Help With POST And GET Method
let me try again

Code in tpl --

Code: [Download] [Hide] [Select]
<form action="upload2.php" onsubmit="window.open('about:blank', 'formpopup', 'width=320,height=240,resizeable=no');" method="post" enctype="multipart/form-data" target="formpopup">
<p><input align="middle" type="image" name="imageField" id="imageField" src="{life.LIFE_PICTPATH}" alt="Add an Image"></p>
<input type="hidden" name="RECID" value="{life.UPDATE_TICKED}" />
</form>


The upload2.php does open a tpl file in a popup window just the same as it does in ICY itself when you add an image to gallery

Which should put the value contained in life.UPDATE_TICKED as the post variable of RECID correct ?

I know that life.UPDATE_TICKED, does produce a value as i have checked with an echo statement.

Code in upload2.php to retrieve this value is

Code: [Download] [Hide] [Select]
$recordID = $_REQUEST['RECID']; //ID of specie being uploaded


I bit of insight --

I have a database that contains a list of birds all have a unique record number and is passed into the TPL under the variable life.UPDATE_TICKED, and it definately does transfer the correct value. I want to get this value into upload2.php so that when the user selects an image to upload i can assosciate it to this species unique to the user for retrieval in another page.

I dont normally have issues with post, get or request but i am severely going nutz with this is there something in icy 1.53 that stops you from posting ?

Subject: Re: Help With POST And GET Method
It's a big ask my friend when you have a MOD that you have got from somewhere, patched it for Icy Phoenix and never made it publicly available.

And now you are asking questions about it when no-one has any idea of what the overall code is or what the end result is supposed to be. :?:

Also, Icy Phoenix *53 is Officially no longer supported. - So It would be wise to upgrade it.

Profile PM  
Subject: Re: Help With POST And GET Method
Can you please show us how do you define this UPDATE_TICKED?


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.0841s (PHP: 24% SQL: 76%)
SQL queries: 10 - Debug Off - GZIP Enabled