Email settings parameters [closed]

I’m trying to create a email login and registration page, I got some code from the internet, what parameters can I put for gmail.

 <?php

//Database details
   define("DBHOST",'localhost');
   define("DBNAME", 'login-system');
   define("DBUSER",'root');
   define("DBPASS", '');

//MAIL SETTINGS
    define("EMAIL", '[email protected]');
    define("SECRET", 'xxx');
    define("MAILHOST", '?');
    define("MAILSECURE",'?'); //or ssl
    define("MAILPORT",'?');
  ?>

How to check if a promocode is valid in .php [closed]

So I wanna make a promocode system and it needs to be able to check if the promocode has only been redeemed once, is valid, is not expired, and it needs to add the item to the user’s inventory. When I say promocode, I mean when you redeem it on the promocode page, it adds an item to your inventory, as long as it’s valid, not like a coupon code. Could someone please give me headers on how to do it?

I tried

@extends('layouts.default', [
    'title' => 'Promocodes'
])

@section('meta')
    <meta name="routes" data-redeem="{{ route('account.promocodes.redeem') }}">
@endsection

@section('js')
    <script src="{{ asset('js/promocodes.js') }}"></script>
@endsection

@section('content')
    <div class="row">
        <div class="col-md-4">
            <h4>How It Works</h4>
            <div class="card">
                <div class="card-body">
                    <p>Enter special codes in the text box and press the button for unique and special items!</p>
                </div>
            </div>
        </div>
        <div class="col-md-8">
            <h4>Promocodes</h4>
            <div class="card">
                <div class="card-body">
                    <form id="codeForm">
                        <div class="input-group">
                            <input class="form-control" type="text" name="code" placeholder="Code" required>
                            <div class="input-group-append">
                                <button class="btn btn-success" type="submit">Redeem</button>
                            </div>
                        </div>
                    </form>
                    <div id="message"></div>
                </div>
            </div>
            <h4>Current Code Items</h4>
            <div class="card">
                <div class="card-body" @if (count($items) > 0) style="padding-bottom:0;" @endif>
                    <div class="row">
                        @forelse ($items as $item)
                            <div class="col-4 col-md-3">
                                <div class="card has-bg" style="border:none;padding:{{ itemTypePadding($item->type) }};">
                                    <a href="{{ route('catalog.item', [$item->id, $item->slug()]) }}" target="_blank">
                                        <img src="{{ $item->thumbnail() }}">
                                    </a>
                                </div>
                            </div>
                        @empty
                            <div class="col">There are currently no code items.</div>
                        @endforelse
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

before realizing it was in the wrong language

remove extra column of data gotten from pdo [duplicate]

I implemented a full text search in my MySql Database using php and it works well but whenever I get a data from the database it comes with extra column of a string of numbers with the value of the column before it

        "id": 15,
        "0": 15,
        "userId": "uid",
        "1": "uid",
        "name": "Bright",
        "2": "Bright",
        "mail": "[email protected]",
        "3": "[email protected]",
        "number": "070",
        "4": "070",
        "gender": "",
        "5": "",

This is my search query


///....

 public function query($query, $params = [])
    {
        try {
            $this->statement = $this->connection->prepare($query);

            $this->statement->execute($params);

            return $this;
        } catch (PDOException $e) {

            abort($e->errorInfo[2], 500);
        }
    }

///....

if ($method === 'GET' && !$id) {

    $user = $db->query("SELECT * FROM users WHERE MATCH (name) AGAINST (? IN BOOLEAN MODE) LIMIT 10", ['bright -Bauchi'])->all();
    echo Response::res("Successfully retrieved users", $user);

}

And this is how i created my fulltext index

CREATE FULLTEXT INDEX user_index_index ON users (name);

How do i remove that unneccessary info from my data

Replacing substrings of nested arrays with a value from another array

The loop below outputs from the $defaultValues ​​values, there are 2 nested arrays in this array which are “colors” and “lessons”.

This loop also takes the substring values ​​from the $search array and replaces them with the values ​​from the $replace.

Question: How to replace nested array clause value “colors” and “lessons” from $defaultValues ​​

values: “colors”=>[“4”, “5”, “6”] and “lessons” =>[“7 ” , ” 8″, “9”] from $replace”

