Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9186515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:32:50+00:00 2026-06-17T19:32:50+00:00

I have a form : <?php $attr = array(‘id’=>’urlSubmit’); $urlInputAttr = array(‘name’=>’urlInput’,’value’=>’yourdomain.com’,’maxlength’=>’50’,’size’=>’25’); echo form_open(‘urlSubmission’,$attr);

  • 0

I have a form :

   <?php
        $attr = array('id'=>'urlSubmit');
        $urlInputAttr = array('name'=>'urlInput','value'=>'yourdomain.com','maxlength'=>'50','size'=>'25');
        echo form_open('urlSubmission',$attr);
        echo form_input($urlInputAttr);
        #echo form_submit('urlInput', '');
        echo form_close();
    ?>

a controller called urlsubmission

       $this->load->model('domaincheckmodel');

            $this->domaincheckmodel->verifyduplicates($this->input->post('urlInput'));   

and a function within a model(domaincheckmodel) which basically checks for duplicate records and inserts a new domain:

   function verifyduplicates($tldEntered){
    # $_POSTed value of urlInput
    ## Gather if the domain exists in db
    $DupDomains = $this->db->get_where('ClientDomain', array('tld'=>$tldEntered));

        if($DupDomains->num_rows() > 0 ){
            $this->load->view('err/domainexists'); ##domain already used
        }

        # else, no domain present, insert.
        else{
            #array of insert values:
            $insertNewDomain = array('tld'=>$this->input->post('urlInput',TRUE));
            $this->db->insert('ClientDomain', $insertNewDomain); 
            $this->load->view('success/domainfree'); ##domain is free and has been entered.
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:32:52+00:00Added an answer on June 17, 2026 at 7:32 pm
    $this->domaincheckmodel->verifyduplicates($this->input->post('urlInput')); 
    
    
    
    function verifyduplicates($tldEntered){
        # $_POSTed value of urlInput
        ## Gather if the domain exists in db
        $DupDomains = $this->db->get_where('ClientDomain', array('tld'=>$tldEntered));
    

    You’re passing from the form to the controller to the model, are you sure the post variable is staying populated? Try the above, capture the post variable in the controller and pass it to the model instead of trying to read it in the model itself?

    A little clarification on passing parameters to functions. You can do this via whatever is inside the brackets as follows.

    Controller:

    $myVariable = $this->someModel->someFunction($someParameter)
    

    Model:

    function someFunction($variableIWantToPopulateWithSomeParameter)
    

    So someParameter gets passed from the controller to the function name in the model. There is one thing to be aware of though and that is that model function now EXPECTS a parameter and if you don’t give it one, ie you call someFunction() you’ll get an error. This can be avoided by giving it a default value like this:

    function someFunction($myVariable = 1)
    

    What that is going to do is say if I don’t get a value passed to me I am going to make $myVariable equal to one, if I do I’ll overwrite 1 with the new value. So if you send two calls to that function this is what you can expect:

    //$myVariable is going to be 1, the default.
    

    $this->someModel->someFunction();

    //$myVariable is going to be 5, the value passed to it
    

    $this->someModel->someFunction(5);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that looks like this. <form action=index.php method=post> <select name=dropdownOption> <option
okay, i have a form dropdown <select name=select_category id=select_category> <option value=cheese-cakes>Cheesecakes</option> <option value=fruit-cakes>Fruitcakes</option> </select>
I have tried to different ways to clear a form: <form action=service.php id=addRunner name=addRunner
I have a form (signup.php) that pops up in a nyroModal window when I
What I have so far: I have a form in PHP that contain the
I have a php form which saves these values to the database: id rand
I have a PHP form with 4 text fields and 2 checkboxes. The checkboxes
I have a php form that saves the info to my database and sends
I have a php form that has a known number of columns (ex. top
I have a form named reg.php and its action is reg.php , i want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.