Jump to content

PHP Post coding - could someone explain what Im doing wrong please?


shabbaranks

Recommended Posts

Hi all,

 

Im currently modifying some example code for a form which a user submits. Initially the form asked the user to input thier username but I have managed to get it so that the username is populated from the current user login. What I am struggling to do is understand how the $post works.

 

Am I correct in thinking that

<tr>
<td> Name</td>
<td input name="contactname" id="contactname" class"secondary-bfe-inputs" value=>'$current_user->display_name.'</td>
</tr>

 

is holding the value of $current_user->display_name. and where I use

 

'.$_POST['contactname'].'

will show the value?

 

If not could you explain what I should be doing please? Thanks

Link to comment
Share on other sites

Ah ok - Im not too sure whats going on here but I had it working. Re started the server and now its not displaying again  :shrug: the code I now have is

 

<td>Name</td>
<td> <input type="text" input name="contactname" disabled="true" id="contactname" class="secondary-bfe-inputs" value='.$current_user->display_name.' /></td>

 

if I change the type="text" to type='text' the page doesnt work. Also my <?php tags are at the start and the end of the page hence why they arent in the above code.

 

Thanks

Link to comment
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.