Jump to content

Recommended Posts

<INPUT TYPE = "Text" VALUE ="0"
ID = "username2" NAME = "username2">

<?php
$value1 =  $_POST['username2'];
$nine=$value1;

$codx =$characters[$nine]->name;
?>

Im tring to get '0' in username2 inputbox

readit in php $nine

$codx =$characters[$nine]->name;


as you can see in my <?php code above
I cant get the 0 from this inputbox

It only works like this

<?php
$nine='0'
$codx =$characters[$nine]->name;
?>

What i need is to get the users
input. from a textbox on my page
called username2
they would enter between 0 and 8
as you can see its set to 0 on my
textbox, the 0 - 8 is the
character location
$characters[$nine]

the $nine will hold the number
between 0 - 8
My php code i cant read my texbox
input.

How do I read the user input
into my

my textbox post pulls the input

$nine =  $_POST['username2'];
$codx =$characters[$nine]->name;

i noticed it wouldn't work

it only works this way

$nine='0';
$codx =$characters[$nine]->name;

Let me know how to read in user input
from my username2 textbox.
Thanks in advance

sorry to repeat i needed to explain
so you can see my error.

Edited by Psycho
none
Link to comment
https://forums.phpfreaks.com/topic/309761-textbox-input/
Share on other sites

First please use the code icon (<>) for your PHP and select PHP or HTML for that code. It makes your code easier to read. Did you echo $value1 to make sure it is what you expect? As a guess, since you don't show that code, I suspect the problem is with the array $characters. Did you  var_dump that to make sure it is correct?

Link to comment
https://forums.phpfreaks.com/topic/309761-textbox-input/#findComment-1572960
Share on other sites

Sorry. For delay I m using POST.. To get 0 - 8 im using input username2 lets say i put 0 in username2 input when I click post i need to grab that 0 and pass it to my $charactors[$nine]->name

Its not reading my string $nine from my input box username2. 

Like i wrote earlier ^^^ it will only work this

(<

 

 

 

Then

	$nine='0';
$codx =$characters[$nine]->name;
	

When i write in javascript working with the input box i can read it into a string but  not in Php programming.

I m still learning php im sure this isnt that  hard to do.

Hope any experts in php here can see my issue.

 

Hope my code displays right.

 

About making code easy to read is it < code >  or (<  code. >) ill try both my bad if this dont work.

(<

	<form action="" method="post">
	<input disabled="disabled" style="background-color:white; color: white" type="text" name="subject" id="subject" size="1" style="display:none" value="1">
	<hr>
Password:
<br><input style="background-color:black; color: white" type="password" name="text_one" value="0923532">
	<button type="submit" name="ok">OK</button>
	
dec19/
<INPUT TYPE = "Text" VALUE =""
ID = "username2" NAME = "username2">
	</form>
	

Edited by thehubclick
Link to comment
https://forums.phpfreaks.com/topic/309761-textbox-input/#findComment-1572988
Share on other sites

On 12/29/2019 at 10:22 AM, gw1500se said:

First please use the code icon (<>) for your PHP and select PHP or HTML for that code. It makes your code easier to read. Did you echo $value1 to make sure it is what you expect? As a guess, since you don't show that code, I suspect the problem is with the array $characters. Did you  var_dump that to make sure it is correct?

I cant get code to display right. In (<>). I need  help

Link to comment
https://forums.phpfreaks.com/topic/309761-textbox-input/#findComment-1572991
Share on other sites

8 minutes ago, thehubclick said:

Thank you

 

8 minutes ago, thehubclick said:

Thank you

Thanks Barand that fixed my code displaying code inside

 my code 

correctly i will make sure to use it when posting my php or html code here.

Thanks again

 

 

Edited by thehubclick
Link to comment
https://forums.phpfreaks.com/topic/309761-textbox-input/#findComment-1572994
Share on other sites

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.