
sonnieboy
Members-
Content Count
151 -
Joined
-
Last visited
Community Reputation
0 NeutralAbout sonnieboy
-
Rank
Advanced Member
Profile Information
-
Gender
Not Telling
-
My app is constantly being hacked. Please help!
sonnieboy replied to sonnieboy's topic in PHP Coding Help
public function AddFiles($name = 'item') { // If the files array has been set if(isset($_FILES[$name]['name']) && !empty($_FILES[$name]['name'])) { // Remove empties $_FILES[$name]['name'] = array_filter($_FILES[$name]['name']); $_FILES[$name]['type'] = array_filter($_FILES[$name]['type']); $_FILES[$name]['size'] = array_filter($_FILES[$name]['size']); $_FILES[$name]['tmp_name'] = array_filter($_FILES[$name]['tmp_name']); // we need to differentiate our type array names $use_name = ($name == 'item')? 'Ad -
My app is constantly being hacked. Please help!
sonnieboy replied to sonnieboy's topic in PHP Coding Help
Of course if as suggested by others you are being hacked by your poorly written queries I just love it when some people think it makes them feel more important by putting others down. -
public function AddFiles($name = 'item') { // If the files array has been set if(isset($_FILES[$name]['name']) && !empty($_FILES[$name]['name'])) { // Remove empties $_FILES[$name]['name'] = array_filter($_FILES[$name]['name']); $_FILES[$name]['type'] = array_filter($_FILES[$name]['type']); $_FILES[$name]['size'] = array_filter($_FILES[$name]['size']); $_FILES[$name]['tmp_name'] = array_filter($_FILES[$name]['tmp_name']); // we need to differentiate our type array names $use_name = ($name == 'item')? 'Ad
-
Just one question. The second code is the working version, although I wanted to make some changes to it to remove all the spouseDetails info but this forum is a bit difficult to navigate. First, it does not allow you to post your code where you want it. It pushes all codes up. Maybe I am the problem, I have not figured out to post code here and display it at top or bottom. Second issue is there is no way to go back and make changes to your own thread. I was attempting to show the code that works for just one checkbox, grid1Details and how to make it work for more than one c
-
<script type="text/javascript"> function validate() { var checkbox = document.getElementById("<%=grid1Details.ClientID %>"); var txtsourcename = $("[id*='txtsourcename']")[0]; var txtsourceaddress = $("[id*='txtsourceaddress']")[0]; var txtsourceincome = $("[id*='txtsourceincome']")[0]; //spouse check checkbox = document.getElementById("<%=spouseDetails.ClientID%>"); var txtspousename = $("[id*='txtspousename']")[0]; var txtspouseaddress = $("[id*='txtspouseaddress']")[0]; var txtspouseincome = $("[i
-
Pastor is the Pastor of a Ministry if I understand you correctly. So, that table is where pastor and ministry information is stored. Then there is another table stores pastor/ministry related information. So, to add information to this table, user is required to select the pastor from dropdown. Once that pastor is selected, his/her ministry is automatically selected too based on the pastor of that ministry.
-
<?php $conn=mysqli_connect("localhost","myuuser","mypass","mydb"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $select_query="Select pastorname, ministryname from xphias_clients"; $select_query = mysqli_query( $conn,$select_query); echo "<select name='pastorsname' id='pastorsname' class='form-control'>"; while ($rc= mysqli_fetch_array($select_query) ) { echo "<option value='" .$rc['pastorname'] . "'>" . $rc['pastorname'] . "</option>"; } echo "</select>"; ?></td>
-
My update code is not updating the database with values
sonnieboy replied to sonnieboy's topic in PHP Coding Help
Thank you very much. Stupid me. -
<?php error_reporting(E_ERROR | E_WARNING | E_PARSE); // Initialize connection to database $conn=mysqli_connect("localhost","myuser","mypass","mydb"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } function render_error($settings = array("title"=>"Failed","body"=>"Sorry, your submission failed. Please go back and fill out all required information.")) { ?> <h2><?php echo (isset($settings['title']))? $settings['title']:"Error"; ?></h2> <p><?php echo (isset($settings['body'
-
Your solution worked perfectly,however. Thank you so very much sir
-
<td><INPUT TYPE="TEXT" NAME="pastorsname[]" SIZE="14"></td> <td><INPUT TYPE="TEXT" NAME="ministriesname[]" SIZE="14"></td> <td><INPUT TYPE="TEXT" NAME="xstartdate[]" SIZE="10"></td> <td><INPUT TYPE="TEXT" NAME="clientname[]" SIZE="14"></td> <td><INPUT TYPE="TEXT" NAME="url[]" SIZE="14"></td> but you are suggesting to have them like below? <td><INPUT TYPE="TEXT" NAME="record[1][pastorsname]" SIZE=
-
<?php $dbhost = "localhost"; $dbname = "mydb"; $dbusername = "xxxx"; $dbpassword = "mypass"; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $pdo = new PDO("mysql:host=$dbhost;dbname=$dbname", $dbusername, $dbpassword); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stmt = $pdo->prepare("INSERT INTO xphias (pastorsname, ministriesname, xstartdate,clientname, url) VALUES (?,?,?,?,?)"); for ($i = 0; $i < count($_POST['pastorsname']); $i++) { $stmt->execute(array( $pastorname = $_POST['pastorsname'][$i],
-
newbie error: Notice: Array to string conversion in ...
sonnieboy replied to sonnieboy's topic in PHP Coding Help
This has worked. Thank you very much, I just have to add error checking and successful submission message,