Jump to content

Archived

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

tranphuongit

help me

Recommended Posts

I have file [b]exp.html.php[/b]:

<form name="question" method="post">
<input type="hidden" name="content" value="10">
</form>

<?php
$a=document.question.content.value;
?>


I want $a=10, how? thank

Share this post


Link to post
Share on other sites
Simple as:

$a = (int) $_POST['content'];

or this way, can determine if form post was a get or post:

$a = (int) ('GET' == strtoupper($_SERVER['REQUEST_METHOD'])) ? $_GET['content'] : $_POST['content'];


Assumes you want it to be an integer value.

Share this post


Link to post
Share on other sites

×

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.