Jump to content

problem with form variable name being used not input


datto510

Recommended Posts

Because it isn't using a variable in the first place. All you did was make a string that contains an apostrophe, the word "jobno", another apostrophe, a period, and "xslx".

 

If you want a variable in there then put a variable in there.

if (!isset($_POST["jobno"])) {
	// error: value missing
} else if ($_POST["jobno"] == "") {
	// error: empty value
} else if (!ctype_digit($_POST["jobno"])) { // replace with whatever validation you need
	// error: invalid jobno
} else {
	$jobno = $_POST["jobno"];
}

// ...

$objWriter->save($jobno . ".xlsx");
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.