Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

hidden form value as $variable

Featured Replies

Hello

 

I am working on a form submit thingy for my new site (php). On the page wit the form, I generate a random 16 digit srting, which is then to be used to verify the users post. This works fine.

 

Except...

 

I want to declare the value of the random string as a hidden form variable ($activatecode), something like:

 

<input type="hidden" name="random" value= "<?php $activatecode ?>">

 

I need to do this so when the form is processed on the next page, the value of @activatecode is stored in my database, to be used later to activate the users posting.

 

It doesnt seem to be working? The $activatecode variable is being created by my random string function correcly, and everything else being passed as hidden, and non-hidden values by the form to the next page is working perfect

 

What is the correct syntax for declaring a variable as a value in a hidden form field

can you post the code? including the mysql query etc?

 

when i did something like this for a members database, i didnt use a var to insert it into the database, i just used the function

 

$query= mysql_query("INSERT INTO members(ID,username,password,email,sex,joindate,randomkey)VALUES ('NULL', '$username', '$password', '$email', '$sex', '$date', '".FUNCTIONAME(value, value)."')") or die(mysql_error());

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.