Using session in coppermine Using session in coppermine
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Using session in coppermine

Started by catbegemot, December 19, 2003, 03:16:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

catbegemot

Hi all :)
I have a problem with using sessions in coppermine. I need to create two pages - one that gathers user input and another one that sends an e-mail to the address provided by user. In order to protect the second page from being used by some one else I thought of implementing some sort of security scheme based on sessions (the source code provided).
The problem is that the submit.php does not see the values passed by the form (at least they are not in $mail, $subj, $msg variables). I'm a newbie in PHP, so there's possibly something I'm doing wrong here, HOWEVER I tested these exact pages without coppermine and they worked just fine. So the question is - what am I doing wrong?

<?php
// contact_form.php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.2.0                                            //
// ------------------------------------------------------------------------- // 
session_start&#40;&#41;;
session_register&#40;"key1"&#41;;
session_register&#40;"key2"&#41;;
session_register&#40;"key3"&#41;;
$key1 session_id&#40;&#41;;
session_name&#40;"email_page"&#41;;
$key2 session_name&#40;&#41;;
$key3 getmypid&#40;&#41;;

define&#40;'IN_COPPERMINE', true&#41;;
define&#40;'EXTRAS_PHP', true&#41;;

require&#40;'include/init.inc.php'&#41;;

pageheader&#40;$lang_extras['contact'&#93;&#41;;
starttable&#40;"100%", $lang_extras['contact'&#93;&#41;;

echo '
<form name="form1" method="post" action="submit.php?'
.SID.'">
<div align="right">'
.$lang_extras['name'&#93;.'</div>
<input name="name" type="text" size="30" maxlength="100"><br>
<
div align="right"><strong>'.$lang_extras['email'&#93;.'</strong></div>
<
input name="email" type="text" size="30" maxlength="100"><br>
<
div align="right">'.$lang_extras['subj'&#93;.'</div>
<
input name="subj" type="text" size="30" maxlength="255"><br>
<
div align="right"><strong>'.$lang_extras['msg'&#93;.'</strong></div>
<
textarea name="msg" cols="40" rows="10" wrap="VIRTUAL"></textarea><br>
<
input type="submit" name="Submit" value="Submit">
<
input type="reset" name="Submit2" value="Reset">
</
form>';

endtable&#40;&#41;;
pagefooter&#40;&#41;;
ob_end_flush&#40;&#41;;
?>



PS. To look at the way this thing is misbehaving visit the web-site in my signature and go to Contacts page :(

PPS. I have stripped all the formatting and excessive comments for this post only. Otherwise it would just clutter the code.

Joachim Müller

I can't see how this is supposed to be related to coppermine...

GauGau

catbegemot

It's related to coppermine in the following way: the pages were working "stand alone" but were not when put into coppermine environment. It was the same code, same everything, I just added whatever was in anycontent.php and - boom - they stopped working. As I stated in my first post:
QuoteI tested these exact pages without coppermine and they worked just fine
on the contrary to the testing with coppermine when they didn't.

But nevermind though, I already figured the whole thing now, so it is working, although in a different way :)

hyperion

Would you care to share what you did to work around the issue?
&quot;Then, Fletch,&quot; that bright creature said to him, and the voice was very kind, &quot;let&#039;s begin with level flight . . . .&quot;

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)