Jump to content

Form and Filename PHP


PriteshP23

Recommended Posts

Hello,

 

I would like to solve form problem.  Here is my code:

/************************** Step 1: Select Cell************************************/

if(isset($_POST['SmartPhone']))
$checked1=$_POST['SmartPhone'];
$form->add_checkbox('SmartPhone','SmartPhone',$checked1);

if(isset($_POST['Apple']))
$checked2=$_POST['Apple'];
$form->add_checkbox('Apple','Apple',$checked2);

/************************** Step 2: Select Model************************************/	

if($_POST['SmartPhone']==false and $_POST['Apple']==false)
{
  $this->add(new error('<span style="color:red">Select your cell..!!</span>'));
  $this->step1();
  return;
}
if(isset($_POST['S4']))
  $tech2=$_POST['S4'];
$form->add_checkbox('S4','S4',$tech2);

if(isset($_POST['iPhone 5']))
  $tech3=$_POST['iPhone 5'];
$form->add_checkbox('iPhone_5','iPhone 5',$tech3);

if(isset($_POST['iPhone 5s']))
  $tech1=$_POST['iPhone 5s'];
$form->add_checkbox('iPhone_5s','iPhone 5s',$tech1);

//In addition, i want to know how to put "Select All" button here 
// in order to SELECT ALL MODELs: S4, iPhone 5, iPhone_5s
  
/************************** Step 3: File Generation************************************/	

if($_POST['S4']==false and $_POST['iPhone_5']==false and $_POST['iPhone_5s']==false)
{
  $this->add(new error('<span style="color:red">Please enter your model..!</span>'));
  $this->step2();
  return;
}

$date = date('Y-m-d_H-i-s');

// Filename should be like this format "cell_datetime.xml"
// For example: SmartPhone_20130910183023.xml or Apple_20130910183023.xml

// Any idea how to create such filename??

Thanks for your time. :)

Edited by PriteshP23
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.