Tagged Questions
PHP is a general-purpose programming language primarily designed for server-side web development.
0
votes
0answers
2 views
Simple mutator screwing with SQL Query?
I want to be able to set the user_id via the setUserIdAttribute mutator but it won't work. The code works fine when I comment out the mutator. Below is my code and the resulting QueryException error. ...
0
votes
0answers
3 views
Symfony - Error while saving profile with accessgroup
When I try to edit a user with one or more access groups it gives a 500 internal server error.
500 | Internal Server Error | Doctrine_Record_UnknownPropertyException
Unknown record property / related ...
-2
votes
0answers
10 views
mysql_query() expects parameter 1 to be string, object given [duplicate]
"You are connected!" browser show this so iam connected successfully.
Warning: mysql_query() expects parameter 1 to be string, object given in C:\xampp\htdocs\soc\vypis.php on line 13
Notice: ...
-2
votes
1answer
21 views
Something wrong with PHP
I'm trying to make a forum-like section for my website. It's not posting, and I don't know why. Here's my PHP and html
<?php
if ($_POST) {
$title = $_POST['title'];
$name = $_POST['...
0
votes
0answers
4 views
Data loading issue Oracle JET
I am using Oracle JET with PHP and mySQL for creating a small website. I am facing the below issue.
I am using the below code to get the data, and then bind to pagingDatasource but the problem is ...
1
vote
0answers
4 views
Is there anyway to get /admin/links.json on Shopify and copy that to a dev store?
As most will know, you can only export / import themes and products via admin which is a real pain setting up site development stores as lot focuses on Navigations and Collections... is there anyway ...
0
votes
0answers
6 views
Reviewing the Google API PHP client and I noticed they use usleep($delay * 1000000) instead of just sleep(delay). Why?
Here's the code that is used
/**
* Sleeps in accordance to the backoff configurations.
*/
private function backOff()
{
$delay = $this->getDelay();
usleep($delay * 1000000);
}
Is ...
-2
votes
0answers
21 views
My GET is not comming through completely
When I send this AJAX GET to the server it goes fine, but when I receive it back half my variable is lost.
Here I send it to the server:
var date = "12-11-2017";
//I removed all the general AJAX ...
-2
votes
0answers
8 views
form submit on file input change [duplicate]
What is wrong here:
<form id='form01' action='pro-img-disk.php' method='post'>
<input hidden type='file' name='inputfile' id='inputfile' accept='.jpg'>
</form>
js
$('#...
-2
votes
0answers
13 views
how to check the answers and calculate the corrected answers
applicant_do_exam{
applicant_do_exam_id,
exam_paper_id,
question_id,
app_answer,
email
}
question{
question_id,
question,
option1,
option2,
option3,
option4,
answer
}
$score =...
0
votes
0answers
8 views
Dynamically load content inside a division on click of a button in Laravel
I am trying to create an application with laravel and i am having some difficulty in understanding how to dynamically load content into a division according to the button clicked from the menu bar.
...
-3
votes
0answers
13 views
PHP Error Issue [duplicate]
Can someone help me and tell me whats wrong with this code?
On my website, it says this at the bottom of the page: http://prntscr.com/f007s9
<?php
if (isset($_GET) && $_GET['errors']...
0
votes
0answers
22 views
PHP Button not working(number systems converter)
I have this little project to make a converter between the 4 number systems using PHP I wrote the functions for the conversion and they are working perfectly but I when I tried to input the numbers ...
0
votes
1answer
9 views
Laravel 5.4 : Api route list
i have the following lines in my routes/api.php
Route::middleware('api')->get('/posts', function (Request $request) {
Route::resource('posts','ApiControllers\PostsApiController');
});
When i ...
-3
votes
0answers
11 views
Php how to sync video across multiple clients
So i would like to make a site that works a bit like rabb.it and watch2gether. Basicly i want to have control over the player, and i want other people to be able only to watch. I want to use it for ...
2
votes
1answer
20 views
How to index MySql table with over a million records
This code works perfect on a small table, but I have a table that has 1.8 million records, so my search time is about 12 seconds. I created a b-tree index on my table via Phpmyadmin on client_id and ...
0
votes
1answer
9 views
Laravel: Ordering data at a query level when using pivot tables?
In my routes/web.php I have a route like this...
Route::get('/tags/{tag}', 'TagsController@show');
Then, inside TagsController because I have a post_tag pivot table that has been defined as a many-...
0
votes
0answers
6 views
Fill in text boxes that have variable ids in Selenium Web Driver
I am trying to create some automated tests for a website that was built using Codeigniter as a framework. The site allows a users to create a powerpoint presentation online. I am trying to create ...
-2
votes
2answers
20 views
ReferenceError: ajax is not defined
Putting it in simple words, I get this error in my firefox console:
ReferenceError: ajax_teste is not defined.
I'm using ajax to send values to the ajax_test.php.Then the ajax_test.php send the data ...
1
vote
1answer
21 views
Php, static variables for trait itself only, how?
its possible to have static variables for traits:
Trait Example
{
public static $var;
}
class X
{
use Example;
}
class Y
{
use Example;
}
however, the problem is when more class would ...
-6
votes
1answer
23 views
The data entered is not added to the database
form where the information is entered
config file to establish connection and where it should be entered in the database
0
votes
1answer
8 views
How do I add selected to this code
This code works.
<!doctype html>
<body>
<form method="post" >
<?php
$conn = new mysqli('localhost', 'root', '', 'myDB');
if ($conn->connect_error){
die("Connection failed: "...
0
votes
1answer
25 views
How to find hidden php code in Wordpress
I have found in one of my Wordpress websites source code hidden php code. This is what I am looking for. I see it in the view source view, but I cannot find it in the wordpress theme files. Where ...
2
votes
0answers
22 views
Laravel: Can I somehow shorten this url with json encoded parameter?
I have an AJAX request to grab some values from database and then redirect back to page with those values so I can use them on page.
The thing is that this URL is very long:
http://ibpc.dev/admin/...
0
votes
1answer
6 views
Symfony unit testing form, form using jquery datepicker
I have a Roster entity in my Symfony project which contains two datetime fields.
Input field on FormType uses two single_text boxes, one for date one for time.
$builder->add('serviceUserId', ...
1
vote
0answers
22 views
Text chat using php ajax, resending failed message
We want to create a text chat using pusher notification, php and ajax. Following sql will create table for text chat messages.
CREATE TABLE `text_chat_messages` ( `id` int(11) NOT NULL ...
0
votes
0answers
7 views
How To Remove Menu on Certain Pages and Product Categories - WooCommerce?
What im trying to achieve is remove menu from shop page and product categories pages so it wont load stuff that is not needed, like menu images and stuff...
CSS is not an option here since like ...
-3
votes
0answers
16 views
Fatal error: Uncaught Error: Call to undefined method stdClass::fetch_assoc()
I'm not able to see any errors in my code below, yet I receive an error.
Can someone tell me what is wrong with this?
This is my query:
# Convert IPv4 to ip2long
$ip_int = ip2long($row['serverip']);
...
0
votes
0answers
16 views
php ; is there a faster alternative to preg_match_all to extract portion of strings?
Context ;
• from file_get_contents from url, i get lots of stuff like <item></item>, <url></url>, etc.
• i'm using preg_match_all to extract url, title, etc.
example:
$...
-1
votes
0answers
18 views
activity log of a social networking website
I am making a activity log for my website.i have made a table named activity with columns:
user_id,
activity_type,
activity_type,
activity_id,
created_at.
Now activity_type will be
1)Posts
2)like
3)...
-1
votes
1answer
19 views
MYSQL php date filter
I am having a question about doing this filter in mysql.
I have a date with 3 dates.
1-start date; Ex: 10-04-2017
2-end date; Ex: 04-20-2017
3-date completion; Ex 23-04-2017
If the order is ...
-2
votes
0answers
17 views
Not items displaying in shopping cart
Can anybody help me, how to display any product in shopping cart ? I want to add only wanted item. It redirects me to https://www.premium-gastro.com/c.php?action=add&id=%3C?php%20echo%20$row[ and ...
0
votes
0answers
20 views
Load dynamic content into page from external source
Today I've been thinking a lot about CMS and how to load data into a templating engine dynamically.
I thought about the languages that one could use. I've been using Pug and EJS in NodeJS, but I ...
-4
votes
0answers
16 views
Not getting any result from the code [on hold]
I'm working on an inventory system and here in this page I want to change the location ID of the product in the database, I wrote this code but submit button doesn't show any result. Can someone help ...
1
vote
0answers
7 views
How do I format Email body on GAE based webpage
Q1. I have a personal website hosted in GAE and email are coming from [email protected]. can I make it something like - Website Name < [email protected] > ?
Q2. Can I format or give line breaks on ...
-1
votes
2answers
18 views
Parse error: syntax error, unexpected '[' in custom logo
I'm new to coding and I'm not really sure how to rewrite this line without the [].
Parse error: syntax error, unexpected '[' in header.php on line 18
<img
style="margin-top: 9px;"
alt=...
-1
votes
0answers
12 views
Trouble connecting simple login/registration Android app to database
I am attempting to create a simple login and registration app following this tutorial (http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/) and I am having ...
-1
votes
0answers
9 views
Php: echo mot executing properly in wamp from server
I am using windows server 2008 r2 (azure) I installed wamp3.0 to run my pjp web application
The funny thing is my code works perfectly from localhost (when I connecr from the server's browser) but ...
-1
votes
1answer
9 views
Architecture of a game object class in PHP app
I'm building a football manager game in PHP where I define a class for every game object. For instance, I have a Player which represents a football player with all his attributes. There are a couple ...
0
votes
2answers
18 views
PHP AJAX Session Variable Not Working
I am new to using Session variables and have been struggling despite scouring the net to understand.
So basically I have a page (search.php). I load a dynamic data table based on a search form. Once ...
0
votes
1answer
17 views
Why the radio button not working properly
question{
question_id,
option1,
option2,
option3,
option4,
answer
}
exam_paper{
exam_paper_id,
exam_paper_name
}
exam_question_list{
id,
exam_paper_id,
question_id
}
applicant_do_exam{
...
0
votes
1answer
7 views
How to set a post featured image as background image in Wordpress
I created a section where I display all my post content. My struggle is now to set the post thumbnail as a background image.
Here the structure of the section:
<section id="testimonials">
...
0
votes
0answers
10 views
Issue re-hiding div class on reselect of original option jQuery
Can't seem to figure this out. Value does change as it is supposed to, but "#donateForm" doesn't hide upon selection of original option.
<select id="donateSelect">
<...
0
votes
1answer
17 views
Laravel: passing parameters to function?
I am trying to pass two parameters to a function in whereHas with Laravel because otherwhys it wont be able to use the $businessid but it's throwing an error, can anyone help?
Error:
...
0
votes
0answers
8 views
WP 301 redirect keeping the GET parameter
I am trying to redirect old pages that look like: http://test2.com/song.php?id=15 to http://test2/song/15 with .htaccess. The new site is powered by Wordpress, that already had a .htaccess initially. ...
2
votes
2answers
39 views
can't sql inject my code
I'm writing a demo webpage to show SQL injection techniques for a class project. I'm almost sure it's horribly coded in the right way, but I'm having trouble getting the actual injection to work. The ...
0
votes
0answers
12 views
How do I connect multiple files to this php code?
I'm taking a class on coding, so I'm not too informed on everything so I need some help.
<?php
$xml = simplexml_load_file("catalog.xml")
or die ("Error: cannot create object");
$course = $xml ...
0
votes
1answer
8 views
mcrypt_decrypt is returning a null repsonse
I can encrypt strings in php but I cannot decrypt my strings in php when calling the decrypt function, I get a null response. What am I doing wrong? my code is below.
<?php
$txt = "Hello";
...
0
votes
1answer
4 views
How to create a Laravel 5.4 Session in the Database
I've scoured the documentation and I've spent hours trying to figure this out, and this is really my last resort. If this doesn't work I may have to get a subscription to Laracasts. I'm following this ...
0
votes
0answers
2 views
Multiple wordpress loops with one database call
This is more a question to see if it is possible.
I am looking at the number of calls one of my websites is doing. As the site has been running for 5 years and my coding knowledge has improved, the ...