I can’t figure out how to do this, my current code outputs this:

Name: 1
Age: 2
Whe are u from: 3
Your favorite color: 4
Choose courses: 7
Your comment: 10

I would like the code to output this:

Name: 1
Age: 2
Whe are u from: 3
Your favorite color: 4,5,6
Choose courses: 7,8,9
Your comment: 10

$defaultValues = [
"name"     =>  "Name:                   <div class='user'>     write your name                     </div>", 
"age"      =>  "Age:                    <div class='age'>      enter your age                      </div>",
"from"     =>  "Whe are u from:         <div class='from'>     write where are you from            </div>", 
"colors"   =>  ["Your favorite color:   <div class='colors'>   you didn't say your favorite color  </div>"],        
"lessons"  =>  ["Choose courses:        <div class='lessons'>  you have not chosen any course      </div>"],
"comment"  =>  "Your comment:           <div class='comment'>  no comments                         </div>",     
];
 
$search = [
"name"     =>  "write your name", 
"age"      =>  "enter your age", 
"from"     =>  "write where are you from", 
"colors"   =>  ["you didn't say your favorite color"],        
"lessons"  =>  ["you have not chosen any course"],
"comment"  =>  "no comments",   
];
 
$replace = [
"name"     =>  "1", 
"age"      =>  "2",
"from"     =>  "3",
"colors"   =>  ["4", "5", "6"],        
"lessons"  =>  ["7", "8", "9"],
"comment"  =>  "10",       
];
 
 
foreach($defaultValues as $key => $items){
echo "<div class='block'>";
 
if(is_array($items)){
foreach($items as $child){
$items = str_replace($search[$key], $replace[$key], $child);
}}
 
echo $items = str_replace($search[$key], $replace[$key], $items);   
 
echo "</div>";  
}

Is it possible to use hex color as URL?

is it possible to use hex color code as url for image background;
i have this code


