Category : warnings

why am i getting this error: Warning: Illegal string offset ‘user_id’ in C:xampphtdocsMyProjectRozary.php on line 385? this is my code $login = new LogIn(); $user_data = $login->check_login($_SESSION[‘rozary_user_id’]); $post = new Post(); $id = $user_data[‘user_id’]; $posts = $post->get_posts($id); if ($posts) { foreach ($posts as $ROW) { $user = new User(); //line 384 $ROW_USER = $user->get_user($ROW[‘user_id’]); //line ..

Read more

please help me. I have a PHP script for registering new users but when clicking on the verification link then I’m facing "Warning: Trying to access array offset on value of type null". Two files where I’m facing a similar warning. No:1 if (isset($_GET[‘id’]) && isset($_GET[‘v’])){ $id=$_GET[‘id’]; $v=$_GET[‘v’]; if (checkverify()===false){ $vsql="SELECT * FROM users WHERE ..

Read more

this is my PHP code. <?php $conn = mysqli_connect("localhost","root",”,"sensor"); if ($conn) { mysqli_set_charset($conn,"utf8"); $q= "select * from temper"; $result=mysqli_query($conn, $q); while($row = mysqli_fetch_assoc($result)){ $output[] = $row; } echo json_encode($output); mysqli_close($conn); } else{ echo "probleme de connexion"; } ?> Someone’s : say that Access denied means that the authentication failed. That means there is an invalid ..

Read more

I have taken over a site and I am not a PHP professional. I get the following message: Illegal string offset ‘item’ in on line7 & Illegal string offset ‘label’ in on line8 Here is the code from the file: <?php if($menus = get_field(‘menu’,’header-general’)): ?> <div class="menu menu–main desktop"> <nav> <ul> <?php foreach($menus as $menu): ..

Read more

these are my code for form validation : <form action="<?php echo base_url().’data_laporan/tambah_aksi’;?>"method="post" enctype="multipart/form-data"> <div class="form-group"> <label>Jenis Laporan</label> <select class="form-control" name="jenis_laporan"> <option>Penemuan hewan</option> <option>Kehilangan Hewan</option> </select> </div> <div class="form-group"> <label>Jenis Hewan</label> <input type="text" name="jenis_hewan" class="form-control"> </div> <div class="form-group"> <label>Lokasi</label> <input type="text" name="lokasi" class="form-control"> </div> <div class="form-group"> <label>Deskripsi</label> <input type="text" name="deskripsi" class="form-control"> </div> <div class="form-group"> <label>Nama Pelapor</label> ..

Read more