[Solved] PHP Multidimensional Array Access

Code should look something like this, if you were intending on using strings as your keys. $this_array= array( ‘string_name’ => ‘string’, ‘string_array’ => array( ‘string_key’ => ‘string_val’ ) ); Yes, you will access it by: $this_array[‘string_array’][‘string_key’]; 0 solved PHP Multidimensional Array Access

[Solved] How verify if input is numeric

is_numeric only checks 1 variable. You have to write a if statement like the following: if(is_numeric($valortotal) && is_numeric($porcentagem1) && is_numeric($porcentagem2) && is_numeric($porcentagem3) && is_numeric($porcentagem4)) { echo “Por favor, digite apenas nĂºmeros”; } Note: This only echo’s “Por favor, digite apenas nĂºmeros” if all the variables are numeric. solved How verify if input is numeric

[Solved] How can I create a method of finding the total number of possible combinations using a dynamic format [closed]

I being a number, there is 10 possibilities. S being a character, there is 26 possibilities. The total number of combinations is 10 power (TheNumberOfI) * 26 power (TheNumberOfS) This can be dynamically solved using a simple function that counts the number of S and the number of I and uses the results in the … Read more

[Solved] Can’t Insert to database CodeIgniter

Change your controller function with below code I think You are calling wrong model for inserting rating public function rateform($username,$id,$name) { $this->load->Model(‘Keluhan’); // load your model $rating = $this->input->post(‘rating’); $name2 = urldecode($name); $data = array ( ‘id’ => $this->input->post(‘id’), ‘username’ => $this->input->post(‘username’), ‘rating’ => $this->input->post(‘rating’) ); $result = $this->Keluhan->InsertRating($data); // change your model name where … Read more

[Solved] php download button without submiting back to page [closed]

Use $_GET use a hyperlink instead of a submit button. <?php if(isset($_GET[‘download’]) && $_GET[‘download’]){ header(‘Content-Description: File Transfer’); header(‘Content-Type: application/octet-stream’); header(‘Content-Type: application/octetstream’); header(‘Content-Disposition: attachment; filename=”‘.$file_real_name.'”‘); header(‘Content-Transfer-Encoding: binary’); header(‘Expires: 0’); header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0’); header(‘Pragma: public’); header(‘Content-Length: ‘ . (int)(filesize($file_path))); ob_clean(); flush(); readfile($file_path); } ?> <a href=”https://stackoverflow.com/questions/19016977/?download=true”>Download</a> 1 solved php download button without submiting back to page … Read more

[Solved] HTML Form Button

<form method=”post” action=”check_login.php”> <input class=”textbox” name=”username” type=”text” placeholder=”Login”> <input class=”textbox” name=”password” type=”password” placeholder=”Password”> <div id=”buttonPlace”> <p>Remember Me</p> <button id=”buttonLogin” type=”submit”>Sign up</button> </div> </form> solved HTML Form Button

[Solved] Trouble With PHP Function, passing arguments [duplicate]

<?php function setFont($text, $name, $size){ return “<div style=”font-family: $name ;font-size: $size”>”.$text.”</div>”; } echo setFont(“Hello”, “tahoma”, “19”); echo setFont(“Welcome”, “tahoma”, “19”); ?> 2 solved Trouble With PHP Function, passing arguments [duplicate]

[Solved] How to echo backslash then quote? [closed]

You are adding echo to a variable $text, if this is in javascript then you should echo the value using php in your javascript – like this var test=<?php echo $test; ?>. If you are using php then you should try implementing @Guilherme Nascimento’s answer, but concatanating not adding echo to your $text variable. So … Read more

[Solved] Syntax error: unexpected ;

You are missing if in } else ($role_type === ‘User’) { line it should be } else if($role_type === ‘User’) { if (Hash::check($password, $hashedPassword->password)) { $role_type = DB::select(‘select role_type from users where email = ?’, [$email]); if ($role_type === ‘Administrator’) { $request->session()->put(‘success’); return redirect()->route(‘admin’); } else if ($role_type == – ‘Staff’) { $request->session()->put(‘success’); return redirect()->route(‘staff’); … Read more