Jump to content

newbie ideas to expand forms code help please


paulmo

Recommended Posts

Based on "engage" section of linked page below, need to expand processed greeting to feature a time of day and theme-specific (dependent on radio field selection) greeting, followed by an article which would correspond to the radio-selected theme. Ex: "It's a grey morning Jane..." followed by text about gray weather. 

 

get/post/loop/while/for etc are terms i've been reading about and i'm guessing they'll figure into this expansion. if someone could please steer me in the direction to get started—much appreciated! barely familiar with mysql, have created a table previously and would like to incorporate a database into this as well. but just to get the basic idea down would be a start. thanks

 

http://releasecenter.org/interactive.php

 

 

 

<?php
//Check whether the form has been submitted
if (array_key_exists('check_submit', $_POST)){
   //Converts the new line characters (\n) in the text area into HTML line breaks (the <br /> tag)
   $_POST['Comments'] = nl2br($_POST['Comments']); 
   //Check whether a $_GET['Languages'] is set
   if ( isset($_POST['Colors']) ) { 
     $_POST['Colors'] = implode(', ', $_POST['Colors']); //Converts an array into a single string
   }

   //Let's now print out the received values in the browser
   echo "Greetings {$_POST['Name']},";
   
   echo " you are feeling {$_POST['theme']} at the moment.<br />";

} else {

Link to comment
Share on other sites

thanks for responding. again, i need to have a time-of-day-specific greeting, like Good morning Bob, followed by information that is exclusive to the checked radio field. i might have things like age, location, weather, which when submitted would print/call (get/post?) information exclusive to those variables. would this information be stored in mysql database?

 

the code i'm using is an edited copy/paste, so i can see how POST works basically. but loop/get/for/while or anything else about php is beyond me. i've read about all these terms but have no idea how to use them for what i'm trying to achieve.

 

definitely a step up from learning html/css. can someone show me the light? 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.