1

I am trying to call the form_open function and pass a value to the function it's calling. I'm trying to pass the value for $data->advisee_id. Once it calls the setAdvisees function I want it to echo the value. I've tried a number of things and I'm thinking I might need to pass it into the array which is the second parameter for form open. Does anyone know how I would do this? The below code I have currently gives an error when form_open is called stating:

"An Error Was Encountered. The URI you submitted has disallowed characters."

eligibletoenroll_view.php

        <?= form_open('app/staff/advisees/setAdvisees($data->advisee_id)', array(
    'class' => 'user-contact',
)) ?>

advisees.php

   function setAdvisees($advisee_id) {
        echo $advisee_id;
0

1 Answer 1

1

Just send like this

<?= form_open('app/staff/advisees/setAdvisees/$advisee_id)'

This sill act as

<form action="app/staff/advisees/setAdvisees/$advisee_id" 

If advise id coming from array then before form open

$advisee_id = "some thing"

Example

<form action="app/staff/advisees/setAdvisees/25" 
Sign up to request clarification or add additional context in comments.

3 Comments

hmm it's still giving the error with <form action="app/staff/advisees/setAdvisees/$advisee_id"
if I set it to <form action="app/staff/advisees/setAdvisees/advisee_id" it works but is showing the wrong advisee_id number
what you pass it will come to function

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.