Jump to content

php in the head section


ianco

Recommended Posts

Hi all

 

I have some javascript code in the head section of my page but i want it to have php variables, 2 from a form and the other which i create.

 

 

so far the code i have is

echo '<!--
window.location = "http://www.domain.org/folder/' . $_POST["jou"] . '/';

echo $arb;

echo '/' .  $_POST["num"] . '/index.sht"
//-->';

which is include in and include script.

 

The script reads $_POST["jou"] and $_POST["num"] but doesn't output $arb (which is created from num in the form)

 

What do i need to do to it so that $arb is output?

 

Thanks

Ian

Link to comment
https://forums.phpfreaks.com/topic/196529-php-in-the-head-section/
Share on other sites

The rest of the php in the page is

<!-- @[a-zA-Z0-9]{6} $arb =  $_POST["arb"];
<?php

$num =  $_POST["num"];
$jou =  $_POST["jou"];

if(preg_match("/^b[a-zA-Z0-9]{7}$/",$num)) {
global $arb;
$arb = "b9";		
} else {
global $arb;		
$arb = "c0";
}
?>
-->

 

var_dump doesnt do anything either (nothing that i want anyway) and nor does $_POST['arb']

 

Here is the form

<form action="http://iancoates.uuuq.com/development/newy.php" method="post">
Journal:  <input type="text" name="jou" /><br>
Number:   <input type="text" name="num" /><br>

<input type="submit" />
</form>

nothing unusual here

 

ANy other suggestions?

 

thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.