class=”bg-image opacity-5 ppt-lazy-img-8935 js-image-preload-set visible” data-ppt-image-bg=”” style=”background-image:url(‘#8B7355’);” data-bg=”#8B7355″>
 


I only use color hex “#8B7355” in this code and its not working, if someone knows a solution please help
thanks

Disable Button and change button text on click after ajax success function call

I am working on PHP ajax project. I want to disable and change the button’s text after the success function call in ajax. my ajax function is working fine and I am getting the desired output. just one thing is remaining which is the button thing.
Here is my code for ajax.

 $(document).ready(function () {

  $(document).on("click", "#add_btn", function (e) {
    e.preventDefault();
    var id = $(this).val();
    var cus_id = $('#customer_selection').val();
    if (!cus_id) {
      alert("Please select a customer")

    } else {

      $.ajax({
        url: "add_selection_script.php",
        type: "POST",
        data: {
          id: id,
          cus_id: cus_id
        },
        success: function (data) {
          // here i want to change button text and disable for click button only
            not others because my buttons are dynamic
          prop("disabled", true);
          html("Added");

        }
      });
    }
  });
});

here is the button code

<button type="submit" id="add_btn" value="<? echo $id; ?>">Add to selection</button>

Node Position In Tree


<div id="tree-container"></div>

<script src="<?php echo base_url('d3js-nettree/js/d3.js');?>" type="text/javascript"></script>
<script>
<?php if(isset($params['user_code'])){ ?>
treeJSON = d3.json("<?php echo base_url('d3js-parse/'.$params['user_code'].'.json');?>", function(error, treeData) {
    // Calculate total nodes, max label length
    var totalNodes = 0;
    var maxLabelLength = 0;
    // Misc. variables
    var zoomFactor = 1;
    var i = 0;
    var duration = 750;
    var root;
    var rectWidth = 160, rectHeight = 125;

    // size of the diagram
    var viewerWidth = $("#tree-container").width();
    var viewerHeight = 500;

    var tree = d3.layout.tree()
        .size([viewerWidth, viewerHeight]);

    // define a d3 diagonal projection for use by the node paths later on.
    var diagonal = d3.svg.diagonal()
        .projection(function(d) {
            return [d.x, d.y];
        });

    // A recursive helper function for performing some setup by walking through all nodes
    function visit(parent, visitFn, childrenFn) {
        if (!parent) return;

        visitFn(parent);

        var children = childrenFn(parent);
        if (children) {
            var count = children.length;
            for (var i = 0; i < count; i++) {
                visit(children[i], visitFn, childrenFn);
            }
        }
    }

    // Define the zoom function for the zoomable tree
    function zoom() {
        svgGroup.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")");
    }

    // define the zoomListener which calls the zoom function on the "zoom" event constrained within the scaleExtents
    var zoomListener = d3.behavior.zoom().scaleExtent([0.1, 3]).on("zoom", zoom);

    d3.selectAll('button').on('click', function(){
        if(this.id === 'zoom_in') {
            zoomFactor = zoomFactor + 0.2;
            zoomListener.scale(zoomFactor).event(d3.select("#tree-container"));
        }
        else if(this.id === 'zoom_out') {
            zoomFactor = zoomFactor - 0.2;
            zoomListener.scale(zoomFactor).event(d3.select("#tree-container"));
        }
        else if(this.id === 'up_level') {
            updateNewTree("ID04838614");
        }
    });

    // define the baseSvg, attaching a class for styling and the zoomListener
    var baseSvg = d3.select("#tree-container").append("svg")
        .attr("width", viewerWidth)
        .attr("height", viewerHeight)
        .attr("class", "overlay")
        .call(zoomListener);

    // Function to center node when clicked/dropped so node doesn't get lost when collapsing/moving with large amount of children.
    function centerNode(source) {
        scale = zoomListener.scale();
        x = -source.x0;
        y = -source.y0;
        x = x * scale + viewerWidth / 2;
        y = y * scale + viewerHeight / 2;
        d3.select('g').transition()
            .duration(duration)
            .attr("transform", "translate(" + x + "," + y + ")scale(" + scale + ")");
        zoomListener.scale(scale);
        zoomListener.translate([x, y]);
    }
    // Call visit function to establish maxLabelLength
    visit(treeData, function(d) {
        totalNodes++;
        maxLabelLength = Math.max(d.distributor_code.length, maxLabelLength);

    }, function(d) {
        return d.children && d.children.length > 0 ? d.children : null;
    });

    // define click event
    function click(d) {
        console.log("clicked");
        // if (d3.event.defaultPrevented) return; // click suppressed
        //d = toggleChildren(d);
        if(d.url !== "") {
            window.open(d.url, "_self");
        } else {
            updateNewTree(d.distributor_code);
        }
        update(d);
        centerNode(d);
    }

    function update(source) {
        // Compute the new height, function counts total children of root node and sets tree height accordingly.
        // This prevents the layout looking squashed when new nodes are made visible or looking sparse when nodes are removed
        // This makes the layout more consistent.
        var levelWidth = [1];
        var childCount = function(level, n) {

            if (n.children && n.children.length > 0) {
                if (levelWidth.length <= level + 1) levelWidth.push(0);

                levelWidth[level + 1] += n.children.length;
                n.children.forEach(function(d) {
                    childCount(level + 1, d);
                });
            }
        };
        childCount(0, root);
        var newWidth = d3.max(levelWidth) * 300; // 300 pixels per line
        tree = tree.size([newWidth, viewerHeight]);
        
        // Compute the new tree layout.
        var nodes = tree.nodes(root).reverse(),
            links = tree.links(nodes);

        // Set widths between levels based on maxLabelLength.
        nodes.forEach(function(d) {
            //d.y = (d.depth * (maxLabelLength * 10)); //maxLabelLength * 10px
            // alternatively to keep a fixed scale one can set a fixed depth per level
            // Normalize for fixed-depth by commenting out below line
             d.y = (d.depth * 200); //200px per level.
        });

        // Update the nodes…
        node = svgGroup.selectAll("g.node")
            .data(nodes, function(d) {
                return d.id || (d.id = ++i);
            });

        // Enter any new nodes at the parent's previous position.
        var nodeEnter = node.enter().append("g")
            .attr("class", "node")
            .attr("transform", function(d) {
                return "translate(" + source.x0 + "," + source.y0 + ")";
            })
            .on('click', click);

        nodeEnter.append("image")
            .attr("href", "<?php echo base_url('assets/images/people.png');?>")
            .attr("x", -rectWidth/4)
            .attr("y", -rectHeight-75)
            .attr("width", 75)
            .attr("height", 75);

        nodeEnter.append("rect")
            .attr('class', 'nodeRect')
            .attr("x", -rectWidth/2)
            .attr("y", -rectHeight)
            .attr("rx", 10)
            .attr("ry", 10)
            .attr("width", rectWidth)
            .attr("height", rectHeight)
            .style("fill", function(d) {
                //return d._children ? "lightsteelblue" : "#fff";
            });

        nodeEnter.append("text")
            .attr('class', 'txt1')
            .attr("x", 0)
            .attr("y", -rectHeight+15)
            .attr('class', 'textBold')
            .attr("text-anchor", "middle")
            .text(function(d) {
                if(d.distributor_code === "") return "";
                else return d.user_code;
            });
        nodeEnter.append("text")
            .attr('class', 'txt2')
            .attr("x", 0)
            .attr("y", -rectHeight+25)
            .attr("text-anchor", "middle")
            .text(function(d) {
                if(d.distributor_code === "") return "";
                else return d.fullname;
            });

        //IT GOES ON FOR SEVERAL MORE


        // Transition nodes to their new position.
        var nodeUpdate = node.transition()
            .duration(duration)
            .attr("transform", function(d) {
                return "translate(" + d.x + "," + d.y + ")";
            });

        // Fade the text in
        nodeUpdate.select("text")
            .style("fill-opacity", 1);

        // Transition exiting nodes to the parent's new position.
        var nodeExit = node.exit().transition()
            .duration(duration)
            .attr("transform", function(d) {
                return "translate(" + source.x + "," + source.y + ")";
            })
            .remove();

        nodeExit.select("rect")
            .attr("width", 0)
            .attr("height", 0);

        nodeExit.select("text")
            .style("fill-opacity", 0);

        nodeExit.select("image")
            .style("display", "none");

        // Update the links…
        var link = svgGroup.selectAll("path.link")
            .data(links, function(d) {
                return d.target.id;
            });

        // Enter any new links at the parent's previous position.
        link.enter().insert("path", "g")
            .attr("class", "link")
            .attr("d", function(d) {
                var o = {
                    x: source.x0,
                    y: source.y0
                };
                return diagonal({
                    source: o,
                    target: o
                });
            });

        // Transition links to their new position.
        link.transition()
            .duration(duration)
            .attr("d", diagonal);

        // Transition exiting nodes to the parent's new position.
        link.exit().transition()
            .duration(duration)
            .attr("d", function(d) {
                var o = {
                    x: source.x,
                    y: source.y
                };
                return diagonal({
                    source: o,
                    target: o
                });
            })
            .remove();

        // Stash the old positions for transition.
        nodes.forEach(function(d) {
            d.x0 = d.x;
            d.y0 = d.y;
        });
    }

    function updateNewTree($base_id) {
        // Get the data again
        d3.json("nettree-alt.json", function(error, treeData) {
            // Call visit function to establish maxLabelLength
            visit(treeData, function(d) {
                totalNodes++;
                maxLabelLength = Math.max(d.distributor_code.length, maxLabelLength);

            }, function(d) {
                return d.children && d.children.length > 0 ? d.children : null;
            });

            root = treeData;
            root.x0 = viewerHeight / 2;
            root.y0 = 0;

            // Layout the tree initially and center on the root node.
            update(root);
            centerNode(root);

        });
    }

    // Append a group which holds all nodes and which the zoom Listener can act upon.
    var svgGroup = baseSvg.append("g");

    // Define the root
    root = treeData;
    root.x0 = viewerHeight / 2;
    root.y0 = -100;

    // Layout the tree initially and center on the root node.
    update(root);
    centerNode(root);
});
<?php } ?>
function EnableTreeMode(){
    $('.tree').treegrid({
    expanderExpandedClass: 'glyphicon glyphicon-minus',
    expanderCollapsedClass: 'glyphicon glyphicon-plus'
  });
  $('.tree').treegrid('collapseAll');
}

