Help With POST And GET Method »  Show posts from    to     

Icy Phoenix


Old Support Topics - Help With POST And GET Method



AndyGpy [ Tue 01 Jan, 2013 01:52 ]
Post 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: [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: [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


mort [ Tue 01 Jan, 2013 02:36 ]
Post subject: Re: Help With POST And GET Method
<form action="upload2.php" enctype="multipart/form-data" method="post">


Informpro [ Tue 01 Jan, 2013 02:51 ]
Post subject: Re: Help With POST And GET Method
Use <form target="_blank" ...


mort [ Tue 01 Jan, 2013 04:48 ]
Post 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?


Informpro [ Tue 01 Jan, 2013 11:09 ]
Post subject: Re: Help With POST And GET Method
I've been posting some strange things here and there ...
I meant this :
Code: [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"> 


AndyGpy [ Tue 01 Jan, 2013 11:13 ]
Post 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: [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


Informpro [ Tue 01 Jan, 2013 11:31 ]
Post subject: Re: Help With POST And GET Method
$_REQUEST has _POST variables too.


AndyGpy [ Tue 01 Jan, 2013 11:45 ]
Post subject: Re: Help With POST And GET Method
Still not happening guys


mort [ Tue 01 Jan, 2013 13:05 ]
Post 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.


AndyGpy [ Tue 01 Jan, 2013 17:49 ]
Post subject: Re: Help With POST And GET Method
let me try again

Code in tpl --

Code: [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: [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 ?


mort [ Wed 02 Jan, 2013 04:20 ]
Post 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.


Mighty Gorgon [ Thu 10 Jan, 2013 14:54 ]
Post subject: Re: Help With POST And GET Method
Can you please show us how do you define this UPDATE_TICKED?




Powered by Icy Phoenix