Questions tagged as 'php'

1
answer

Passing checkbox values

Good afternoon, I need to pass selected values from a checkbox to a page via a form via Post and save them to a database, but I can not, could you help me? Follow the code: Form: <form class="form-horizontal" method="POST" action="...
asked by 20.06.2015 / 18:59
1
answer

PHP error: "Notice: Uninitialized string offset"

I'm trying to solve a problem with initializing a variable, how to fix this? <?php $texto1 = $_POST['texto1']; $texto2 = $_POST['texto2']; $texto3 = $_POST['texto3']; function randString($size) // função que gera string aleatória de carac...
asked by 25.06.2015 / 20:21
1
answer

usort php, order the brazilian table

Friends, I have an array with the brazilian table, it contains the team name, victories, balance of goals, goals pro, etc. I would like to sort the array using the Brazilian criterion, points > victories > goal difference > goals pro...
asked by 27.06.2015 / 06:18
1
answer

How to modify or set a value inside the class in php

I have class in php and I need to modify the value of private $key = "valor"; out of class . How can I change the value of $key outside this class? The value I want to put in $key comes from a $_POS...
asked by 28.06.2015 / 06:08
2
answers

Return the data difference of two sql tables

I have a ESCOLA table with ID_ESCOLA and NOME_ESCOLA and another table PROFESSORES that contains a FK_ID_ESCOLA and NOME_PROFESSOR . I wanted a table that would give me the name of all the schools, but th...
asked by 26.06.2015 / 20:06
1
answer

How to pass the dynamic variables from a url to php via ajax

First of all, I have already looked at several other posts about the subject here and I did not find what I need, my scenario is the following I am generating several EX links: challenge.php? id = 2 & name = joao challenge.php? id-3% name...
asked by 13.02.2016 / 03:24
2
answers

Select only one item

Here is the code: <?php while($ver=mysql_fetch_row($busca)){ ?> <tr> <td><input type="radio" value="<?php echo "$var[0]"; ?>"></td><td><?php echo "$ver[0]"; ?></td> <...
asked by 16.11.2015 / 19:58
1
answer

Class active in the menu using include

In my php pages I use an include to call a file that contains my menu: <?php include('../../sidebar-menu.php'); ?> Menu file: <ul class="sidebar-menu" id="nav-accordion"> <?php foreach ($li...
asked by 16.11.2015 / 18:28
1
answer

Accessing an array that is inside another

I have the following array array(2) { [0]=> array(1) { ["data"]=> string(19) "2015-11-20 00:33:53" } [1]=> array(1) { ["data"]=> string(19) "2015-11-20 08:24:50" } } How do I access the two ['data'...
asked by 21.11.2015 / 01:11
3
answers

How to insert an else to display message in case there are no files to upload

Code <?php $files = $obj->field('upload'); foreach ($files as $file) { $file_url = get_attached_file($file['id']); echo '<a href="' . $file["guid"] . '">' . $file["post_title"] . '</a>'; echo '<br>';...
asked by 19.11.2015 / 19:48