EnableTreeMode();
function collapse(){
  $('.tree').treegrid('collapseAll');
}
function expand(){
    $('.tree').treegrid('expandAll');
}

</script>

When i add a user, that user will be added to a tree under another user. it is like a triangle:

                                                USER 1
                                                  /   
                                           USER 2       USER 3
                                              /       /       
                                          NONE NONE   USER 1   NONE 

This codes is given to me without any documentation or orientation whatsoever so i cant really explain it.
The main problem is, when i remove one user, say user 2. the tree should be like this:

                                                USER 1
                                                  /   
                                           NONE       USER 3
                                      

Instead i get like this:

                                                USER 1
                                                  /   
                                          USER 3       NONE
                                        

Whenever i remove or add a new user the remaining user node always go to left. I need the node to remain to its place and not move left.

SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens [closed]

After an upgrade to PHP 8.2 I got the message:

SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens.

See my code below

    <?php
    $id1 = "one";
    $id2 = "two";

    if $row['name'] == $id1) 
    {
    $value = "1";
    $page_id = 1;
    }

    if $row['name'] == $id2)
    {
    $value = "2";
    $page_id = 2;
    }

    $stmt = $pdo->prepare('SELECT AVG(rating) AS overall_rating, COUNT(*) AS total_reviews 
    FROM reviews WHERE page_id = '.$value.' AND status = 1');
    $stmt->execute([$_GET['page_id']]);
    $reviews_info = $stmt1->fetch(PDO::FETCH_ASSOC);

Have I to bind some values?
Thanks in advance!

Textarea value with new lines not working with json

I need some suggestions. I have a normal as a textarea form where I got some text like this:

Test,
test

But when I try to send this text to an api through a curl request, I got the result that the this is an invalid json. So is it possible to make this text one line with \r\n ?

When I try to send Test,\r\ntest it is working correctly.

go-pear.phar file error and unknown charachters

I want to install PEAR and I’m using PHP 8.1.0
I’m following this tutorial: https://pear.php.net/manual/en/installation.getting.php

The error is in the go-pear.phar file and I found it here: https://pear.php.net/go-pear.phar

And I have an error when I try:
php go-pear.phar
The error is:

Fatal error: Uncaught Error: Failed opening required ‘phar://go-pear.phar/index.php’ (include_path=’.;C:phppear’) in C:wamp64binphpphp8.1.0go-pear.phar:1284
Stack trace:
#0 {main}
thrown in C:wamp64binphpphp8.1.0go-pear.phar on line 1284

My line 1284 and the following ones are:
enter image description here

Does someone know what I can do or where I’ve to search to solve this problem?

How to move First/Selected order to last in Laravel?

I want to move my first order to the bottom of the list and not to delete the first order as well.
here is my code. This is deleting/unset first order as well.

`

if (isset($request['defer_order']) && $request['defer_order'] != null) {
            $order_id = $request['defer_order'];

            foreach ($order_items as $key => $order_item) {
                $last = count($order_items);
                if ($order_item->order_id == $order_id) {
                    unset($order_items[$key]);
                    $order_items[$last + 1] = $order_item;

                }
            }


            $order_items = $order_items;

        }

`

I am trying to move first order to the bottom of the list.

Remove links from a post if it matches any category

I have this code, but it removes the links from all posts, I would like to introduce a variable that says that for X category it will not apply

add_filter
    ('the_content', 'removelink_content',1);

function removelink_content($content = '')
{
    preg_match_all("#<a(.*?)>(.*?)</a>#i",$content, $matches);
    $num = count($matches[0]);for($i = 0;$i < $num;$i++){
        $content = str_replace($matches[0][$i] , $matches[2][$i] , $content);
    }
    return $content;
}

How would the code look? Is it possible to record that in the database?

When the user submitted the form it stays to register page instead logging the user in

This occurs when I reinstall XAMMP but I don’t think that is not the issue.

When I am trying to submit the form before it redirects to index page and logging the user in and starting a session but now after reinstalling XAMMP and recreate the database it is not working.

But there were changes I made upon creating the database I changed the value and type but I don’t think that is the issue here.

Also, the log-in function is not working either it gives the error handler wrong password even thou it is correct since I used the password verify for the password and hashed password.

I really appreciate your help I tried searching and can’t find the correct answer

Here is structure of my project

Here is the code below for my controller.php :

// Check if there are any errors
if (count($errors) == 0) {
    $hashed_password = password_hash($password, PASSWORD_DEFAULT);
    // Insert the new user into the database, but do not log them in

    if (isset($_POST['user_type'])) {
        
        $usertype = $_POST['user_type'];

        $query = "INSERT INTO user_table (username, email, user_type, password) VALUES 
(?, ?, ?, ?)";
        $stmt = $db->prepare($query);
        $stmt->bind_param('ssss', $username, $email, $usertype, $hashed_password);
        $stmt->execute();

        header('Location: ./admin.php');

} else {
        // Insert the new user into the database and log them in
        
        $query = "INSERT INTO user_table (username, email, user_type, password) VALUES 
(?, ?, ?, ?)";
        $stmt = $db->prepare($query);
        $stmt->bind_param('ssss', $username, $email, $usertype, $hashed_password);
        $stmt->execute();
    
        // Check the user's credentials
        $query = $db->prepare("SELECT * FROM user_table WHERE username = ? AND password 
 = ?");
        $query->bind_param('ss', $username, $hashed_password);
        $query->execute();
        $result = $query->get_result();
    
        // If a matching record was found, log the user in
        if ($result->num_rows > 0) {
            $user = $result->fetch_assoc();
        
            // Start a new session
            session_start();
    
            $_SESSION['user_id'] = $user['id'];
            $_SESSION['username'] = $user['username'];
            $_SESSION['user_type'] = $user['user_type'];
            $_SESSION['success']  = "You are now logged in";
            header('location:../index.php');
 }
}

function loginuser() { 

global $db, $username, $password, $errors;


    // Prepare the SQL statement
    $stmt = $db->prepare("SELECT * FROM user_table WHERE username = ?");

    // Bind the username to the prepared statement
    $stmt->bind_param("s", $username);

    // Execute the statement
    $stmt->execute();

    // Get the result
    $result = $stmt->get_result();

    // Check if the username exists in the database
    if ($result->num_rows === 0) {
    // Show an error message if the username does not exist
    $errors['inlgn'] = "Incorrect username or password";
    

    } else {
    // Get the user data
    $user = $result->fetch_assoc();

    // Get the hashed password from the database
    $hashed_password = $user['password'];
    

    // Verify the password using the password_verify() function
    if (password_verify($password, $hashed_password)) {
        
    // The password is correct, so log the user in
    // Start a new session
    session_start();

    // Store the user's ID and username in the session
    $_SESSION['user_id'] = $user['id'];
    $_SESSION['username'] = $user['username'];
    $_SESSION['user_type'] = $user['user_type'];
    

    // Set the success message
    $_SESSION['success'] = "You are now logged in";

    // Redirect the user to the homepage
    header('Location: ./index.php');
    } else {
    // The password is incorrect, so show an error message
    $errors['pwdm'] = "Wrong Password";
    }
}   

}

Odd PHP cURL proxy behavior

I’m trying to request Keycloak container from another container within the same network using PHP curl with proxy. The Keycloak’s service name is keycloak and its exposed port is 8080.

Here is my code:

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://localhost:10210/realms/test/.well-known/openid-configuration");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PROXY, "keycloak:8080");

$response = curl_exec($ch);

curl_close($ch);

When I execute this code I receive this error message:

{"error":"RESTEASY003210: Could not find resource for full path: http://localhost:10210http://localhost:10210/realms/test/.well-known/openid-configuration"}

It looks like it duplicates the hostname when I use proxy option and I have no idea why it happens.

Posting array to arrays in php

Im trying to post the implode data of multiple select html to database but it is dynamic.
Result will be like this:

data1|data2|data3 = from multiple select(already get)

how do i achieve this kind of result it separated with commas
data1|data2|data3, data1|data2|data3, data1|data2|data3

the separated data inside the commas are came from another multiple select

here’s my code
html

<div class="required field">
 <label>Subjects:</label>
  <select class="ui fluid search dropdown" name="pass_subj[]" multiple="">
    <option value="">Subject</option>
    <option value="data1">subject1</option>
    <option value="data2">subject2</option>
    <option value="data3">subject3</option>
    <option value="data4">subject4</option>
    <option value="data5">subject5</option>
    </select>
</div>
<div class="two wide field" style="padding: 23px 0px 0px;">
 <button class="passmore ui icon yellow button" type="button"><i class="plus icon"></i></button>
</div>

php

$pass_subj = $_POST['pass_subj'];
$pass_subjs = implode("|", $pass_subj);