Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.