Unstoppable Domains โ€” AI Assistant

Using PHP within Javascript

SpaceshipSpaceship
Watch

noswad

Established Member
Impact
1
Hi.

Is it possible to use PHP sessions within Javascript?

This is my code:

The PHP session would create a unique link ID.

PHP:
<script type="text/javascript" language="javascript" src="http://www.tkqlhce.com/placeholder-305771?SID=<?php session_start(); echo $_SESSION[user_name]; ?>&target=_top&text=%3Clink%3EClick+here+to+Join%3C%2Flink%3E&mouseover=N"></script>

Thanks for reading.
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
not directly, PHP is serverside, JS is client side. so all the output would be in the html/js code when it got the client.

but on the serverside you can mix the 2, but would suggest spliting the php code from the output (makes it easier in the long run. something like ..
PHP:
<?
session_start();
$sid = $_SESSION[user_name]; 
?>
<script type="text/javascript" language="javascript" src="http://www.tkqlhce.com/placeholder-305771?SID=<?=$sid?>&target=_top&text=%3Clink%3EClick+here+to+Join%3C%2Flink%3E&mouseover=N"></script>

noswad said:
Hi.

Is it possible to use PHP sessions within Javascript?

This is my code:

The PHP session would create a unique link ID.

PHP:
<script type="text/javascript" language="javascript" src="http://www.tkqlhce.com/placeholder-305771?SID=<?php session_start(); echo $_SESSION[user_name]; ?>&target=_top&text=%3Clink%3EClick+here+to+Join%3C%2Flink%3E&mouseover=N"></script>

Thanks for reading.
 
0
•••
Thanks for your help powerspike :hehe:
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy โ€” Live Options
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back