I am using Codeigniter in My website and it works very well in all browsers in windows or phones except in snapchat.
When I am trying to submit the form I get the message:
message undefined index 'clientname'
message undefined index 'clientmessage'
<form action="<?php echo base_url(); ?>R/H/212F32" method="POST">
<input type="text" name="clientname" placeholder="name">
<textarea rows="5" name="clientmessage" placeholder="message"></textarea>
<input type="submit" value="send" />
</form>
I tried using an extra button with javascript to popup message alert of clientname and clientmessage content but nothing happens so I guess that there is something that happening in snapchat browser ?
Edited : Controller 'T' That display the form
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class T extends MY_Controller {
public function __construct(){
parent::__construct();
}
function _remap($param) {
$this->index($param);
}
public function index($param)
{
$data = array();
$this->load->view('Head');
$data['code'] = $param;
$this->load->view('NewForm' , $data);
$this->load->view('Foot');
}
}
Controller 'R' That recive the form submited
<?php
class R extends MY_Controller {
public function H($c){
$this->load->view('Head');
$text = $_POST['clientname'];
$message = $_POST['clientmessage'];
//$this->input->post wont work also
// $this->input->post('clientname');
// $this->input->post('clientmessage');
$this->load->view('Foot');
}
}
UPDATED 10/05/2019 : I tried to do basic form submit like this :
index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Snapchat issue !</title>
<meta name="description" content="">
<meta name="author" content="">
</head>
<body>
<form action="./Test.php" method = "post">
First name:<br>
<input type="text" name="firstname" value="Turki">
<br>
Last name:<br>
<input type="text" name="lastname" value="Test123">
<br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
Test.php
<?php
var_dump($_POST);
?>
The result :
in Android:
array(2) { ["firstname"]=> string(5) "Turki" ["lastname"]=> string(7) "Test123" }
in IOS:
array(0) {}
same thing happen without codeigniter so I rolled it out , but I noticed the following : 1 - it work fine in Snapchat in Android , but the issue appear in IOS only 2- in IOS if the link was send using snapchat chat it will work fine too even in IOS , but if it was linked in Story the issue appear !!!!