session email id

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
sardar_sajjad
User
Posts: 6

session email id

Post by sardar_sajjad »

Dear Reader

How can I catch session id if it is email id in custom files and also is it possible to insert value from customer file to new table in database?
under customer file>test.php>custom templates>contents I am using
$c_email=$_SESSION['email'];
but I am not able to get session email(its also the user name to login) in variable $c_email
Need your help.

Thanks
Sajjad


mobhar
User
Posts: 11660

Post by mobhar »

Assume you've already setup "Email" as "User ID Security" from "Advanced Security", then you may simply use:

Security()->SessionUserID()


sardar_sajjad
User
Posts: 6

Post by sardar_sajjad »

Dear Mobhar

Thank you for the support. I am able to get session ID as per your advise. in same question at second phase after get record form 1 table or session I want to insert same record on 2nd table but when I click submit button in my custom file it is not getting any action.
below is the little code for your reference.

<td colspan="2"><input type="submit" name="confirm_insert" value="Confirm" /> </td>
<?php
$con = mysqli_connect ("localhost","root","","promo");
if(isset($POST['confirm_insert'])){
//text data variables
$sale_id = $
POST['sal_id'];
$user_id = $_POST['user_id'];
$p_insert = "insert into promoin (sale_id,u_id) values ('$sale_id','$user_id')";
$run_p= mysqli_query($con, $p_insert);

if($run_p){
	
	echo"<script>alert ('Promoin Inserted Succesfully')</script>";
	}
}
?>

Note: the custom file name is test3.php, also i didn't found any form (<from.......> </form>) tag option in customer file settings. because on submit and insert form tag required.

Your help required.

Thanks
Sajjad


mobhar
User
Posts: 11660

Post by mobhar »

Then make sure you have already included the "<form ...> </form>" tags in your Custom Files.


sardar_sajjad
User
Posts: 6

Post by sardar_sajjad »

Hi,

Thank you it's ok now.

Sajjad


Post Reply