User Profile

Collapse

Profile Sidebar

Collapse
Antonio Bacasno
Antonio Bacasno
Last Activity: Oct 12 '11, 09:40 AM
Joined: Sep 21 '11
Location: Philippines
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Undefined Index Error While Inputting A New User

    I'm creating a page where I will create an account for authorized users. But I always get into this Undefined Index error. There are only two variables, but I can't seem to find what is wrong? Could someone please check my code and see what is wrong? I've also linked some images. Sorry for my noobiness.






    +++THE FORM_FUNCTIONS CODE+++

    Code:
    <?php
    function check_required_fields($required_array)
    ...
    See more | Go to post

  • I have finally figured out the problem. It was all syntax. I've put an extra space after LOCATION (header), which PHP doesn't accept. It is now working.
    See more | Go to post

    Leave a comment:


  • Antonio Bacasno
    started a topic Doesn't Redirect After Successful Update
    in PHP

    Doesn't Redirect After Successful Update

    Can somebody please help me? I would like to redirect to a new page once a successful update was performed, but my redirect code doesn't work. After a successful update, it doesn't perform the redirect, instead it opens up a blank version of the current page. Can somebody please check my code and see what's wrong with it? Thanks.

    ***AFTER A SUCCESSFUL UPDATE, IT OPENS UP A BLANK VERSION OF THIS PAGE INSTEAD OF REDIRECTING TO UPDATEDATA.PHP* **...
    See more | Go to post

  • Antonio Bacasno
    started a topic Error Handling If A Record Is Not Found
    in PHP

    Error Handling If A Record Is Not Found

    I would like to kindly seek some coding assistance. I would like to put some kind of error handling in my code if, say, an ID number was entered, but that ID number has no existing record in the database. I have entered some kind of error-checking in my code that will redirect if an ID with no record was entered, but it just doesn't work. The code doesn't affect the page functionality if I entered an ID number with existing records, it only affects...
    See more | Go to post

  • Antonio Bacasno
    replied to Update Doesn't Work
    in PHP
    Wow, thanks dude, that surely solves the UPDATE problem. But, I can't make my redirect to work. When a successful update was performed, it should redirect to UPDATEDATA.PHP. What happens is it only opens a blank PROCESSFORM_UPD ATE.PHP page.

    Code:
    <?php include("includes/db_connect.php"); ?>
    <?php require_once("includes/functions.php"); ?>
    
    <?php
    
    	$equipid = mysqli_real_escape_string($db_cxn,
    ...
    See more | Go to post

    Leave a comment:


  • Antonio Bacasno
    replied to Update Doesn't Work
    in PHP
    Could you please elaborate?
    See more | Go to post

    Leave a comment:


  • Antonio Bacasno
    replied to Update Doesn't Work
    in PHP
    Please find the linked images. As per your suggestion, I copied the PHP string and then pasted it on the MySQL sql query, and it successfully updated my dbase.

    ***The data to be be sent as an update***

    ***Update failed, copied the query string***

    ***Database doesn't show any update activity at all***

    ***Pasted the copied string***

    ***Query was a success!***

    ...
    See more | Go to post

    Leave a comment:


  • Antonio Bacasno
    replied to Update Doesn't Work
    in PHP
    You mean the whole UPDATE string from my PHP and then pasting it to the MySQL sql query? Ok, I'll try it, thanks for the advice, hope this helps...
    See more | Go to post

    Leave a comment:


  • Antonio Bacasno
    replied to Update Doesn't Work
    in PHP
    I only tried a manual update of my database using the MySQL console to check if the commands are right and working if encoded directly in MySQL. My MySQL version has GUI (I'm using WAMP), so I can also directly check if my webpage did changed my database. Right now, I don't really know what's the problem with my code, the data variables from GETDATA page is being transferred to my PROCESSING page, as the print_r and var_dump shows from the imaged...
    See more | Go to post

    Leave a comment:


  • Antonio Bacasno
    replied to Update Doesn't Work
    in PHP
    If you mean if I tried updating via the MySQL console, YES, I tried that and it works fine. I was able to update the database manually. I'm sorry about the image, I just can't have a larger image due to the forum restrictions (500 x 600) so I have to resize it before posting it here. Please find again the image on this link:

    http://i729.photobucket.com/albums/w...pdateError.jpg



    Also, I made...
    See more | Go to post

    Leave a comment:


  • Antonio Bacasno
    started a topic No Record Found Error Handling
    in PHP

    No Record Found Error Handling

    Please help me. I would like to put some code that will produce an error message if the ID number entered is still non-existent, then returns to the previous page. I've tried using mysqli_num_rows , but it doesn't work, maybe I used the wrong function. Please find the attached code.

    ***RETRIEVE DATA OF CORRESPONDING ID NUMBER***
    Code:
    <?php require_once("includes/db_connect.php"); ?>
    <?php require_once("includes/functions.php");
    ...
    See more | Go to post

  • Antonio Bacasno
    replied to Update Doesn't Work
    in PHP
    I tried revising the code of my PROCESSING page as per your suggestion, and still the same problem occurred. Please kindly check my code. Also, I've attached an image showing the error.

    Code:
    <?php include("includes/db_connect.php"); ?>
    <?php require_once("includes/functions.php"); ?>
    
    <?php
    
    	$equipid = mysqli_real_escape_string($db_cxn, trim(strip_tags($_POST['equipid'])));
    ...
    See more | Go to post

    Leave a comment:


  • Antonio Bacasno
    started a topic Update Doesn't Work
    in PHP

    Update Doesn't Work

    My UPDATE script just doesn't work. I just couldn't find what was wrong, every variable is declared. Please find what's wrong with my code. Thanks.

    ***THIS IS THE CODE FROM WHERE THE EDITING WILL TAKE PLACE***
    Code:
    <?php require_once("includes/db_connect.php"); ?>
    <?php require_once("includes/functions.php"); ?>
    <?php
    	
    	$equipid = mysqli_real_escape_string($db_cxn,
    ...
    See more | Go to post

  • Antonio Bacasno
    replied to Data Missing at $_POST
    in PHP
    Whew! I've resolved my issues, many thanks to this forum. I copied the EQUIPCODE, LOCATIONCODE and DATESELECTION scripts from my MAIN page and replace those inside the FUNCTIONS, and it worked! The form tags in my FUNCTION may have been the culprit. Thanks for the reminder, I didn't notice that I've already nested forms. Newbie errors. XD
    See more | Go to post

    Leave a comment:


  • Antonio Bacasno
    replied to Data Missing at $_POST
    in PHP
    The EQUIPCODE function is basically the same scripts that would work if I just put it as any other scripts on my MAIN PAGE. I want to put the EQUIPCODE scripts in a function so that I can reuse it. If EQUIPCODE works if it isn't called from a function, I think it would also work if I put the scripts inside a function and call it from there. What's confusing is that LOCATIONCODE function works fine when LOCATIONCODE and EQUIPCODE are practically the...
    See more | Go to post

    Leave a comment:


  • Antonio Bacasno
    started a topic Data Missing at $_POST
    in PHP

    Data Missing at $_POST

    I am having some problem with posting a data. I want to call the data of EQUIPCODE as a function, but then, during POSTING of the data, it was missing. The odd thing is, EQUIPCODE AND LOCATIONCODE are almost the same scripts, difference only in some variable names. I can POST my LOCATIONCODE but, EQUIPCODE got lost in the middle of POSTING. Instead, it shows this UNDEFINED INDEX error. Could somebody please check my code and guide me to what may...
    See more | Go to post

  • Antonio Bacasno
    replied to Row Added But No Data Inserted?
    in PHP
    The problem is now resolved. What I did was do away with the ADDDATA page and just insert the record at the PROCESSFORM page, taking into account character escaping. It is now working as it should be. Here is my new code for the revised PROCESSFORM page. Thanks for the help.

    NEW PROCESS FORM PAGE

    Code:
    <?php include("includes/db_connect.php"); ?>
    <?php require_once("includes/functions.php");
    ...
    See more | Go to post

    Leave a comment:


  • Antonio Bacasno
    replied to Row Added But No Data Inserted?
    in PHP
    Thanks for the quick reply. I inserted a var_dump and a print_r to my ADDDATA script and they came up empty actually. It returned an error but when I checked my database, it added another row. I really don't understand it. And what do you mean by "no precautions against SQL injection attacks?" I've revised both my PROCESS and ADDDATA scripts. Also, I've attached some new images showing the results. Thanks.

    PROCESS_STRING_ ESCAPED...
    See more | Go to post

    Leave a comment:


  • Antonio Bacasno
    started a topic Row Added But No Data Inserted?
    in PHP

    Row Added But No Data Inserted?

    Hi. Please excuse my noobiness, but I'm new to PHP. My problem is data was not inserted into the database but PHP didn't return any error. Row was added since there was a new ID number, but then the rest of the columns are blanks and Sequence No and Date inserted 0's(zeros) instead of the real data. Could you kindly please check my code for any discrepancies? Please also check the images attached. Thanks.

    ***PROCESS PAGE***
    ...
    See more | Go to post

  • Antonio Bacasno
    replied to Notice: Undefined Index: ...
    in PHP
    Well, thanks anyway. I was able to solve it, but it was not pretty at all. Maybe I'll just figured it out later. I just need a working database right now. My problem is more on code re-factoring. Thanks again.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...