« first day (307 days earlier)      last day (3 days later) » 

7:00 AM
0
Q: Concatenating PHP and JS while echoing

Obmerk KronenI have JS with an options var like so : $output .= '<script type="text/javascript"> // <![CDATA[ var options = { render: "canvas", size: "100", radius: "0.5", }; ...

0
Q: Fatal error: Function name must be a string PipeCMS

FernandoFatal error: Function name must be a string in C:\xampp\htdocs\pipe\includes\class.engine.php on line 101 Witch is the following void final public function num_rows($sql) { return $this->mysql['num_rows']($this->mysql['query']($sql, $this->connection)); } Also here in a main file i decla...

-1
Q: How to get the in-line blocks as close as desired?

user3128709![That's how it should look][1] Hi, I am trying to make 2 in-line blocks next to each other and similar 2 under it. The problem is I am unable to make them stick as close as possible. I have to make it responsive as well. please help.

1
Q: PHP rearrange the array by indices

SanganabasuI'm trying to produce categories and sub categories array. The array look like as follows. array( (int) 1 => array( (int) 0 => array( 'id' => '2', 'name' => 'Hydrualic Fluids', 'photo' => '', ), (int) 1 => array( 'id' => ...

0
Q: Why does this code cause error while using form tag in PHP?

user3128717I wrote JavaScript code to show the particular div tag in textbox by onclick event. If I use a form tag, it's not showing div tag id in textfield by onclick. If I remove the form tag, it works fine. Why? Source: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/...

0
Q: Dropdown chosen item doesn't display corrently in mysql db

user3125900I have a drop down; <select name="pizzaSize" type="text" id="pizzaSize" > <option value="Small"<?php echo ($pizzaSize== 'Small') ? ' selected="selected"' : ''; ?>Small</option> <option value="medium">Medium</option> <option value="large">Large</option> <option value="XL">XLarge<...

0
Q: Managing Wordpress Database (Adminer)

user3125817Im new to wordpress and having difficulties in managing the database. I have installed "Adminer" plugin to manage the database. I already created a new table called "tbl_admin". Now I also created a custom template that will connect to this database using PDO statements, the problem now is where ...

0
Q: CoffeeScript for PHP/HTML to convert the coffee to php/html minified script

daison12006013Good day, I'm new to coffeescript and happy about the features. I would like to know if there such thing as CoffeeScript for PHP View Layer, and something from .coffee to .php as minified form. something like: td: Wow to: <td>Wow</td> Or something ways to preserve the ORIGINAL CODE to a...

0
Q: Php insert/update multple row, using array and not a foreach

RobI’m wondering if this is possible, I’ve search and haven’t found anything so about to give up. I’m looking to do the following for example, note i do not want to use a foreach as that converts it into single queries. $a = (1,2,3); $b = ('john','Rob','Stuffs'); $c = ('doe','roe','soe'); $sql = ...

0
Q: Ajax call inside each loop

Abdullah FahimI found many posts with this topic. But the solutions I found is not much unsuitable for me. Some experts advised to change code structure, but I am not sure how can I do that. What I want: 1) Get a list of movie from SQL database 2) Fetch information from a website for each movie Problem I fac...

0
Q: write with php code in javascript

user3098032 <script type="text/javascript"> var id=<?php print''.entry1->id.''?>; var dataString = 'id='+ id; $.ajax ({ type: "POST", url: "ajax_unfollow.php", data: dataString, cache: false, }); </script> there have a error in this line var id=<...

0
Q: Stop redirecting to another page if the fields are empty in YII

vijayI am a newbee to yii and i am middle of something. I have many forms in view page where i click on submit it check the fields and enter database. But my question is if i have 5 different forms that need to check for validation and should stay in the same form which is entering another form.In th...

0
Q: comparing fetched data between two database

StingHandsI am successfully connected to a mySQL database and oracle database, how do I compare the table content and update mySQL table if something added/updated on Oracle table; ex. MySql db Oracle db STAFF ...

0
Q: Zend Db Table delete not working

user2910708I am new to zend framework and want to delete data from database, but delete function is not working. Please help me out. Here bis my controller code. public function deleteAction() { if($this->getRequest()->isPost()) { $del= $this->getRequest()->getPost('id'); if($de...

1
Q: Remove .php and id from url and replace with slash

user3128780i have tried lots of for url rewrite rules in htaccess but i am stuck now. i have to change this url products.php?id=31 to products/31 i have used Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / ## don't touch /forum URIs Rewrite...

0
Q: Can't figure out this parse error

Kiran RSI am getting an error like this Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in (<file path>) The error that showing the line is echo "$count. ($useronline[ip]) Browsing page: <a href="$useronline[page]">$useronline[page]</a>"; Here is the full function. <?php f...

0
Q: Fix a variable with a valu, and never change it

NewerWhen i visit a page after login,I go home.php. Then i get $a=1234asdf; now after doing some task in different pages when I come back to home.php then I get $a='something else'. but I need $a=1234asdf; Now how can I fix $a,and not to change.

0
Q: Error Occured in worldpay

Anup PProblem with the Worldpay extension - In my website, transaction works from Magento to Worldpay completely fine and payments go through to the merchant account successfully. but the problem occurs after a transaction, when returning to the site. The customer receives an email from Worldpay bu...

0
Q: SCRIPT_ROOT alternative for jQuery

Michael Eugene YuenI am trying to Simple Star Ratings http://absolutephp.wordpress.com/2013/03/23/simple-star-rating-system-using-php-mysql/ for multiple domains within the same hosting server. However I cannot get the correct script url to work. Is there an alternative like <?php SCRIPT_ROOT ?> for jQuery...

0
Q: Doctrine 2 join two tables with third using four table

user3054974I'm confused, and spend 2 days for find answer for this question: I am already have 5 tables Language -> id, iso_code I18n_Entity -> id I18n_String -> id, i18n_entity_id, language_id, text Product -> id, i18n_entity_id(unique) Category -> id, i18n_entity_id(unique) I need to do 2 methods ge...

0
Q: Saving Image in php: image not getting saved

elvismdevI am trying to write a script to save an image, it suppose to save the image at the same location where the script is located at the disk but no luck. I am missing something else over here? //Function to make GET request using cURL function curlGet($url) { $ch = curl_init(); //Initialising ...

0
Q: Passing file from one if to other if to finish proccses

RavgI already opened Question relative to this(i flaged the question for moderator review),but no one finish help me.. and i stuck . I have somthing like that : if($proc == "question"){// Handle some normal form 'contact us'. ...some proccses code when submited via ajax $fileElementName =...

0
Q: substr function displaying incorrectly

C-linkI'm using substr() function something like this: <a href="#">link</a> <?php echo substr($item->introtext,0,75);?> <a href="#">read-more</a> When the introtext has more than 75 characters it's displaying correctly like this: <a href="#">link</a> <p>introtext paragraphs here<a href="#">read-more<...

0
Q: Interface 'Psr\Log\LoggerInterface' not found in /opt/lampp/vhosts/development.com/htdocs/test/Monolog/Logger.php

Eswara ReddyI am trying to execute basic example of monolog. I have tried follwing code. My index.php file is <?php include_once __DIR__ . '/Monolog/Logger.php'; include_once __DIR__ . '/Monolog/Handler/HandlerInterface.php'; include_once __DIR__ . '/Monolog/Handler/AbstractHandler.php'; in...

0
Q: How to check whether a file is present in a directory or not in PHP?

PHPLoverFollowing is my code snippet: <?php $filename = $test_data['test_name'].".pdf"; //I want to check whether the above file with the same extension(.pdf) is existing in the directory having name say "ABC" is present or not ?> And if such file is not present over there in the directory "ABC" then ...

0
Q: How to Display ListData() in CDetailView in Yii

Rizwan Shamsher Kaim KhaniSuppose I have a code of CDetailView as shown in below $this->widget('zii.widgets.CDetailView', array( 'data'=>$model, 'attributes'=>array( 'title', 'owner.name', 'description:html', array( 'label'=>'City', ...

0
Q: Wordpress | How to define and use helper functions in theme functions.php?

James HuckaboneHow to get following to work properly in Wordress Theme functions.php file? I haven't figured out how to make the top function available to the bottom function within the theme's functions.php file. I'm not grasping how to setup hooks so they can work together. Thank you. Filter/helper/whatev...

0
Q: Data is not inserted into database

sosyteeI would like to add data from an html form into the database , here is my code <html><?php $var1=$_POST[tag]; $var2=$_POST[name]; $var3=$_POST[surname]; echo $var1; echo $var2; echo $var3; $dbhandle=mysql_connect('localhost','root','mysql') or die ("Unable to connect to database"); mysql_sel...

-2
Q: About Database Connection error

Vijay PandeyI am creating a registration page in PHP with mySQL and got a code from the Internet as I am new to PHP, and getting this error: Warning: mysql_connect(): Access denied for user 'prasanth'@'localhost' (using password: YES) in C:\xampp\htdocs\source\include\fg_membersite.php on line 733 Register...

-1
Q: Imap mail not working properly

user3107514I have the following code in my project. The issue is that the message(body of the email) is not displaying properly. --37cd8764df1f86bc509d0994d83f1d26 Content-type: text/plain;charset="iso-8859-1" Content-Transfer-Encoding: 7bit hello --37cd8764df1f86bc509d0994d83f1d26 Content-type: text/html;...

0
Q: NodeJS with PHP application and user session

user1853777I have a PHP application (with Symfony2) and I need to let my users talk, and other tings, in real time (with socket.IO). But I also need to store the sent messages and they are linked to a logged in user. So I have two possibilities : I use PHP to store messages : I have an event on the clic...

0
Q: MySQL-based search not bringing up full results

user2142702So I have a MySQL table, people, with the fields _Name, _Criminal, _Loyalist, _PrevJailed and three people in the database. John Mitt, 1, 0, 1 John Sample, 0, 1, 1 Jane Lastname, 0, 0, 1 When searching for people with the query SELECT * FROM people WHERE `_Name` LIKE '%' AND _Criminal = 1 AND...

0
Q: TCPDF- How to reset tcpdf settings to default on add new page?

user1456131Is their a way to reset tcpdf page settings to default on $pdf->AddPage() since I am generating pages dynamically with different page settings. Thanks in advance

0
Q: Magento layered navigation category Url

AnkurThere is a code into filter.php file that is <?php foreach ($this->getItems() as $_item): ?> <li> <?php if ($_item->getCount() > 0): ?> <a href="<?php echo $this->urlEscape($_item->getUrl()) ?>"><?php echo $_item->getLabel() ?></a> <?php else: echo $_item->getLabel() ?> <?php en...

0
Q: PHP and Mysqli OOP - Handling database

MaheshToday i tried to convert my functions to PHP Class. I tried with some basic steps. <?php class DataBase { private $host; private $user; private $password; private $db; private $mysqli; function __construct() { $this->host = "localh...

0
Q: Nested table format

surnameI have nested table, the nested table is hidden. My current table output is this And I want my hidden table place under its parent link the tr with yellow arrow in the top. I want look like this How I can do this? I want to do this with jQuery but I don't know how. I cut some codes to sh...

0
Q: phpmyadmin displays code not web page

3118731i was upgrade my distro, from kali(wheezy) to sid. but when i setting up my web server, i reinstall all over, apache2, php, mysql etc. but i found this error when i access localhost/phpmyadmin, that url is not showing an index / login page of phpmyadmin, but showing the code. in my /var/www defau...

0
Q: How to add value in element of array php

user2962871i want add value for array in php example from Array ( [0] => hello [1] => baby [2] => aaa ) add value to Array ( [hello] => Array ( [0] => abc [1] => ac ) [0] => baby ) thank all.

0
Q: Jquery Ajax PHP Mysql Autocomplete not Functioning

BehseiniCan someone please take a look at this link and let me know why the auto complete text box is not functioning? What I have is a Table called "Brangays" in a MySQK datadabase "157400X_XXXXXX" which contains: I have these files as PHP files aswell 1-:Get_Auto1.php <?php // Database Connection...

0
Q: PHP Prepared Statement's OOP

user2872510Im trying to make a prepared statement that gets the result of the database as an array and returns it as json data <?php /** * Logs the User into Website */ class Login { public $connection; public $result_array; public $user_type; public $id; public $username; public ...

0
Q: Embed function in swiftmailer not working

Shanil SoniI want to send logo of our company in email inline & not as attachment. I have this code for sending out email. $transport = Swift_SmtpTransport::newInstance('hostname', port, 'ssl') ->setUsername('email') ->setPassword('password'); $mailer = Swift_Mailer::newInstance($transport); $message =...

0
Q: Rotate image string vertical, i.e. top to bottom

D. RattansinghUsing the imagestring up function, the text rotates from bottom to top. Is there any way to rotate the text from the other angle? i.e. top to bottom?

0
Q: Converting large numbers into letters (and back again)

techtheatreIs there a term for the idea of storing large numbers as letters? For example let's say I have the (relatively small) number 138201162401719 and I want to shrink the number of characters (I know this does not help with saving disk space) to the fewest possible number of characters. There are 26...

0
Q: Connecting to MS SQL database with PHP: Data source name not found, and no default driver specified

peirdI'm stuck with this problem for a while and I just can't get any further, I did a lot of searches but nothing works... I'm trying to connect to a Microsoft SQL Database with php using odbc. Everything is set up, as follows (the values between "" are correct in the file): /etc/odbc.ini: [CRMCON...

1
Q: How to create an Vagrantfile that matches Elastic Beanstalk?

gchuckyWe're putting together a PHP site that we plan on deploying to Elastic Beanstalk, and I'd like to create a virtualized dev environment to match production. I've got a few questions about it, though. So it looks like I can use vagrant-aws and feed it a custom AMI - presumably one that would be cr...

0
Q: About URLs using REWRITE in PHP

CecilI have a PHP file and I don't know how to rewrite its URL when 'Borrow Book' link is clicked. In the url, I want the names of the input fields to be posted, not its input values. I have here some some sample links (I can't post image) so it can be better understood: http://localhost/library/borr...

0
Q: Array within an array using Facebook Graph APi

user3109966I have been working on this problem for the last 2 days, searched over and over again .. nothing. Understanding that I am not an expert here - it's good! lol I am trying to get the information found in the link below; https://graph.facebook.com/570215713050551_4508656/comments/?fields=likes.fie...

0
Q: Parsing data to the view using codeligniter

user3017975this is ma function am trying to parse data to the view but i have failed to initailize the arrays to some variables function blogs() { $this->load->model('blog/Den_model'); $this->load->model('Den_model'); $da['qry']=$this->Den_model->get_last_ten_entries(); ...

0
Q: MySQL while loop only loops once

AndrewI have a database activities that stores activities information such as attendees, event description, event time, etc. I call a while statement to print out the data, however the while loops is only looping once: $result = mysqli_query($conn, "SELECT * FROM `activities` ORDER BY `date`"); whi...

0
Q: phpcs menu is not active in sublime text2

MarioI've installed a phpcs plugin for Sublime Text2, it even seems to be installed. But when I right-click on a php file, the PHP Code Sniffer menu is always inactive, as in the screenshot below: Does anybody know how to make the plugin work?

0
Q: Numbering Tree Array

user3111525a have i tree array, looks like this: $testArray = array( array( 'id' => 12, 'address' => 'root addr', 'parent_id' => 0, 'children' => array( array( 'id' => 11, 'address' => 'child addr', 'parent_id' => 12, 'childre...

0
Q: Pressing backbutton on browser going back history url

NagendraI am using window.history.pushState and popstate functions for getting the previous page url's while clicking on back button of browser and i want to reload the page every popstate function calls. My code is.. function refresh_results() { page_link = $("#form").serialize(); if(pa...

-1
Q: How to get rid off the following error and make the code workable?

PHPLoverFollowing is the code: require_once("../../includes/application-header.php"); require_once OCN_ROOT."/core/extention/pdfcrowd/pdfcrowd_config.php"; require_once OCN_ROOT."/core/extention/pdfcrowd/pdfcrowd.php"; $filename = $test_data['test_name']; $client = new Pdfcrowd($username, $a...

0
Q: echo img not working but echo <p> is working in php

user2509932I am using $().load() method to generate elements in an html file. I want to display an image so I have used echo to display image using echo "img" but does not display. but when I use echo "p", it gets displayed.

0
Q: Validating OpenCart password hash in ruby

frankmtI'm migrating a system from OpenCart to Spree in ruby, and as part of that I would like to seamlessly migrate the users so they can keep login in without changing their passwords. Looking at the OpenCart code I've found the login function for the website. I'm not great at PHP, so I'm trying to u...

0
Q: how to upload profile pic for users wordpress from front end

sharathI have tried a lot to to upload an image for each of the users in my wordpress website, I have tried a lot of plugins like user avatar,easy user image, etc but no use, all these plugins uploads user image from the dashboard. I have used profile builder to create an edit profile page but it does n...

0
Q: Strange variables. XSL

user3128979I've such piece of code: <xsl:template match="bottom"> <div class="l1"> <div class="l2"> <div class="fl100"> <div align="center"> <div class="mw" align="center"> <div class="footer"> <div class="f1">$-BOTTOM_COPY-$<

0
Q: phpmyadmin in iframe being redirected

user1999806I am trying to enclose phpmyadmin into an iframe on my website. However, when the user is not logged in, the browser redirects into the full link. It only embeds into the iframe when user is already signed in. <div class="row"> <iframe src="http://nypgis.com/phpmyadmin/index.php" heig...

0
Q: Store Procedure Calling Error

user3110355I create store procedure in phpMyAdmin through cpanel->Localhost its execute correctly when I call in phpMyAdmin but when I call it in my Online it shows following error. Store Procedure CREATE DEFINER=`username`@`localhost` PROCEDURE `GetAccountingLedger`() DETERMINISTIC BEGIN SET @csum := 0;...

0
Q: Magento mageworx not saving well

user3127521I have in my shop custom option with the extentension mageworx. When a edit a option it not good saving the changes. Magento 1.8.0. Is it possible that a make checkbox in each field and that ik can choose which field a wil override and which field not? How do i that?![enter image description ...

0
Q: How to make SoapClient request with complex parameters?

TanSoloThis is the first time I work with SoapClient on PHP. My task is to create a script to automatically send a Soap request to the server. The correct request in SOAP UI is: Soap URL: http://example.com:8181/inventory/soap/inventory-api?wsdl <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap....

0
Q: How to make verification message alert by jquery

user2839993i have this code for view cats of my script <table align="center" width="100%" cellpadding="0" cellspacing="0" border="0"> <td class="td1" width="70%" align="center">title</td> <td class="td2" width="30%" align="center">Delete</td> </tr> <?php $select_cats = $mysqli->query("SELECT * FROM cat...

0
Q: gd library is install but not working

RickyI am using xampp gd lib is installed but it's not working it's gives Fatal error: call to undefined function imagescale() Here it is my phpinfo details: GD Support enabled GD Version 2.0.35 FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.3.9 T1Lib Sup...

0
Q: How Do I Change Properties of an Existing Twilio Number?

SisirWhen I am purchasing a phone number via twilio I can setup various properties for the phone number like this: $sid = 'AC...'; $token = '8...'; $number = '+12345678901'; $client = new Services_Twilio($sid, $token); $response = $client->account->incoming_phone_numbers->create( array( ...

-2
Q: how to use join that pull coma seperated value in mysql

Tnd.exei have tables tbl_restaurant(name,cuisine_id,....) and tbl_cuisine(cuisine_id,cuisine_name) In tbl_restaurant, cuisine_id field contain coma(,) seperated values like (3,6,9,20,31) and when i try to pull cuisine_name using join it only takes first id ie 3 in above case. I had a query: SELECT tb...

0
Q: CakePHP - Related values not showing

Vincent van den BoogaardI'm busy with an invoice project in CakePHP. I've set my related tables in the models, but somehow it's not forwarding to the view. These are my models: Invoice Model class Invoice extends AppModel { public $hasOne = array( 'Customer' => array( 'className' => 'Cust...

0
Q: how to insert sum value into mysql database

user3060742This is my Insertws.php page. I use the below query to insert data's to mysql database, mysql_query("INSERT worksheet SET Date='$Date', Team='$Team', Process='$Process', Item='$Item', Touch='$Touch', issuedwt='$issuedwt', receiptwt='$receiptwt'"); This is my index.php page. I use the below que...

0
Q: Stripping out unwanted embed code

user3059018I am currently looking at a piece of code for a friend and I am trying to strip out a piece of unwanted code but not sure how I can achieve what I want. CODE: <?php $blah = '<iframe src="//player.vimeo.com/video/82444237" width="500" height="281" frameborder="0" webkitallowfullscreen mozallo...

0
Q: Performing Javascript on HTML returned to the browser via PHP

Damilare BinutuI am trying to perform some basic DOM manipulation on html code returned to the browser via PHP, the html are table cells that display information retrieved from a database. Here's what I mean; echo "<tr class= \"data\"><td><a href=\"#\">Explore</a></td><td>$row[id]</td><td>$row[ip_address]</td><td

0
Q: Dynamic html mail process through single list with exact target fuel sdk

DeepakI want to sent a mail through single list every week.html mail and text mail both. It is possible to create one list like "12548" and add the different user like "abc@gmail.com","xys@yahoo.com", - - - -more. Sent the one html newsletter for one user. means different user for different html newsle...

0
Q: PHP request is too long

Jacques Attalihi need to tell that i'm totally new to php and SQL so please take care of that and forgive my mistakes. I have a database with 45 000 rows, i need to extract all 'udid' attribute, so there is a lot of data, i put the result in an array, for each udid i check if udid.xml exist, if the file exi...

0
Q: Bootstrap Pagination is removing href, making links unclickable

Michael FalcigliaI have setup my pagination exactly how bootstrap pagination examples are given. Everything works except the links. Apparently the Jquery script removes the href="link" from the <a> tag. This is what my php script generates in the html without the pagination script <div id="alphabet"> <ul> ...

0
Q: fgetscv(); escape dilimiter not working

Titi masterI am using fgetcsv() function in PHP to read CSV file The problem is the CSV file contains value with semicolon ";" and the function fgetcsv is not escaping it";" . eg : "18";"test";"test";"<p><span style=\"color: #333333; font-family: 'Open Sans', sans-serif; font-size: 14px; font-weight: bol...

-2
Q: varchar not suppoer this character:'

DS9My Datatype is: varchar(500) My Query is like this: $file = "55Beethoven's Symphony No. 9 (Scherzo).wma"; UPDATE `uploadfile` set `file`='$file' where `id`='5' and account_id='5' when i try to execute this query it's through following error: 1064 - You have an error in your SQL syntax; ...

0
Q: Give error 404 on purpose on an existing url

user3128991I received an abuse complaint from my hosting company because a spammer is sending phishing emails linking to a gif in my domain. Unfortunately the image is linked with a thumbnails php page and I want to filter only that particular url with mod_rewrite the url is similar to this http://www.my...

0
Q: CURLOPT_SSL_VERIFYPEER option gives certificate error

user2849371Hi I have following code and corresponding logs. Please let me know if anyone can figure out certificate problem. /////////////////////////////////////////////php curl code////////////////////////////////////////// curl_setopt_array($handle, array( CURLOPT_SSL_VERIFYPEER => true, CUR...

0
Q: Filtering the output with checkboxes in WordPress

Martin van HouteI'm building a page in WordPress with a filter function. Basically I want to change the output of the data when you click on the checkbox. What I have now: <form class="compo-filter"> <input type="checkbox" name="compo-cat" value="indoor" onclick="if(this.checked){this.form.submit();}" />...

0
Q: Save Array of objects into codeigniter

ahmedsaber111I built a form where i have to create array of objects from kind of inputs related to each other like below: { "name_node":{"type":"input","name":"name","validation":"required, alpha numeric"}, "content":{"type":"textarea","name":"contentco","validation":"required, alpha numeric"} } I used J...

0
Q: How to use google to search for strings to check plagiarism?

Th3lmuu90I have a website where users post articles and my goal is to find if their articles are copied or not from another sources. Is there an API from google (I found something yet I don't know if it was what I was looking for https://developers.google.com/custom-search/) to find the string I want and...

0
Q: How to pass a database value in a hyperlink using PHP + HTML

user3115396I have a table in a database called Artists. It contains two bands. What I would like to do is to be able to click on the bands name using a hyper link, send that bands name to another php page to be processed The hyper link syntax i have is throwing up errors: $query = "SELECT * FROM artists"...

0
Q: Datetime php conversions and usage with timezone

user1282407I am trying convert a utc time stored date to another time zone but i cant seem to get it right. I have a time : date1 = new DateTime('first day of the month'); date1.setTime(0,0,0); // Since using the first day of the month seems return the current time with different date The default...

0
Q: Dynamic table with checkboxes

user245679I'm creating a site and what I need is to create a page "Modify and delete users" accessible only to the site administrator. This page must be possible to delete and change user data. These users are stored in a database table, and there are information such as username, passowrd, name, etc.. So...

0
Q: Mysql Converting date to days of week

user689017I have the following query which gives me the visit_date for each client: select visit_date from visit The output of the above query is the timestamp when the entry was inserted into the Database , it will appear as follows : visit_date 2013-12-21 06:31:04 2013-12-21 11:05:30 2013-12-21 2...

0
Q: php server doesn't seem to execute code, although server is running

Badescu AlexandruI haven't worked in a very long time with php so this question may be a very noob one. I've installed apache server 2.0.65, and although when i call the localhost, my page in htdocs gets executed, only the html code appears in the view. The php code appears in the source view as html would, thu...

0
Q: PHPExcel print a range area

user3092049i need to store in a variale the content of a cell area and after print the value. The code that i use is: $type=$objPHPExcel->getActiveSheet()->setAutoFilter('C4:E4'); echo $type; but it doesn't work.How can i do? Thanks

0
Q: a way to validate form fields with same name attribute

FortranI have the following form. <form method="post"> <input name="lang[bg]" value="foo"/> <input name="lang[en]" value="bar"/> <input name="lang[de]" value="baz"/> <input type="submit" /> How can I validate fields and show the errors in this case?

0
Q: IE decodes umlauts in encoded urls to wrong charset

flecI have a file url (file:///...) with an umlaut in a intranet solution. The url is encoded which turned the ä into an %C3%A4. When I click the link in Firefox/Chrome the character is an ä and the file is displayed. In IE the character is changed to à which results in a 404-error. I tried with a...

0
Q: mysqli->multi_query INSERT INTO no result

AnujBasically what I'm trying to do is registering a user via ajax when a user submits a form. I want my data to be stored in 3 different tables. So here is the code I'm running $sql_insert = "BEGIN; INSERT INTO $table_name_primary (role, email, verified) ...

0
Q: Twig PHP Template Engine Class 'Twig_Loader_String' not found

Hasan NaturAm Trying To use the twig template engine , i included the "Autoload" file from the lib folder as bellow : require_once 'lib/Twig-1.15.0/Twig-1.15.0/lib/Twig/Autoloader.php'; $loader = new Twig_Loader_String(); $twig = new Twig_Environment($loader); echo $twig->render('Hello {{ name }}!', arr...

0
Q: Laravel eloquent show group directly instead under the user

madziikoyThe code: public function exploreJoined($page = 1) { $user_id = Input::get('user_id'); $joined_networks = User::whereHas('groups', function($q) { $q->where('is_blocked', '=', 0); })->with('groups')->where('uid', $user_id)->get(); return Responser::assert(200, $join...

-1
Q: Php does not store dynamically added extra input fields data

mansi had following html code for add more input fields to my form, but when i submit form database does not store extra fields data, i got only first field data. HTML <h2><a href="#" id="addScnt">Add Another Input Box</a></h2> <div id="p_scents"> <p> <label for="p_scnts"><input type="t...

0
Q: Remove the "view" segment in a CodeIgniter url

user3129131I am a newbee to CodeIgniter, I have a page which is called by http://www.example.com/pages/view/about is it possible to just use http://www.example.com/pages/about if yes how to do it? thnak you for your help.

0
Q: Laravel Request::Intended goes to home

dasmikkoI'm making this authentication filter, but when it gets to the Reguest::intended() it just throws me back to the homepage. Example: Tries to access forum.dev/admin -> Forces me to login -> Password and username is correct -> Goes back to forum.dev/ where it should go to forum.dev/admin How do ...

0
Q: Site removing www from URL/address in magento Hosted on Plesk server

Mahmood RehmanI posted this question on magento.stackexchange but not get my solution so posting here.Can view on this link. I want that user can access my site with or without www.But it didn't work with www. My site removing www from address and redirect to non www address like http://example.co.uk.I write t...

0
Q: Kohana and Wamp Server issue

plotusI would like to comment the following issue that I have, and know if you have any solution. I have to add a web page that was hosting a function on wamp server to do the necessary tests locally . My case is the following : the website is scheduled under the framework Kohana version 2.3.4 . The q...

0
Q: Replace items in a url string in php

poorvankbhatiaI am new to php. And i am trying to replace the "hash(#)" in the url string with "ampersand(&)". for example : if the url is :` http://www.abc.com/Cat/pgecategory.aspx?cid=8730&via=top#pge=2&pgeSize=36 i want to change it to http://www.abc.com/Cat/pgecategory.aspx?cid=8730&via=top&pge=2&pge...

0
Q: Loops on SQL Select

user3114471i have a problem, my page PHP make loops. I select into my DB only 2informations like this : $sqlins="SELECT hardware.name, rd.cmd FROM hardware, rd WHERE hardware.name LIKE 'Boomee' AND rd.cmd LIKE 'putty'"; $toto = mysql_query($sqlins); it's an exemple of my request. And when i use the loop...

-1
Q: HTML isset and value relation

Baran SengulI have a form and fields are name, surname and email. When I filled name but did not fill surname and email fields I want to name area write name area.(I did not write all codes.) I hope u can find where is my mistake. <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { $name = htmlspecialchars(t...

1
Q: calling a php function using ajax after interval of time

user3122618hi i am working on a codeigniter project. I want to execute a php function after an interval of 10seconds. When a user visits that specific page after 10 seconds i want that php function to be executed. In that php function i have set a counter which adds 1 to the specific table into the database...

-1
Q: PHP is_numeric validation not catching letters

knot22The following function is supposed to allow empty an empty field to pass the test, allow a positive integer to pass the test, fail the test if a field contains any letters: function fnValidatePositiveInteger($v) { return (!empty($v) and (!is_numeric($v) or $v < 0 or $v != round($v))) ? 0 : 1...

0
Q: joomla 3 php if else statement

user991830I have the following statement in my Joomla 3 index.php file that I am trying to work out: <?php if ($this->countModules('right')) : ?> <?php if( JRequest::getVar( 'view' ) == 'article' ): ?> <div class="col-md-<?php echo $right; ?>"> <section class="sidebar right-sidebar"> <jdoc:inc...

0
Q: CodeIgniter error showing core file path instead of the working file path

pixelngrainJust wonder how I can setup the system in CodeIgniter so all error path and line number directly shows to my working file instead of any core file path, filename and line number. For instance I'm having error on file Filename: application\core\MY_Model.php Line Number: 59 but it showing erro...

0
Q: Mysql query to aggregate data with a column values becoming columns in result

Mona CheikhnaI have this query that i've been trying to get right but couldnt so far. I have a table s_states : +-----+----------+------------+---------------+ | client | groupe| date | success_rate | +--------+-------+------------+---------------+ | c1 | 1 | 2013/12/01 | 40 | +--...

-1
Q: echo results with DIV

NathaliaZeedI'm trying to get results into my html page from a mysql db using an external php file. I want to be able to echo the results together with the DIV tags so I can get the results including the DIVs into the html page. How do I add the DIV (below) in to the mysqli_fetch_array results and echo the r...

0
Q: "connection was interrupted" error while sending big package through WebSockets

sashok1337I'm using phpDaemon and WebSockets in my project, there is one page with data being updated at real time. Project is hosted in third party hosting service. With growing amount of information in the page i have experienced the following problem: in case if the package sent from server exceeds the ...

0
Q: Handler for method call

user3050705I'm in view file and I want to execute a helper: echo $this->url(); I want to write the handler for checking if method url() exists in view class. How can I do it? __get() method is only for object members? Is there something like this for methods? class View { public function partial() ...

0
Q: phpinfo() works fine, but any other php code thrown a 500 HTTP code

Andrea MoroI'm trying to create a VirtualBox that I can recycle across multiple projects, using a shell script to install all packages I need. I got Apache2, MySQL and PHP5 installed regularly and running a page that contains works fine. The same for a static html fine. However, if I try to run everything...

0
Q: Bind buttonClick() Event to PHP Function

RazorI am a rookie in PHP and have just started learning the basics of this language. I have created a page login.php that contains a text field and a password field. What I want to do is, on the click of the submit button, I want to call a PHP method, authenticateUser() that I have defined on the sa...

0
Q: JMeter: How to replay a file upload and download jmeter testcase

user1134090I am trying to test a web application having upload and download of files as a feature. I am able to record a upload and download scenario successfully. But I am not able to replay the test case and look up for a file literally getting uploaded (from a location specified my me) and getting down...

0
Q: how to select a particular field and display it's output in mysql

user2281190I am very confused about the error when i use this code :- <? $result = mysql_query("SELECT * FROM users"); $array = mysql_fetch_assoc($result); $last = $array['lastactivity']; echo $last; ?> it doesn't show any output but when i use the above with WHERE username='$user' or any oth...

-1
Q: While in compering value to array keys

Wojciech SzabowiczWell i have a solution that looks foreach($overdue_tasks as $task) { ?> <li> <a href="<?php echo $task_url.'/'.$task->id; ?>" title="Przejdź do zadania"> <i class="icon-arrow-right"></i> Spóźnione zadanie ID: <?php echo $task->id; ?> ...

0
Q: decode twitter dinyurl to get full url link

user123I need to decode tinyurl coming from tweets, <?php $url = "http://t.co/vpDXYaXl7m"; $full = URLDecode($url); echo "URL is $full"; function URLDecode($url) { $ch = @curl_init($url); @curl_setopt($ch, CURLOPT_HEADER, TRUE); @curl_setopt($ch, CURLOPT_NOBODY, TRUE); @curl_setopt($ch...

0
Q: cakephp: saving to multiple models using one form

Sandara KwonI have one form that saves a person with many parts and many colors but it's not saving the parts and the colors; only saving the person(main model). On my list view, part of script: echo $this->Form->input('Person.person_name', array('required' => true, 'placeholder' => 'Name Your Person', 'la...

1
Q: FosMessageBundle sendId cannot be null

aybarscengaveri implement fosMessageBundle with my message bundle, but if want send a new message use fos_message.composer , i got that error. An exception occurred while executing 'INSERT INTO Message (body, created_at, threadId, sendId) VALUES (?, ?, ?, ?)' with params ["Test mesaj\u0131", "2013-12-23...

0
Q: Zip file not downloading in PHP

UltimateI've implemented the code to Create Zip Folder of Files (from db path) and download zipped folder in PHP. I am using Ubuntu OS. public function actionDownload($id) { $model = $this->loadModel($id, 'Document'); $results = array(); $results = $this->createZip($m...

0
Q: Error on reading from localfile

user3129226m stuck and i need any help if is posible The problem is that if he can not connect to ip , he stop.. dont jump to next ip from the list ip.file. It should take line by line I dont know what to do anymore.. this is my code <?php error_reporting(0); $_UserFile = "user.file"; $_PassFile = "pas...

-4
Q: how to fecth the whole data from db which has multiple pages of data

DNRI need to fetch all data in my database.My database has multiple pages.While executing the query to fetch all the data from my DB;it only fetches the data from the first page.All other data are not getting fetched

0
Q: Message Queue in PHP

Neel KamalI have developed a rest api which accepts some data and store it in a message queue (Redis List). Now from redis this data is pushed into MySQL database. The problem is client needs to wait till the data is written into mysql. I want that the client should wait till the data is written into mess...

0
Q: opencart Sub Category products in main category in admin

AsifFollowing is the vqmod that shows all sub category products in main category. I want use same functionality in admin category so that all subcategory images can shown in parent category. Please Help <?xml version="1.0" encoding="UTF-8"?> <modification> <id>Display products in sub-categories ...

-1
Q: php function to read subdir content

kosI would like to ask what I have to add to make this function to show not only the files on top dir but also the files in subdirs.. private function _populateFileList() { $dir_handle = opendir($this->_files_dir); if (! $dir_handle) { return false; } while (($file = r...

0
Q: Laravel JSON reading from POST

Vit KosSuppose I have a resourcefull route in Laravel 4.1, like next: Route::group(['prefix' => 'api',], function() { header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Headers: Content-Type'); Route::resource('user','UserController'); }); And I have controller method ...

0
Q: How to reduce the no. of page referesh

Let me seeI am using Yii and i have created a page in which there are 10 links. Whenever a user clicks on a link,a session is created containing the corresponding value.Although everything is working fine and the sessions are also getting created successfully but the problem is that With every click the wh...

0
Q: Jquery radio button submit repeats same value multiple times

user3047285I have problems creating report system. Plan is this: User has 4 radios to select and then submits one of them. First submission inserts only one row in mysql but every after that submission inserts more and more rows. Here is the code: profile.php <form id="myform"> bully<input type="radio" ...

0
Q: How to Search the Text Area field in Sugar CRM

user3069222I Want to search the description field(Text Area field) in Sugar CRM and I am Using Community edition. And Is it possible in doing the procedure given in below link??? http://www.soulbroken.co.uk/2013/02/turn-on-unified_search-for-users-in-sugarcrm/ Can any one give me a clear answer. Mani.

0
Q: How to create submenu(dropdown) in dolphin7.1?

user3129297I've been looking for how to create a submenu(dropdown list) in menu link through Dolphin7.1 admin panel. I've seen in the "Builders > Navigation Menu" options but couldn't found any thing about this. It is creating menu easily but no option seen for submenu.

1
Q: Multiple checkboxes with unique ID's through ajax

Simon AspI'm working on a website which should be done any time now, but I've got a new task to complete where I need to check check-boxes to simply archive news items. Or "blog posts" if you like. The idea is to have a check-box on every blog post and if you check that check-box, the post should be arc...

0
Q: how to remove unwanted characters from string in PHP

user3099298When i read an array i got value set like this "lat" : -37.8087928,. I want to only -37.8087928 part. what is the correct way to do that. I did it in this way: $value = '"lat" : -37.8087928,'; $ex = explode(':', $value); and $ex2 = explode(',', $ex[1]); final resualt $ex2[0] is this cor...

-1
Q: Making PHP output Bold

Brian J KirkI am having trouble figuring out how to make my php output bold, I have tried but I receive and error when I try that. I have tried to search this topic but none of the answers seem to be helping me in my situation. while($row = mysql_fetch_array($oPlayerInfo)) { Print "".$row['FirstName']."...

0
Q: Personal URL for website premium members

user3129227I'm building a website that lets you view a members (Basic Member) profile with a url of say, http://www.website.com/user.php?id=123456789, which is fine for what I'm doing, but for premium members I'd like to give them a more personalised url, say for example: website.com/user.php?id=1234567...

0
Q: Download multiple images from remote server with PHP

subbunI want a php script that download multiple images from different URL and save in my remote server. http://sitename.com/images/image1.jpg http://sitename.com/images/image2.jpg http://sitename.com/images/image3.jpg can any one please provide the full working php code. I know that i can copy on...

-1
Q: Start point in string - PHP

user3059018I asked a question earlier on how to define an end point of a string. I have now worked that out, however I am still needing to strip some more unwanted code from my string. <?php //BLOG POST INPUT HERE $x = '<p style="color: red">Test</p><iframe src="//player.vimeo.com/video/82444237" width="...

-1
Q: php error (when i click on create post it logout and session end and redirect into index )

user2953370This is full project you can find the error in posts the image the error is in this lines in the image when i click on create post it logout and session end and redirect into index

0
Q: upload asp.net using ajax FormData

yozawiratamai have a file upload code from nettuts but this is php, i try convert this to asp.net use jquery ajax and asp.net webmethod. this is html : <form method="post" enctype="multipart/form-data" action="upload.php"> <input type="file" name="images" id="images" multiple /> <...

0
Q: How to echo Wordpress Author ID in author.php?

NewUseri have a custom theme with frontend E-Mail and Facebook login. Every user gets the author role by default after registration. How can i echo the USERS ID in the frontend wich shows up by hovering about the users name in the backend? I tried this: <?php echo the_author_ID(); ?> But it does n...

0
Q: How to remove Phishing alert message in gmail?

Genx88I am stuck with a problem and I need assistance, We have a system which triggers auto-generated mail, where in mails from all module ends up in inbox, but mails from a certain module shows up "Phishing Alert inside Gmail's inbox", which is not supposed to be, as we are worried about our reputatio...

1
Q: Assign checkbox items to MySQL db TEXT column

user3129325My HTML form has three check boxes; <input type="checkbox" name="numb" value="1">1<br> <input type="checkbox" name="numb" value="2">2<br> <input type="checkbox" name="numb" value="3">3 How can I assign the checked items into a TEXT variable of a MySQL database, separated by a single space?

0
Q: insert large string into json object

Fawazi have problem when insert large string into json i need to make sure there would be no mistakes when insert this large string into json object by filter the article from special characters like (!@#$%^&*()\|';:./) and smile faces before insert it for example if i have this json { "Article"...

0
Q: Authentication for bandpage api

user3128062Hey First time poster so take it easy on me. I am trying to access the bandpage api using this scrpit which I found on github. I have very little experience with php so can't really figure out what is wrong with this. This is the script <?php function bandpageToken($client_id,$shared_secret) {...

0
Q: How can i get world wide VAT rates in PHP?

user3129330How can i get world wide VAT rates? I can find EU countries VAT rates script. But I cant find VAT rates in Worldwide.

0
Q: Format opencart select option value

user2689642I have the option named artwork which has 3 values (We Design Single, We Design Double, Upload Artwork). I want to edit the view product.tbl to format the "We Design Single" and "We Design Double" So it only shows as "We Design". I think this is the part of the code i need to edit but unsure h...

-4
Q: Creating a Bitcoin/Litecoin/AltCoin game

NeurofluxationI've been creating a CryptoCurrency game. Everything is done except the integration into the wallet. Does anyone know how this can be done? I can't seem to find any documentation on how to do it? Merry Christmas!

0
Q: how to change google map v3 marker icon on mouseover of div/link

Yogesh SaroyaI want to change the icon of a marker on google maps when I mouseover the text in a div/link. how to change marker icon on below code ? Code : var locations = [< ?php if (isset($place)) { foreach ($place as $lat) { ?> ['< ?php echo $lat['marker']; ?>', < ?...

0
Q: setting up apache to redirect all subdomains to a specific file

user3081534I want help that how to setup apache to redirect all the subdomains to a fixed file but the URL remains same like: when a user request the a.example.com or b.example.com it will be redirected to index.php and get same result in both.

-5
Q: I need free web to print solution in php

Mohamed HabeebHere can anyone tell me. there is available any free web to print solution in php like http://www.uprinting.com/ http://www.printvenue.com/

-4
Q: Sum Filtered Data After Filter Is Applied in php

user3060742team issuedwt receiptwt sri 100 100 mm 100 100 Total 200 200 If i filter team 'sri' i need total as 100 as in the database. How to Sum Filtered Data After Filter Is Applied. I using php mysql.

0
Q: Wordpress pdf attachment theme_support

jolenHow do I enable wordpress pdf attachments on a custom post type - can i use something in theme_supports? I can attach them via the media library - but how do I do that from within a post?

0
Q: How to convert provided single line of cURL code with inline parameters to a format using curl_setopt()

Eric BrockwayI'm trying to use an API from avalara.net to get sales tax data and their API documentation lists what appears to be essentially a single line of code with a long string in JSON format for connecting to their API via cURL; I'm not familiar with this single string style and am trying to convert it...

0
Q: How to generate rows and columns dynamically for users and their roles in php

Sapthagiri I have got a requirement where I need to present employee attendance for the Manager to take down the attendance in a single page. Wherein the Manager selects the date from the date picker and provides attendance fro the employees. Like if I can display rows as "Roles" and Columns with "Employees...

0
Q: How do I get the last id from a table after multiple insert

Army DesignI am adding data to three tables, I needed to get the last ID of the first table to use in the second table, which was successful with $this->db->insert_id() function, Trying that with the second table still gives the ID of the first table. The arrangment of my code is function addcrm() { ...

1
Q: Flash AS2 loading XML from php script

bitdiegoi have this problem I have a Flash application that needs to read an xml file which is dinamically generated by a php script. The swf and html files are on a different server with respect to the php script I use the xml object and this is the piece of code: var _xml:XML = new XML(); _xml.ignore...

0
Q: the session end automatically when i create a post

user2953370--------------------post.php------------------------ <form action="postdata.php" method="post"> <textarea name="textarea" ></textarea> <br/> <input type="submit" value="Create Post" name="Submit" /> </form> ----------------------postdata-------------...

0
Q: Data corrupted after download through php form

user2893605<?php global $table; global $act; global $upload; if(!isset($_SESSION)) { session_start(); } include('db_connection.php'); if(isset($_POST['choose_lang'])) { $table = $_POST['choose_lang']; } if(isset($_POST['action'])) { $act = $_POST['action']; } if(isset($_GET['upload']...

0
Q: Codeigniter handling errors in Model and Controller

JackLipariI'm trying to handling errors in Model and then pass them to Controller, but I can't catch the error in the Controller, I'm sure I'm doing some errors, but I don't know where. Here the Model: public function updateOpera($image_id, $title, $author, $year, $annotation) { try { $c...

-1
Q: preg_replace_callback() not replace pattern with a function in class

JuST4FuNI ve a function in a class that replaces patterns. part of the function is below. $text = preg_replace_callback('/\[dekanlik\]/',function (){return $this->dekanlik();},$text); dekanlik() is another function in that class which lists the members. works in local (PHP Version 5.4.21) but not wor...

0
Q: which username and password should be give in order to connect to database ,

user3123134i have those usernames and password `User name : AmirAman Pin : ** Password : ********1 Parallels Plesk : qatarreal password : ******2 DataBase : username : amir password : ***3 when i type this code in index.php file . it doesn't work and Internal Server Error apperar enter code here <...

0
Q: Google Maps API v3 KML & MySQL Integration

imbayagoI would like to know if it's possible to use the Google Maps API v3 to create a web app that can store custom routes into a MySQL Database other than read the custom routes using a stored KML file. Which option would work better on the web app? Database saved custom route or the KML version. I ...

0
Q: Form inputs to class properties

The EscapistI'm trying to learn OO PHP and I'm working on a contents manager project, I want to construct an object starting from an html form. For example, if I have a form with ten textbox (or other types of input), I sent the form in POST mode, then I want to construct my object starting from POST data. ...

-2
Q: Abstract class and implements

user3090649I have a class which contains an abstract method, which is implemented in child class. class A { public abstract function A(); } class B extends A{ public function A() { return true; } } How i can get B class's A function value in A class? The classes are in different files and cl...

0
Q: fuser process php5 cron job using high amounts of cpu

user2708100We are seeing our server's CPU spike at 30 minute intervals. this is likely caused by php5 job to cleanup session files. this is taken from our /etc/cron.d/php5 on the server: # /etc/cron.d/php5: crontab fragment for php5 # This purges session files older than X, where X is defined in seconds #...

0
Q: .htaccess throwing my website in disarray

and0rskSomething odd is happening to my website. I added a DirectoryIndex wp/index.php to my .htaaccess. It works fine in that my home page is now index.php however there was a side effect. Now, when I go to my website and I click a link, although the url is correct it doesn't load the page. Instead it ...

0
Q: PHP TCPDF ERROR: Unable to create output file the folder exist and has the right permissions

danieleI'm trying to save a pdf file using the html2pdf PHP class. The code is this: $this->html2pdf->Output('directory/file_name.'.pdf', 'F'); But I have alway this error TCPDF ERROR: Unable to create output file the folder 'folder' (the name is an example, obviusly), exist and has the right permi...

-1
Q: When i create post from post.php it session end and it log out and redirect to index.php

user2953370Download Full Project Files here --------------------post.php------------------------ <html> <?php session_start(); ?> <head> <meta charset = "utf-8"> <title>Posts</title> </head> <body bgcolor = "#F0F0F0"> <table border="0" width="100%" height="100%"> <tr> <td height="200" width="...

0
Q: Redirecting to a specific file from all subdomains using htaccess

user3081534I want to redirect traffic to a specific file when user requests a.domain.com/index.php or b.domain.com/index.php it will redirect to domain.com/index.php

 
11:55 AM
0
Q: PHP Combine Two Matrices Where Value is same

user3057706I have two arrays in PHP, one set of data looks like this: [['name'=>'tom','age'=>23,'phone'=>0123456], ['name'=>'john1','age'=>23,'phone'=>625328]] And the other looks like this: [['name'=>'james','age'=>26,'phone'=>1244124,'icon'=>'me.jpg'], ['name'=>'john2','age'=>25,'phone'=>625328,'icon'=

0
Q: Folder and files are there but I get 404 error

Ahmar AliI accidentally moved a folder on my server through my ftp client. It contained stylesheets and css files. So it broke my site. I realised it and moved the folder in the root again. But even still I get 404 error even though the folder and files are there. When I rename the folder to stylesheets12...

0
Q: Making a model persistent in the controller using doctrine2 or making the model persistent it self

dan87Hello I'm new in doctrine and I don't know what to do in the following situation: I have a controller which create a new model object "Ad". Who has the responsability of making that object persistent in the DB?. The controller because it created it? or the model it self? Acording to MVC, the mo...

1
Q: Calling a PHP script using ajax

user3122618hi i am calling a php file using ajax after an interval of time. In my php file i simply echo a text line. But it didnt show me any output after time interval.. here is my ajax code form where i am calling my php file.. <script> $(document).ready(function() { setTimeout(function() { ...

0
Q: Exclude a specific PHPCS rule for a specific file

josef.van.niekerkWe're using PSR0, PSR1 and PSR2 standards in our project, but I want to exclude a specific file from just the PSR0 namespace checking rule. Is there a way I can add a comment to the file, so phpcs ignores this rule: Each class must be in a namespace of at least one level...

1
Q: Symfony2 and date_default_timezone_get() - It is not safe to rely on the system's timezone settings

MilosI have a Symfony2 project. I updated my php to 5.5.7 today and since then, I am getting the Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case yo...

0
Q: ffmpeg comressed mp4 video is not playing on mozila file currupt error

user2519007I have compressed mp4 video using ffmpeg in php environment. Videos are being compressed but these are not playing in firefox showing error "Video can't be played because the file is currupt" while this video is playing fine in VLC media player also in chrome browser. My code of comression is as-...

0
Q: Library using PDO object

gvnI'm writing a library which requires a database connection, so it requires users to pass a PDO object as a parameter of the constructor. But as many of you know, PDO has 3 different error reporting mechanisms: Silent mode, warning mode and exception mode (http://www.php.net/manual/en/pdo.error-h...

2
Q: PHP command line error : Timezone database is corrupt

Hussain TamboliMy date.php is - <?php echo date('Y'); When I execute php -f date.php on my staging machine, I get error - PHP Fatal error: date(): Timezone database is corrupt - this should *never* happen! in /home/staging/test/date.php on line 2 But when I execute the same on my local / dev machine it ...

0
Q: Using Date time diff with timezones

user1282407I found a link earlier regarding using time diffs and getting the difference in minutes, hours and days: How to get time difference in minutes in PHP I was trying this: $date1 = new DateTime('first day of this month', new DateTimeZone('Europe/Amsterdam')); $date2 = new DateTime('fir...

0
Q: Search and open for file

SteppingHatI have a script that I have made so far which looks for a specified file in the current directory and if it isn't there, it will go up a directory and search again. If the file exists the script works fine, however if it doesn't it goes on until the script is cancelled for being longer than 30 s...

0
Q: Why I'm unable to download a pdf file which is already present onto server?

PHPLoverFollowing is the code: define(ADMIN_ROOT,'/var/www/abc/pqr/web/control/'); $filename = $test_data['test_name']; $flname = ADMIN_ROOT.'modules/tests/test_pdfs/'.$filename; header("Content-Type: application/pdf"); header("Cache-Control: no-cache"); header("Accept-Ranges: none"); header("Cont...

0
Q: PHP dividing by 10, adding +1 when result is greater than .0

Michael FalcigliaI am new at programing and I am trying to figure out how to write a variable correctly. To calculate the number for this variable I have to divide by 10 and if the result does not evenly divide, I need to add 1 on to it. So for example, lets I have to divide 294 / 10, I would get 29.4. In this c...

-1
Q: how to send id and fetch data from database and print the values using php in jquery mobile

user3121701how to send id and fetch data from database and print the values using php in jquery mobile. At present am having list view in which a list item is clicked it has to get that id and fetch data from database and print it in new page using php in jquery mobile. Can someone help me how to do this ...

0
Q: Yii loses session after redirect

6yt9BkaI have yii project and in Chrome sessions is lost. Example: config in main.php 'session' => array( 'class' => 'CDbHttpSession', 'autoStart' => false, 'connectionID' => 'db', 'sessionTableName' => 'ph_YiiSession', 'autoCreateSessionTable' =

0
Q: Creating MYSQLI only once

Charlesim trying to create my db connection this way. In Functions_BD i would like to create connection to BD and define all my functions (Login, Insert, Selects...). My class looks like this: class functions_BD { private $mysqli; function __construct() { require_once 'config.php'; $mysqli...

0
Q: URL query string not changing with .htaccess file

MalikI have this url: http://example.org/product.php?course_id=$x And I want this url changes to this: http://webeducate.org/Course-Name this is may code in .htaccess file: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^...

0
Q: ShortCode Wordpress doesnt work

Darko PetkovskiI have a shortcode that I put in my post but somehow it doent execute for some reasong. Here is the code I have: my shortcode php: add_shortcode('teammate',function($atts){ $classes=$atts['country']; $imgUrl=$atts['img']; $name=$atts['name']; $des...

0
Q: Symfony2 Extending Controller getParameter()

Nigh4mareI Want to extend Symfony2 Controller to my project that is using API but I am having error of a non object use getParameter() function look at my code: namespace Moda\CategoryBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class ApiController extends Controller { ...

-2
Q: I need help on a do_form.php file where i need to check to validate the form.php

Dan DaviesI have completely drawn a blank on this question i was given at university any help would be appreciated. Write the PHP code for do_form.php that will handle the post from form.php, where the below form resides. The code must check that the user has entered both a name and email address, and th...

0
Q: Apple APNS, on sever cant send push with php

mialkanI have been trying to send push using php on my server but I coulndt send. With same .pem file I tried to send push on my mac and it was successful. here is my code. $passphrase = 'pass'; $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem'); stream_c...

0
Q: Fix LOAD DATA INFILE when an entry has a \n

SongoI'm trying to load a csv file into my database using: LOAD DATA INFILE '".$file."' IGNORE INTO TABLE ".$table." FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' IGNORE 1 LINES The file looks like this in a text editor: header1...

0
Q: How to add comments to post with Mysql and PHP

swissedI managed to add comments to the table of Comments but it doesn't appear to the related post. I understand because the foreign key (artID) in the articles table is empty. How do I fetch the primary key from the articles table? Here is the structure of my database. SQL injections issues will b...

0
Q: problems with inheritance of variables over many pages

user2202625I have this code on bootconfig.php that is loaded in all of my pages. // What languages do we support $available_langs = array('en','it'); // Set our default language session $_SESSION['lang'] = 'en'; if(isset($_GET['lang']) && $_GET['lang'] != ''){ // check if the language is one we suppo...

-1
Q: How to echo array value in php?

user2834795I have an array $transactionDetails whose output comes out to be when I print_r($transactionDetails): Array ( [METHOD] => gettransactionDetails [VERSION] => 65.1 [PWD] => ######## [USER] => ###-facilitator_api1.gmail.com [SIGNATURE] => #######-ANdhu9ESaTkLG1iBBuUtsLA91D.M ...

0
Q: add to cart in core php script used 3 table in my project

user3064563 add to cart in core php script used 3 table in my project, one table store in add to cart but more than table table not stored in add to cart using session. my program are . <?php $product_id = $_GET['idproduct']; $action = $_GET['action...

0
Q: how can see who's online using timestamp function?

user2281190i am having problem showing how many users are online using timestamp function. what i am doing is storing last active time in 'lastactivity' database column using time(); function and updating it whenever user refreshes the page. here's code for showing lastactivity :- <? $result = mysql_query(...

0
Q: Symfony/Doctrine users in multiple databases

Rick SlinkmanFor a project we would like to use multiple databases containing different kinds of users. The website is divided over multiple subdomains. That means: 1 subdomain has 1 database. We have 1 central database to keep up with the existing subdomain databases. In the central database, we have admini...

-1
Q: how to simplify this php code using array

samI have a 'loop' to go through but I can't work out how to do this. I want to do something like array1=(2,3,10,11,13) array2=(20,22,24,27,29) and then loop though for each. Here is the long hand version that I want to produce. Thanks in advance... <?php if($values['2']['value'] == 'No'){echo ...

0
Q: URL query string not changing with .htaccess file

MalikI have this url: http://example.org/product.php?course_id=$x And I want this url changes to this: http://example.org/Course-Name this is my code in .htaccess file: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ 404page.ph...

0
Q: Wordpress custom post types and categories, posts not showing up from custom post types when queried in index.php

deadmanI have a set of custom post types in my wordpress theme, and a category named Home, to show particular posts from all post types i wish on main index.php template page. What i am doing is adding the custom post type like this in my functions.php - function livingroom_post_type() { $labels = a...

0
Q: PHP cannot modify class private var from constructor

salivanI've a function: function printCaptcha($formId = NULL, $type = NULL, $fieldName = NULL, $htmlClass = NULL) { require_once(SITE_ROOT . '/visualCaptcha/inc/visualcaptcha.class.php'); $visualCaptcha = new \visualCaptcha\Captcha($formId, $type, $fieldName, $htmlClass); $visualCaptcha->sh...

0
Q: generate range based on strings

Dmitry DubovitskyIs it possible to generate range based on string merged with numbers: AB0000003 - AB0000010 to AB0000003 AB0000004 AB0000005 AB0000006 AB0000007 AB0000008 AB0000009 AB0000010

0
Q: Yii IN Query is not working

Let me seeI am trying to create a query in yii but its not giving the desired output but throws error $name=array('tata','classmate'); // $result= implode(',', $name); $mydata='("tata","classmate","adas")'; $records=Yii::app()->db->createCommand()->select('productName')->from('products')->where( var_dum...

0
Q: how included websites work

user3052629well i was looking at some topics that is talking about my question but couldn't find or understand my specifics. i have users, i want redirect that user to a website outside my web, stay there for 10 secs, and then click a button that is confirms that he is waited those seconds, i was thinking ...

0
Q: PHP+MySQL: Search entire table for a keyword

Alex DeiworI have a trivial question. Im using PHP+MySQL managing a huge DB I want to search in a entire table a keyword I write in a input. The problem is that the main table have +100 columns, so I had to write the php query manually [...]$sql="select * from db where ID LIKE '%".$q."%' or USER_ID LIKE ...

0
Q: Laravel 4 workbench not defined

Laky I have already made one workbench and everything was ok. After a while I tried to create a new workbech and got error. Any help?

1
Q: Gmail transforms and removes HTML and CSS contents [PHP]

MehdiI'm working on a WebApp which generates some QR codes and sends them by mail to the client. I have read that to let gmail interprets correctly the CSS of the mail etc.. I should include it in the HTML in the inline way. this is my code : $qr_images_url = "http://" . $_SERVER['HTTP_HOST'] . "/G...

0
Q: Handle tmp file in form upload and pass the file to other form before uploaded

RavgI need help badly , can't fix it to working like i want..! I have two forms , one is contact form , and the other is image upload inside the contact form,the forms using AJAX for proccsesing. I dont want to move_upload_file unless the all form(contact)is submited. so so far its all working, e...

0
Q: How i set the my plugin html in body in joomla

Pritesh MahajanI want to set my plugin HTML in body tag in joomla. below my code $doc =& JFactory::getDocument(); $doc->addStyleSheet(JURI::BASE().'plugins/system/-------/css/abc.css'); $doc->addScript('http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', 'text/javascript'); ...

0
Q: Redirect request to subfolder with the parameters using htacess

ArpitaNeed to create an .htacess file to a sub folder "public" with the preceding url suppose my url is something like Base_url/MVC/items/viewall where Base_url/MVC/ is path to my folder which I would like to redirect at Base_url/MVC/public and items & viewall are my value for some parameters I am cur...

0
Q: FuelPHP ORM cannot insert related table

veeMy database: CREATE TABLE IF NOT EXISTS `ws_accounts` ( `account_id` int(11) NOT NULL AUTO_INCREMENT, `account_username` varchar(255) DEFAULT NULL COMMENT 'username', `account_email` varchar(255) DEFAULT NULL COMMENT 'email', `account_salt` varchar(255) DEFAULT NULL COMMENT 'store salt f...

0
Q: mysqli connection error across servers using php

CDubYaaI am trying to connect to MySQL database which is on another server using PHP connection. I am getting the following error and can not figure it out. Thuis is the error when I include the port: Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host 'xx...

0
Q: Search by product id

Mr_GreenIf we want to search by name or sku, we can just alter the their respective attribute settings in admin panel. But how to search by mentioning product id? I thought changing Mage_Adminhtml_Model_Search_Catalog would do the same but I figured it out that it doesn't. $collection = Mage::helper('c...

0
Q: Symfony2 Doctrine2 Many To Many get all entities with they relation entities

VardiusHow to get in controller using one SELECT all entities from one table with his entities from another ? for exaple if i have a tables: applications and categories (many to many realation) and i want to get all aplications with their categories using one SELECT. How to do that ? InnerJoin ? Then ...

0
Q: Explode white spaces in a string excluding what's inside quotes

JulienI can't figure out how to explode white spaces in a string excluding what's inside quotes. I have found several regular expressions that can do the job, but the particularity here is that the quotes are preceded by an equal sign: string = 'arg1="value1" arg2="value2" arg3="value3 value4 value5"'...

0
Q: How to select 1 row when joining table

Aigars CibuļskisMy goal is to get Users and ONE latest entry user has created, I've tried to figure it out on google but I failed, so you're my last chance. On of things I tried: DB::select('SELECT u.id, u.username, u.user_rating, u.avatar, u.created_at, e.id as e_id, e.title ...

0
Q: Some ajax error, no syntax error

VitaliiPlease help, I don'tunderstand where is error. In log I have error 500. There is my js code. $('.image_reload').click(function(){ $url = '<?php echo config_item('base_url')?>ajax/page_data/admin_add_new_article'; $.ajax({ url: $url, cashe: false ...

0
Q: How to restart compiled php-fpm on 127.0.0.1:9000

MilosI have the php 5.3.10 on my ubuntu. Now I installed the 5.5.7 and would like to restart it but when doing: /usr/local/php5.5.7/sbin/php-fpm restart I am getting: Usage: php-fpm [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>] [-D] [-F] -c <path

-5
Q: Display data from database in php when clicked on checkbox

user3129645I have arrays of check-box and i want to send value of check box to sql query using php and display data from database on same page when user click on check box. Redirect checkbox value to sql query and display result dynamically.Plz send example codes

0
Q: How do I traverse CakePHP relations?

FabioI´m trying to traverse the relations on CakePHP models. This is the database: I can access product attributes (product-> attributes) on a product model but I cannot access the product attributes on Ad model (ad->product->attributes). Here is my code: //Product Model class Product extends ...

1
Q: how to match rtmp links

Jack BenHow to match the following link structure that started with rtmp:// $link = "rtmp://00.000.000.000/live"; // GOOD $link = "http://00.000.000.000/live"; // BAD $link = "www.00.000.000.000/live"; // BAD so only matching the links with rtmp with preg_match or whatever ~ thanks

0
Q: Laravel WhereHas with polymorphic relations

edi9999it seems like the whereHas method doesn't work really well. $res = Entreprise::whereHas('labels',function ($q) { $q->where('hidden','!=',1); }) ->whereHas('labels',function ($q) { $q->whereHidden(1); }) ->get(); dd(count($res)); //shows int 2 Here is t...

1
Q: How to create a block template in drupal 7

Deepti KakadeI have created a block using quicktab module. block_name = league_websites_overview_promo_t in drupal 6 template was = league_websites_overview_promo_t.tpl.php I have upgraded my website from D6 to D7 but league_websites_overview_promo_t template not loading in drupal 7. What should be the t...

0
Q: Saving php file - what encoding should I use to work with MySQL

Pawal ZielkowskiI have one php file when I get data from MySQL where I set encoding to utf8. When Im tring to get data and display it in my php file I see there is sth wrong with some characters, e.g Magia Świąt w Jasełkach 2013-12-23. I create all php files using utf8 encoding, but when I want to open this ...

0
Q: ragrding jqplot plotting piechart with data from SQL server in php

user3058736hi i am using jqplot for the first time.I need to show a pie chart by pulling data from database i have written query and i am facing problems in converting the data in json tableI am not able to generate the graoh.Please help me in this regard.This is my code. <script src="assets/plugins/jquer...

0
Q: PHP if (isset($_POST[''])) +Jquery send in same page

MensurI would like to send a form so i don't get page refresh when i send a form. Now when i press submit button im running this code: <?php if (isset($_POST['send_this_message']) == 'yes') { echo "yes this is just example and working"; } ?> <form method="post" action=""> <input type=...

0
Q: launch a pig script with php

AngelikI am learning Pig Latin, and I would like to know how to launch a pig script with PHP. This is my line for launching the script : pig -f ../testjava/calculs_routage.pig -param input=/user/hive/warehouse/tableRoutage/ -param output=/resultatsRequetes/obj1/resultatObj1 -param date1=2013-11-08T00:...

0
Q: How to retain textbox values after navigating to other page?

user3066006I have a page(say register page) with text boxes in it. After entering values in them, if I navigate to other to page by using back and forward buttons in the browser and come back to the register page again. I want the entered text box values to be shown. Is there any way to do that. Hope somebo...

0
Q: Find duplicate keys in a single array

6bytesI have a dictionary array like below $foo = array( 'key1' => 'value 1', 'key1' => 'value 2', 'key2' => 'value 3', 'key2' => 'value 4', 'key3' => 'value 5' ); as you can see there are duplicate keys. All keys are strings. Array sits in a file and was created manually. It has...

0
Q: adding comments using php and html

user3129647I was wondering if there were any kind people out there who would be able to help me with my php conundrum! Im very very new to php and I can't quite understand how to add a comment section that is functional. I have made a database table (named 'comments') to store all of the comments that users...

0
Q: php sorting an array based on value

Mike LovelyI have a very big array. Arrays within arrays. Below is a small portion of it; [lta/] => Array ( [2012-12-31/] => Array ( [0] => 31_december_2012.pdf [1] => 31_december_2012.xls [2] => key_points.html ) ) What I need to do, is get the "key_points.html" value...

0
Q: javascript on click show/hide content

DanielI'm trying to develop a private message system using php/mysql. I've got a database set up like this: CREATE TABLE IF NOT EXISTS `messages` ( `messageID` int(25) NOT NULL AUTO_INCREMENT, `msgTo` varchar(24) NOT NULL, `msgFrom` varchar(24) NOT NULL, `subject` varchar(100) NOT NULL, `...

0
Q: My upload image code in IOS and PHP doesnt work

natijauskasI have a problem. I've been looking at other answers here but can not get solution.My code seems to work, (the log gives me my image has been uploaded to the server) but when I open the server has not gained anything.Can you help me? I'm going crazy!THANKS Here is my ios code .m: @implementatio...

0
Q: Using iframe with jquery

SabreIn my code I have a jquery script which has a next & previous page function. The jquery script loads a php script to parse a selected page. The parsed page has a div removed with the name postsArea and is placed into a div with an id of wrap. As of the moment the jQuery script is set up to put th...

0
Q: PHP foreach get part of URL and match to link

DesignSubwayI have a Joomla website and I am trying to check part of the URL against a link in a foreach statement. When viewed in a web browser the only thing that changes is the part of the URL which refers to layout. Here are some examples: http://www.myweb.com/index.php?option=com_jsjobs&c=jsjobs&view...

0
Q: insert a row after payment with paypal and IPN

user3056724it's a simple question no code needed, I'm usign IPN and paypal and it's working fine, what i want to do and i can't seem to find the way to it's getting information from a table to insert it into an other from the IPN file.Let me explain bettet with an example: I click the button , go to the pa...

0
Q: /var/lib/php5 filled with empty session files

user2708100in my phpInfo i see that the session save path is /var/lib/php5 this directory gets filled with empty files with names like: "sess_fgf5gh2prbmnfs0ah3mcvpv4p4" i am not using any sessions on my server. is this php default behaviour?. this is a problem because this folder needs to gets cleane...

0
Q: how to create a multi-selection <select> element that will submit-on-click

user1280840I want an HTML [select] element that permits the user to make multiple selections simply by clicking (not by shift-clicking or control-clicking), AND I want the form to submit whenever they do so. I can achieve either of these behaviours, but not both. The code for the first behaviour appeared in...

0
Q: Why is the username not recognised in the URI

user3051827I am trying to pass the username through URI but in console it is saying that URI is not specified , the code can be tested on this link. Ajax code is below: function Putaccount(){ //an account for the user $.ajax({ type:'put', url: 'http://creative.coventry.ac.uk/~4078078/moviereviews/v1.0/...

0
Q: Split text into array with two-words

erdomesterI know how to split a text into an array: $wordArray = preg_split('#\PL+#u', $text, -1, PREG_SPLIT_NO_EMPTY); I want to split the text into two-worded parts, so the array doesn't include single words. How to do that?

0
Q: Laravel - how do you inject variables into the password reminder email

phirschybarUsing Laravel 4.1's new password broker, is there a way to pass some data to the password reminder view? Specifically I want to be able to alter the URL of the password reset view. Looking here: http://laravel.com/api/source-class-Illuminate.Auth.Reminders.PasswordBroker.html#97-118 I am not sur...

1
Q: How To Filter (Customize) PHP out put IN Ajax and JSON

BehseiniI have a Field in MySQL table which contains Address like : I am able to query this field from MySql by suing these two PHP files(Ajax-jQuery Autocomplete Proccess) 1: GetAuto1.php <?php include("configPDO.php"); $likeString = '%' . $_GET['term'] . '%'; $STM = $dbh->prepare("SEL...

0
Q: MySql Sort by Date in JOIN Query

foxybaggaI am trying to display a news feed of items from two tables. Table 1: News - Id / Title / Date Table 2: Shared_News - Id / News_Id / Date News_Id from Shared_News is actually the Id from the News table. Now the scenario... My News Feed has to display the items from the News table and also the ...

0
Q: Why isn't my dropdown value accessible to PHP?

ElendilTheTallI have a page in which a dropdown is dynamically generated from a MySQL query, based on the choice in another dropdown - an event is chosen, and the second dropdown is generated containing instances of this event (ie the event at a specific time and place). This is done using Ajax, as per this an...

2
Q: How to sort an array with PHP, ignoring the articles (a, an, the) in the beginning?

Soumalyo BardhanSuppose I have the following array $books (the actual array is much larger): Array ( [0] => The Mystic Masseur [1] => The Suffrage of Elvira [2] => Miguel Street [3] => A House for Mr Biswas [4] => Mr Stone and the Knights Companion [5] => The Mimic Men [6] => A Flag ...

0
Q: Flex dynamic change of server

leossmithSo i am working on flex 4.6(before updating to 4.11) on a new project with php services. There is an auto-generated class called MarkerService.as which contains the following: protected override function preInitializeService():void { super.preInitializeService(); super._serviceControl.endpoi...

0
Q: how to see how many users are online using epoch time?

user2281190i am having problem of see who's online and don't have any idea how to see who's online.what i am doing is updating mysql database using time(); whenever user log in or refreshes the page. Then, lastactivity gets filled with epochtime for eg : 1387806657 or 1287373415. After that i select the la...

-3
Q: How to make #url for redirection

BerakiI would like to make something like this, www.lookoutsms.com/overview.php#draft --- To move me to the drafts www.lookoutsms.com/overview.php#inbox --- To move me to the outbox I have seen this been used by Gmail and Hotmail but I would like to know how can I do it.

-4
Q: How Can i get dynamic VAT Rate based on Country and product type?

user3129330how to get VAT rates in Percentage(%) depending upon the Country selection. Thanks.

0
Q: Laravel 3: Cache behaviour on multiple/simultaneous reads/writes

JonathanUsing Laravel's 3 Cache (file): It is safe to read/write/update Cache containing payments data and expect to always have the latest up-to-date data when multiple users are simultaneously modifying the Cache? In a web app I am building, the payments information is saved across multiple MySQL tab...

0
Q: Lithium PHP integration testing - routes.php not included?

gavD_UKI'm building a toy app in Lithium (PHP framework) based upon the Union of RAD's Framework project. It's all working great in the browser but when running integration tests, routes.php is not loaded, so the routing isn't working. Here's the code I'm testing: class StaffController extends \lithiu...

0
Q: How can i make the for loop parameters dynamic

Elton Frederikfor ($i=40; $i>=30; $i--) //code will display data for top x row for ($i=1; $i<=9; $i++) //code will display data for left y column for ($i=29; $i>=21; $i--) //code will display data for bottom x row for ($i=30; $i>=39; $i++) //code will display data for right y column These 4 loops all d...

0
Q: Access child node with it's own namespace

seaversI have the following xml string: $trimmed_result = '<PagesCreated xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><PageCreated><Appeal>General Appeal</Appeal><BirthdayName/><CreatedDate>2013-08-01T00:00:00</CreatedDate><CustomCode1/><CustomCode2/><CustomCode3/><CustomCode4/><CustomCode5/><Cu...

0
Q: mysqli_stmt::bind_param() variable doesn't match

user3121850What's going wrong in this script it is giving me error for bind_param if(isset($_GET['ID'])){ $page_id = $_GET['ID']; $page_id = mysqli_real_escape_string($con, $page_id); $select_query = $con->prepare("select * from save_data where ID='$page_id'") or die(mysqli_error($con)); ...

0
Q: Wrong values typed into input field using Selenium php-webdriver on Internet Explorer

Michael KnollWe have an issue with Selenium2 tests written with the php-webdriver API running on Internet Explorer. The version of the Server is 2.39 running on Java 7 in a Windows XP virtual machine running on Mac. The version of IEDriverServer.exe is also 2.39 In Firefox, all tests are green. In Internet...

0
Q: The best and simplest way to execute SQL queries in PHP

SteppingHatAfter the old, faithful, dodgy and somewhat simple original mysql api functions have been depreciated from PHP I started to look for an alternate method to interact with my SQL databases. Using PDO connections have worked best for me in recent times, but the code to me is all clunky and at times...

0
Q: Passing a javascript variable into a php variable

Mcclane654My web page I am trying to make a highscore list. i have been seaching everywhere for an answer to this. but I can't seem to find an answer that works. yesterday I made it work yesterday. not sure which code i used think it was something like window.location = "hihgscore_code.php=" + score but t...

0
Q: Handling data with php mysql and ajax

George PtlSo here's my problem: I want the user to type something in a form input field and click search button (i.e. page: index.php) Uppon clicking the search button ajax would handle the request and search through a .php file let's say search.php and then post the result(s) in index.php under the search...

 
2:28 PM
0
Q: Using PHP require() to increase website performance

alias51I'm looking at ways to optimise the speed of our site (basic LAMP stack), and specifically am researching the impact of HTTP requests on load times. After reading, the most definitive guide I could find be from the Yahoo Developer Network: http://developer.yahoo.com/performance/rules.html (excel...

0
Q: No errors with mysqli connection indicated but my form does not populate my table

swissedThere's no error with my Mysql query connection but when I click on Submit, it does not populate the table (articles). I have been working for hours trying to find what I am doing wrong. SQL injection issues will be dealt accordingly later. Prepared statements will be made. articleform.php <h2

1
Q: use echo or Die for debugging and logging

user1765876The questions says everything. I am logging something on STDOUT.Should I use echo for displaying or Die().As far as I know If I use die() for normal printing like die('Entered in For loop'), it exits the program. Also is it good to log to files or mysql?

0
Q: $row=$stmt->fetch(); Giving undefined index error

1994<?php try{ $db=new PDO("mysql:host=localhost;dbname=placement","rot","password"); }catch(Exception $e){ die( "An error occured".$e->getMessage()); } $username=$_POST['username']; $password=$_POST['password']; $stmt=$db->prepare("SELECT regno,password FROM pla...

0
Q: Is it possible to show an image with Yii CForm formbuilder?

DaantjeI'm looking for a easy way to show an image in a CForm formbuilder array. But I want to show the model contents, something like this example: array( 'elements'=>array( '<img src="$this->thumbnail" />', 'thumbnail'=>array( 'type'=>'file', ), ), ) Is t...

0
Q: PhpMyAdmin | Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate xxxxxx bytes) in Unknown on line 0

user3108269I'm tying to find the cause of this error but I'm failing. I've have installed PhpMyAdmin on my server and right now on the footer of every page I'm getting this error: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10934248 bytes) in Unknown on line 0 As you ...

0
Q: Get the value of the selected image

OrionCurrently I'm working on a mobile version of an article publishing application. I want to let the user search for their image like you are searching through images on Google Images(Fill in the keywords, click an image, swipe back and forth between images) The user can select their keyword(s) an...

0
Q: Limiting socket server access

grimv01kThis is security issue. I've got a socket server that should be accessed only from the same server, in other words, only from localhost. I need to somehow check if remote user that trying to connect is not an outsider. Currently I've come up with: socket_getpeername($current_socket, $client_addr...

-1
Q: PHP Creating marking scheme

EddyI'm currently doing a web server. There are 2 users in this, admin and students. Admin can create quiz while student can login and do their quiz.(consist of check box, radio and commend type question) Currently, student are able to login and see and do the quiz that admin created. Now(Step 2), I...

0
Q: accessing object and its relations in laravel 4.1

Ir1shI hope I can explain this clearly, apologies in advance if it is confusing. I have a goals table which hasOne of each of bodyGoalDescs, strengthGoalDescs and distanceGoalDescs as shown below goals.php class Goal extends BaseModel { protected $guarded = array(); public static $rul...

0
Q: Trying to Convert Image to Fixed Palette in PHP/GD

Greg SchoppeI am trying to use GD in PHP to reduce an image to a fixed 60 color palette. (I am aware that the results will look poor, it's a small part of a program I'm writing to identify visually similar or duplicate images) I have a 8x8 60 color png of my palette, here: and a test image (color gradien...

0
Q: jquery $.post not working unless debugging

TechAUmNuI have simple form for updating the stock of products, it uses datatables to generate rows for all the items in the database. I can update the stock correctly using the form when I set a break point in the function, but if I remove the break point it stops working. HTML form: <form id="updateS...

0
Q: How to save data from Fb.api to mysql

user3055639I use the below script to get friend list after acknowledge App. How can i call a value to save then into mysql table. Any suggestion ? If i do something like this in order to call it, it is not working: userInfo.innerHTML = '<img src="https://graph.facebook.com/' + response.id + '/picture">' '<...

0
Q: Social APIs not working because of cURL and SSL

Jason LipoI'm using a social authentication plugin called HybridAuth. When using it on my shared server but now I have upgraded to a VPS running IIS 7. I read that I needed to instal cURL with SSL and when running phpinfo(), all is showing to be configured properly. However, I am getting errors when tryi...

0
Q: how to 'unset' a button

user689I have the following code: <html> <title> Hilo </title> <body> <?php function compare($a,$b) { if($a>$b) return 0; else return 1; } $r1= rand(1,100); $r2= rand(1,100); echo $r1; print("<form method =post> <input type='submit' value=high class='...

-1
Q: Server not accepting URL variables

Mohamed SaidI'm on DigitalOcean Ubuntu and using laravel framework, the server strangely refuse get variables, so www.domain.com/?name=mohamed when I check $_GET['name'] I get nothing, what can be the cause of this problem?

0
Q: Mediawiki include articles from external wiki

user3129876I have created my own wiki using mediawiki. Now I would like to know if it is possible to dynamically include articles from an external wiki. For example, if my wiki does not contain an article about the topic "potato" and a user visits the page "mysite.com/wiki/potato", I would like to display ...

0
Q: php trait using another trait

FIA2008I have a trait which is using another trait, and now I'm getting errors about functions that don't exist in classes. I have simplified the code: file:settings.php: <?php trait settings{ protected function getSetting($type, $setting){ // read setting from config.ini try{ $...

1
Q: PHP Store Key Value from Associative Array into Simple Array

user3063045I'm having trouble wrapping my head around this, any help would be GREAT... I have an array $stores that is structured like so: Array ( [0] => Array ( [id] => 123 [name] => 'Store A' ) [1] => Array ( [id] => 345 [name] => 'Store B' ) [2] => Arra...

0
Q: Is it possible to put a bootstrap glyphicon inside of a {{ Form::submit(' ')}} - Laravel

GilkoI want to change this: {{ Form::submit('Delete this User', array('class' => 'btn btn-warning')) }} to something like this: {{ Form::submit('<i class="glyphicon glyphicon-delete"></i>', array('class' => '')) }} I know that the second option isn't correct, anyone knows how to write it in a c...

0
Q: IF inside sql UPDATE query instead of case

user111671How should I make a sql update query only IF a value of the table is equal to "something"? I would not want to use case because I don't have any "else" statement and it is regulated by another simple value of the table, so there are no more cases.

0
Q: Xdebug doesn't work in MAMP

Bakkie009I have MAMP with PHP 5.5.3 installed. The ending of my php.ini file (MAMP/conf/php5.5.3/php.ini) is this: [OPcache] zend_extension="/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/opcache.so" opcache.memory_consumption=128 opcache.interned_strings_buffer=8 ...

0
Q: CodeIgniter, Call to a member function post() on a non-object

user1581298i am new in CodeIgniter (v.2.1.4). I have a problem with getting post from model. I have a contoller: class Login extends CI_Controller{ public function index(){ $data['main_view'] = 'login_form'; $this->load->view('login/include/template', $data); } public functi...

-3
Q: PHP book suggestion

user3125314I'm learning PHP, and I have the basic base... I have the 'logic', know 'variables', 'operators', 'arrays(multidimensional)', 'strings', 'type of data', 'constants', 'if else', 'foreach', 'switch', 'do while', 'for', how works 'functions', some specific functions... I already know HTML, CSS, J...

0
Q: php mysql SELECT alias automatically all fields in a table?

svevais there a way to "SELECT *" but table-specific? for example, I have two joined tables that both contain the field 'test' SELECT tableA.test AS tableA_test, tableB.test AS tableB_test ... repeat for a lot of duplicate column names FROM tableA JOIN tableB i just want to do ...

0
Q: Add column to the right - PHP & CSS

user3129925I just started to learn programming in PHP. So i got an old script from a friend where i can learn on and got the following question. The scripts contains a menu on the left wich is this code: <td width="125" align="left" valign="top" class="left_nav"><table width="125" border="0" cellspaci...

0
Q: Jquery calendar plugin issue

user3019235I would like to ask you if you know any jquery plugin that displays a calendar , it does not need to be something fancy just something simple that displays the calendar in a small area of a web page. Thanks in advance!

0
Q: Search function for virtuemart

user3014837please could you advice me if there is some mistake in process of creating this page? I would like to do search component for virtuemart and I use one php file, where I have written whole code. I want to add there new conditions to $compare2 variable using array variable send2[] and by adding new...

0
Q: Scroll down to contact form at bottom of page when form is submitted with errors

rileychugginsWhat I'm trying to accomplish is when a user tries to submit the form with errors and the error messages are added/page reloads I need the page to automatically scroll down to the bottom of the page to the contact form location. I currently have the form within my footer.php and I'm including it...

0
Q: Quanitity in the checkout WooCommerce

user2674769A hopefully simple one for someone. I would like to add the quantity dropdown from the cart of Woocommerce to my checkout page as I am skipping the Cart to improve the speed of ordering. Can someone provide some advice on how to achieve this ? Regards Nicholas

-1
Q: Getting "error no link remote" message

phphungerAs i have created mobile version like m.sitename.com for which i have hosted small piece of code from which if a user requests a website from the mobile it should redirect it to m.sitename.com but instead it shows "error no link remote". Please check this url www.startandroid.com Please check ...

0
Q: Does openssl_check_purpose() check for revocation?

GeminiDominoWhen checking with (a properly specified) $cainfo variable, does PHP's openssl_check_purpose() function take revocation into account when determining validity? The documentation for the API is somewhat lacking, leaving the verification process as something of a "black box" to a non-expert. If it...

0
Q: NET::SSH2 unable to run shell script

TooCooLI use this script to add email users with command prompt everything is fine: #!/bin/sh if [ ! $# = 1 ] then echo "Usage: $0 username@domain" exit 1 else user=`echo "$1" | cut -f1 -d "@"` domain=`echo "$1" | cut -s -f2 -d "@"` if [ -x $domain ] then echo "No domain given\nUsage...

0
Q: Get a data from a different table using id

PrivateMufasaI have a table in my database called 'users' and in this table there is a field called 'rank'. This field holds the id of the users rank. I also have a table called 'ranks' in my database, and this table has 'id', 'rank_id' and 'rank_name', the 'id' being the primary auto increment field, the 'r...

-1
Q: How to display only result in page

user3127605I have a big problem. I wrote a simple $_GET system $query = mysql_query("SELECT * FROM `users`"); while ($row = mysql_fetch_array($query)) { if($_GET['user'] == $row['user_seo']) { echo 'user exists'; } else { echo 'No users found'; ...

0
Q: Fill two-dimensional associative array

newacc2010Please help me with the following issues : an array of the form header $ headers = array ('0 '=>' id ', '1' => 'Name', '2 '=>' Balance ', '3' => 'Date', '4 '=>' Region ', '5 '=>' Segment ', '6' => 'Manager', '7 '=>' Contract '); and array data type (of course, in reality, such data are not re...

0
Q: Drupal cron vs PHP background task

NickFI have a Drupal 7 site with some none Drupal web services that use some Drupal API. I need to hold a global array with some values that I need to update each minute, that is available to each call to the web service. I'm new to Drupal and PHP and I'm wondering if should I use pure PHP like: wh...

0
Q: Unable to load web service on server

Manu MohanI am calling a webservice in a php web application. The webservice is throwing unable to load error message. I am not able to take the url from browser. The strange thing is the webservice is working perfectly on my local env and on another server. The developer who hosted the webservice says no...

-2
Q: UNIX analogue for COM class

Roma  KliuchkoI have small script for screenshot creation, uses http://www.php.net/manual/en/book.com.php. Something like that: $Browser = new COM('InternetExplorer.Application'); $Browserhandle = $Browser->HWND; $Browser->Visible = true; $Browser->Fullscreen = true; $Browser->Navigate('http://www.demo.avarc...

1
Q: preg_replace to preg_replace_callback with an array as replacement

LucasI'm migrating an application to work with PHP 5.5, and I need to remove the /e character from the preg_replace function, to do that I'm using preg_replace_callback() My actual function looks like this: preg_replace ( '#\{([a-z0-9\-_]*?)\}#Ssie' , '( ( isset($array[\'\1\']) ) ? $array[\'\1\'] : ...

1
Q: Why Unpack function returns array with starting index 1 in PHP

Kumar AnnamalaiWhy unpack() function in PHP returns an array of binary data starting with the array index 1. $str = "PHP"; $binary_data = unpack("C*",$str); print_r($binary_data); The above PHP scripts prints as below: Array ( [1] => 80 [2] => 72 [3] => 80 )

0
Q: Dreamweaver PHP array dereferencing

LoiloI just installed PHP 5.4 and now that it supports array dereferencing I want to use that in my projects. Problem is that I'm working with Dreamweaver (CS6) and it gives me a syntax error for using the array brackets after the function parantheses. Is there any way to mess around with Dreamweaver...

0
Q: PHP compare date format yyyy-mm-dd

user2769635I want to compare today's date with $post_date which is a date variable in mysql. $post_exdate has date format yyyy-mm-dd $today = date("Y-m-d"); if(strtotime($post_exdate) < strtotime($today)){ $update_query = "UPDATE post SET post_status='Old' WHERE post_id ='$post_id'"; mysql_query($...

0
Q: How to retrieve an (image) file from the database and place that into a form when updating a record?

user3077781I got an issue where I cant display the filename on a form while updating a record. I'll try to explain it verbally since I'm unable to display any pictures. For normal input fields, I am able to retrieve the specific field that I want form my database. For example: <label for="name">Product Name:

0
Q: mysql client tracking system

Fts Devi am creating a subdomain to handle my client tracking. i have made a number of tables in order to allow the program to hold multiple sets of information for the same client. my tables in question are as follows: clients{ id "primary" f_name l_name } phone{ id "primary" client id "foreign key" ...

0
Q: zend gdata youtube api delete not deleting

user3130040am using PHP zend framework 1.12.3 gdata to access my youtube account. I run: $videoEntryToDelete = $yt->getFullVideoEntry($videoEntry); if ($videoEntryToDelete->getEditLink() !== null) { echo "Video is editable by current user.\n"; } else { ...

0
Q: How does the update operation work in Yii

user3004356I'm new to Yii framework. I created a table TblUser. Now, I have three columns username,password and email. I'm using CRUD operations in Yii. Connection to database is successfully made. I was able to create a new record in the table also. Now the entry in the database reads as +----+---------...

0
Q: MAMP and Dreamweaver CS5.5 - URL Not Found

user3130011I'm running into a seemly simple problem, but I just can't figure out the cause. I wanted to test a php file. I installed MAMP with all the default settings...Apache port 8888, MySQL port 8889 and document root /Applications/MAMP/htdocs. In Dreamweaver CS5.5, the settings are, Site Name: PHP Tes...

0
Q: DELETE Realtime Subscriptions

user1791488The endpoint for deleting realtime subscriptions seems to have stopped working. I'm performing a cURL 'POST' with a 'DELETE' custom request and receiving the following JSON response from Instagram: {"meta":{"code":200},"data":null} However, the subscription is not deleted. My count of active s...

0
Q: Undefined variable Output

AlbaClanI am getting the following error in debug mode from my wordpress theme. Likely a very easy fix but I dont see what to do. UNDEFINED VARIABLE: OUTPUT .... line 34 ($output variable) $categories = get_the_category(); if($categories) { foreach($categories as $category) { $output .= '<

-2
Q: retreive data from MySQL

dNiHow to retrieve data from MySQL that recorded by the same person that had logged in before? She records / saves her daily activities. The table is as follow: STUDENT stu_id stu_name stu_pass 101 sara 1234 102 bob 1133 ACTIVITY act_id stu_id act_name 1 ...

0
Q: Reading a file in chunks, weird cycle

php_nub_qqOkay so I am trying to read a 91kb file in chunks of 1048576 bytes ( 1 MB ) which is supposed to read the file instantaneously in one chunk, however this is not what I'm getting public function uploadTmpFileFromXHRStream(){ header('Content-type: text/html; charset=utf-8'); function outpu...

1
Q: Periodically retrieve all rows to find the highest 100 counters

natliI'm working on a cassandra database storing the amount of times a word occurred. I want to find out which 100 words occur the most times. In a relational database, it'd be something like this: select * FROM wordcounter ORDER BY counts ASC LIMIT 100; but ordering by a counter-column in cassandr...

-1
Q: Displaying availabilty

user3123655I have a MySQL table which gives me apartment name, start date, end date for each stay. The dates are in the following format YYYY-mm-dd. I would like to display these on a PHP page in a table showing each day of the whole year and then show those that are booked. i.e also showing the dates betwe...

0
Q: Facebook graph apprequest never delivered

LeviI setup a app request below and I'm getting some type of results, but never getting the request at either accounts. It looks from the results its only sending it to the account ending in 870 account and not the account ending in 706. I have taken the app out of sandbox and put it into sandbox wit...

-1
Q: MYSQL - convert table result into rows

user3130061I have a table with this format id1 | id2 | id3 | id4 | id5 a | b | c | null | null a | b | d | null | null a | b |null | null | null I need to have the result (a,b,c,d) I make this with php, but the code is too difficult... <?php $sql="SELECT t1.id as id1, t2.id AS ...

0
Q: Integrity constraint violation - How to create Entitys in Doctrine with Class Table Inheritance

user3129901I have a problem with creating inheritance Objects in doctrine... I´m using doctrine now for the first time... Some details: The sql database: SQL The DescribableVersionedEntity is the Superclass (Inheritance type Joined), which every Entity inheritances from. (So I have to use the Class Inher...

0
Q: jquery mobile setting selected attribute on dynamically generated select menu

hyphenI'm dynamically generating the content of a select menu in jquery mobile, and I'm trying to set the selected attribute on the first option in the menu, but it doesn't seem to want to work. Here's my ajax response: request.done(function(response){ $('#selectCat option').remove(); if(resp...

0
Q: MySQL query displays no results in HTML table with PHP

tycoonbobI'm trying to throw together a simple inventory database for a small customer of mine (I normally don't do WebDev stuff) but I'm a little stumped. I have what I think should work, but I get no results in my table. I know the query is good since I get the expected results when querying directly ...

0
Q: Setting every nth range in php

WaqasI'm trying achieve a specific style for every 3rd 4th and 5th element in loop. I know it is possible in css but I want to learn it in php too. The following code inserts class to every 3rd element. global $post_num; if ( ++$post_num % 3 == 0 ) $class = 'whatever'; echo $class; I've tried i...

0
Q: In codiginetor what so ever user can type in url but it should call default controller

user2198809In my codeigniter project if i run my localhost is like localhost/project name/typed what so ever i want to call default controller

0
Q: Kind of limitation in shortcode for WordPress

user3114390I have this function: function movie_cast( $atts, $content = null ) { $url = '/?s='; $str = ''; foreach (explode(", ",$content) as $content) { if ($str != "") $str .= ", "; $str .= '<a href=\'' . $url . $content . '\'>' . $content . '</a>'; } return '<div class="m...

0
Q: Apache Mod cache is killing my php session

user3130075I login and go to the profile page of the site. I can perform all logged in user activities. But Moment I hit a Apache Mod Cached enabled page, by php session gets destroyed. Can you please help me solving this?

0
Q: error trying to install mcrypt extension

LeabdallaI'm running PHP Version 5.4.23 under CentOS 6.4 x64 and trying to install mcrypt extension [root@user]# yum install php-mcrypt* Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.osuosl.org * epel: ftp.osuosl.org * extras: ftp.osuosl.org * updates: ftp.osuos...

0
Q: PHP Image Filter - A photoshop like effect?

ImagePHPFanI was using the GD Library on PHP and was trying to find something similar to the Photoshop Filter "Clouds", but couldn't find any appropriate function to do this. Image could be found on the following url: http://i.stack.imgur.com/1mRJh.jpg The photoshop filter works by applying two colors and...

-1
Q: All recent Edits on wordpress post-new.php lost in chrome

user2897542All recent Edits on waordpress post-new.php lost in chrome I spent one hour editing, and apparently once i started a flash audip in another tab, the php / flash combo did not work to auto save any drafts and more than 4000 rods were lost . I hit publish with all the writing inside the new post p...

0
Q: how to simulate excel drag on php form

sharifI have a form consisting of db rows and columns. I would like to highlight a text field on a row and drag down and increment the values they way you would on excel. how do i do this? is it possible?

 
4:34 PM
0
Q: how to delete all files and folder in php with permission?

user2500126i try to delete everything in folder (including subfolders) but: Warning: unlink(./../kaj-content/theme/one-four): Permission denied in C:\wamp\www\kaj\kaj-admin\includes\incAppearance.php on line 36 this is my code: $themeDirectory = './../kaj-content/theme'; $dir = $themeDirectory . '/...

0
Q: How to generate an confirmation email (replace values in template, make html and txt version & confirm)?

JamesI know I am asking for a lot, but I figured it would be better to keep everything in one place rather than starting multiple questions. I am trying to implement this tutorial into my CI project. Everything was fine up until the mail confirmation part. In the tutorial they use Swift Mailer, but I ...

0
Q: Wordpress How to list all links[pages/posts/tags/Category]?

user1942505I want to list every link on my wordpress. link to Pages. link to Posts. link to Tags. link to Categories. To everything... <?php $pages = get_pages($args); foreach($pages as $page){ wp_list_pages(); paginate_links(); // .... } ?>

0
Q: Two different $_GET variables on SWITCH (PHP)

Enric TomásIm using Switch statment to change the content of my page, like this: $id=$_GET['id']; $n = $_GET['n']; switch ($id) { case 0: include("news.php"); break; case 1: include("newsdetail.php?n=".$n); break; ...

0
Q: Convert ereg statement to preg

user2966586Trying to convert this ereg statement to a preg one but having issues. $tweet = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a target='_blank' href=\"\\0\">\\0</a>", $tweet->text); I am getting UNKNOWN MODIFIER '/' when trying to convert it over.

0
Q: PHP version changes the way to access data in array?

mipheIs there a difference in how I can access information in an Array in these PHP versions? Locally I run PHP version 5.5.3 and the following code gives expected output. On my remote server the PHP version is 5.3.22 and I get the an error. test.php: <?php function a($var){ return [1, 2, 3][$...

0
Q: understading the ternary operator in php

TecBratI'm reading someone else's code and they have a line like this: $_REQUEST[LINKEDIN::_GET_TYPE] = (isset($_REQUEST[LINKEDIN::_GET_TYPE])) ? $_REQUEST[LINKEDIN::_GET_TYPE] : ''; I just want to make sure I follow this. I might have finally figured out the logic of it. Is this correct? If $_R...

1
Q: sum up points already in the database with ones being sent

user3108623i am trying to add points for a user in a database. the way it should work is as follows: when someone sends another some points, it should calculate the current balance and add the points to the user. so far i tried but it keeps sending blank figures and mysql isnt adding up those points. i am...

0
Q: What's the difference between using ' and " in PHP?

Alex DeiworEverytime I write something in PHP, for outputing HTML I use echo '[...] '; but echo "[...]"; is valid too. Which option is best? Edit: I saw that, for example, building sql statements, if I use echo" "; I can append variables inside without concatenate --> echo "select * from $db order by $var...

0
Q: Using Javascript for setting PHP variable as HTML text field's value

cyberPheonixI am a learning Javascript and PHP, I am trying to do this , I have stored some variables in a PHP session, i am trying to set the values present in the session as the values in the form's input field, i have used javascript for that purpose, PHP : <html> <head> <link rel='stylesheet' type=...

0
Q: Doctrine error when deploying symfony2 app on pagoda box

musoNic80I'm getting a doctrine error after deploying my app on PagodaBox. It works fine in both dev and prod environments on my local machine but the live site returns this error: Fatal error: Uncaught exception 'LogicException' with message 'Illegal value passed (no array or string given)' in /var/www/...

0
Q: Laravel 4 returns blank page when using return withInput (file attached)

YgiveUpI have HTML form with contains text and file fields: <form method="post" action="{{url('control')}}" enctype="multipart/form-data"> ... <input type="text" class="form-control" name="business_name" id="business_name" ... <label for="business_name">Brand Logo</label> {{Form::file('logo')}...

0
Q: How can I debug PHP 4.3.9?

DiDayI'm working for my company with a very old and outdated version of PHP (4.3.9, with Apache 2.0.52 and MySQL 4.1.20) and I'd like to know if I can debug it in any IDE. I found some threads on the internet saying it's possible with PHP 4.3.11 and Komodo but it seems it was only possible back in th...

2
Q: Iterate through different DOM nodes and elements with php

user3130117I'm trying to create a newsletter based on a time condition. I have an XML file loaded into a DOM document. <?xml version="1.0"?> <users> <user><mail>sandro.calzada@gmail.com</mail><time>1387814834</time></user><user> <mail>b4bp_22@hotmail.com</mail><time>1387814834</time></user></users> ...

0
Q: imagecopyresized() function does not change to mentioned dimensions but to 20 x 20 px

user2509932I am using the following code to change the size but it changes the image dimension to fixed 20 x 20 pixels. Please help. $url="database_images/".$row['post_id']."_image.jpg"; $width=300; $image = imagecreatefromjpeg($url); $orig_width = imagesx($image); $orig_height = imagesy($image); // Calc t...

0
Q: Include a header with the login check to all the admin pages

user3125917I need to make a login page for the admin part of the website and I also need to make a header that will be included into all the pages in order to check the session. Now I have three pages: login page, header and the index page in the login was successful. If I include my header page to the in...

0
Q: How to pass url to php class constructor

salivanI want to include this https://github.com/emotionLoop/visualCaptcha-PHP code as a library. So I'm including class from outside folder like this: <?php printCaptcha('contact_us_form_vc',$_FORM_TYPE,$_FIELD_NAME); ?> function printCaptcha($formId = NULL, $type = NULL, $fieldName = NULL) { re...

0
Q: Website slow without https

user2536244My website is extremely slow without https on the URL. If I use https, it runs just fine. It just started doing that without me doing any changes. Could be the DNS? I really need some ideas as I have no clue why this is happening.

0
Q: Only change session variable if GET request has value

Haribo83I am looking to set a session variable based on a search conducted by the user. The idea is that the search is populated with their last search wherever they go on the site. I have the following code that I thought would set the variable if the variable geo-box was present and use the saved var...

0
Q: How to upload multiple files in PHP from a given list of file locations?

user3130223I want to provide a list of file locations where each line is like "D:\xyz.jpg", "E:\abc.jpg" etc. I want PHP to upload each image from this given list considering every line as the location from which the file must be uploaded.

0
Q: EasyDevop not displaying right UserAgent for Internet Explorer

user3088257When I use Internet Explorer 10 it says that I use mobile. I'm using EasyDevop for this is there any way I can fix this?

0
Q: PHP, MYSQL, HTML table with tablesorter

tycoonbobTrying to add tablesorter added to a page I am creating. I know very little of jquery, so I'm guessing that's where my fault is. I've added the required code in the <head> area of my page, and made the necessary changes to my table. My table still renders as it would with just HTML. Ideas? <...

0
Q: Querying database with uknown amout of parameters

YiseraHere is my situation. I'm developing a small helpdesk where the user will do a search of their problem. E.G. I cannot connect to the internet. I have on my database a table for keywords, such a internet, connection, internet-explorer, etc. What I want to do is split that sentence, I cannot ...

0
Q: Magento Shipment URL and adding survey URL

thinderyI'm trying to add a custom survey URL at the top and bottom of the email template. I'm using a very basic/stock template from magento. I have developed two templates to help with generating the URL: surveyurl.phtml - contains some logic to generate a URL $surveys = array("somesurvey.com/1", "...

0
Q: Redirect all URL's in host with multiple domains on the same server

DannyGi have the following issue. I'm using a shared server on godaddy. and i have more than one site on the same server. I need to redirect all urls from one of the sites to another URL within the same site I found this in several SO answers Options +FollowSymLinks rewritecond %{HTTP_HOST} mysite...

0
Q: $output = to return some HTML and PHP

Coplan ConsultingI am using Advanced custom fields to display team bios using a shortcode, the client came back to me and wants to have a custom image size that is then masked via CSS. It was working fine until I tried to add the custom image. using wp_get attachment_src, I am sure I am making an obvious PHP err...

0
Q: Yii: Design-By-Contract with PHPUnit

EvilKarterWhy does the call of PHPUnit in the class CTestCase works: require_once('PHPUnit/Autoload.php'); .... PHPUnit_Framework_Assert::assertNotNull($object); But if I call want to call it the same way in a file of components directory it shows me: require_once(PHPUnit/Autoload.php): failed to open...

0
Q: FFMPEG Merging Audio Drops out of source mp4

user2566289I might be making this a little more complicated then it needs to be. I'd like to overlay a background mp3 over two mp4 files (one with an audio track and one without) The total video is 10 secs (7sec+3sec video). If the Background mp3 is 7 seconds or just long enough to play during the first vid...

-4
Q: is login with facebook a necessity nowadays?

DjOnceThe title says it all. I am creating an online browser game and I would like to know if including login with facebook in my website will increase the number of users in my browser game. Thanks

1
Q: Event listener for MySQL table change?

badminIs there a php/javascript/mysql/ajax event listener or method that can call a function each time the data in a MySQL table changes - such as when a new row is added, or a row changes/is deleted. Or am I looking at it from the wrong perspective, I'm still learning AJAX. Just looking to be pointe...

0
Q: How do I forward routing to Laravel?

RobertWe have an old website that has a custom ACL and routing setup. We are slowly migrating the code base to Laravel. In order to get to a page from the old site, everything currently runs through a file called Modules.php, and the modname specifies which page should be opened. For example: /Modules...

0
Q: Why should i resize uploaded images

KenI have a script that uploads images,renames them and stores the relative filepath in my database.As i was coding the script however, i came across the topic of image resizing, but i could not find a reason as to why i should resize images. Currently, i simply store the image that the user upload...

0
Q: Is it neccessary if query runs table will be filled?

AceIf we run any query is it necessary that the table is affected after the query runs. or is there any chance query runs and table doesnot get affected for eg if($db->query("Insert into table(name) values('myname')") { //do something } I have wrapped the code in a if statement. It executes if ...

0
Q: Form Hub Data Exorter

YEN SARUNI have the website is hosted by Web Server. I use PHP and Mysql. And I also register and upload my data in formhub.org. Formhub allow us to export data to CSV. My purpose, I want to automatic import the latest CSV file in Formhub or mean the latest data to my Mysql Database. So When I upload da...

-1
Q: Can't get PHP Login/Logout script to work

eliwedelI can't seem to get the login/logout session to work properly. I'm not sure what I'm doing wrong, I'm not new at PHP but I am new at sessions. Is this an .htaccess file issue? I haven't done anything with that since this code should be redirecting to the appropriate pages. This is what I'm work...

0
Q: Safe to use HTTP_REFERER to redirect after a form submit?

ParadoxicalI have a login form on every page of my site (which goes to /login/submit.php), and when it's filled in, I want to redirect the user to the page they were on before. I'm aware that HTTP_REFERER can be unreliable because it's provided by the browser, but am I right in thinking that no harm can com...

0
Q: unexpected results using pdo AND OR

user2996371I am working on search form with multiple filters ..but having unexpected results M doing it using PDO. and created query based on url...ursing if,for statements Url:lType=sale&gender=M|F&loc=can|india|asia SELECT * FROM table WHERE 1=1 AND type like :ltype AND location IN (:loca0) OR location...

0
Q: Custom PHP Extensions on Azure

bavoI am deploying a Zend2 application to a Azure Website with php5.5. The application uses the php_intl extension. I have put the extension in the indicated place bin/php_intl.php and set an app setting to PHP_EXTENSIONS = bin/php_intl.php. The phpinfo() tells me the setting is loaded however the ex...

0
Q: PHP, uploading 2 images, only uploads 1

user1505027I'm trying to upload 2 images at time. AVATAR and COVER IMG When I select both avatar and cover and hit confirm, only avatar uploads When I select only cover, cover uploads Note that in mysql the name of the second image is displayed correctly. But missing in upload folder My code: <?php def...

0
Q: MySQL top orderers (group by email), who had an order in the last month

locoI'm trying to get top buyers by email. I'm doing this by something like: SELECT email, MAX(dt) FROM orders GROUP BY email ORDER BY COUNT(*) DESC; This works, I get the top repeated rows grouped by email. So top orders by email, sorted in descending order. The part I'm now stuck with is seeing...

0
Q: Need Help Taking JSON Dictionary and Presenting URL in View for iOS App

PrestoI have a JSON Dictionary that is pulled from a MySQL database outputting the following code: Result from JSON: { result = ( { IdPhoto = 1; IdUser = 10; ImagePath = "images/70/e4da3b7fbbce2345d7772b0674a318d5"; title = "photo 1 title"; usern...

0
Q: Getting "Error: JSON.parse: unexpected character" while getting JSON with AngularJS

user3130245I've spent the last few days trying to get around this problem. Every time I try to get a JSON object using Angular's $http.get, I get "Error: JSON.parse: unexpected character". My JSON is created using the PHP's json_encode. The PHP code is the following: header('Content-Type:application/json'...

0
Q: Kill a Gearman job by its workload

AlexeyI have 10 workers running and as I see from the database, 4 of them are hanging with certain jobs. I'd like to kill those jobs to free 4 workers. Is that something I can do knowing only job workloads?

-3
Q: Need a JavaScript countdown timer with Start, stop and that is set by a PHP variable. - New to JS

user3130314I have found a ton of JS timers but none that do exactly what I need. I need a timer that is set by a php variable (I can set it either in a MM:SS or a number of seconds format) that outputs to a div/span the time remaining in MM:SS format. To be very specific, I need a Start and Pause button a...

1
Q: Select a value in drop-down automatically based on controller in codeigniter?

Rahul BajajI Want to Select a value in drop-down automatically based on controller in codeigniter,when a view is loaded then select field value is auto select by the controller as per requirment. basically i want to manage the drop down from controller. What should i need to do? For Example:- My View...

0
Q: Payment processor with ACH that integrates well with codeigniter

mhopkins321I need to build in the ability to make ACH payments through my current CodeIgniter project. Is there a payment processor or library that makes this easy?

0
Q: Notice: Undefined index: password in C:\xampp\htdocs\Sites\ooplr\classes\Validate.php on line 15?

user3119898<?php require_once 'core/init.php'; if(INput::exists()) { if(Token::check(Input::get('token'))) { $validate = new Validate(); $validation = $validate->check($_POST, array( 'username' => array('required' => true), 'password' => array('required' => true) )); if($...

0
Q: "Cannoy use SplFileObject with directories"

quetzaluzI was trying to instantiate a blank object in PHP as per this post: How to define an empty object in PHP By defining a new object as such: $new_obj = new stdClass(); Only to get the following error: Cannot use SplFileObject with directories #0 : SplFileObject->__construct('[Project/Root/Dire...

0
Q: PHP clean URLS (.htaccess) curl from other hardcoded application

AshishOne of my application has hardcoded hitting on this url http://192.168.2.190/smapi/get?userid=blah&paword=blahblah&service=bahblabblah Now on my CentOS machine I kept file get.php under /var/www/html/smapi/ I wrote .htaccess file as fallow RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ...

0
Q: How does facebook generate image names?

metacompactnessI guess it is a concatenation of the user ID and a random number but how does facebook ensure that no two photos have the same name?

0
Q: Receive Push Image in Android once Processing done

DelvinMy PHP server is connected to a camera which is remotely triggered using an Android phone. The android app will send parameters of photos to be taken to the server (e.g. ISO). Once the command is sent to the server, user is moved to the next Activity on the app where an ImageView inside a FrameL...

0
Q: Information On My Form Not Sending To Me PHP

user2913307I have a reservation form on my website, and when someone clicks 'submit', a different random number comes up every time. Just a few days ago, when the form gets e-mailed back to me, I saw the reservation number that came up for my customer. But now it's not and I can't figure out way. This i...

0
Q: Using CodeIgniter's word_censor() to replace values in a file

JamesI would like to know if this is the best practice with CI or if there is some better way. In my project I am sending a confirmation email during the registration process. I have a HTML and TXT template. They both consist of something like this: Hello {USERNAME}, please click on the activation l...

0
Q: Php logging for search input

sifilei have problem with my search log the file php not write to log.txt file someone can help me this is my script class Log{ public static $logFile = 'log/log'; public static $filePointer = null; function writeLog($search,$ip,$action){ if (!(self::$filePointer)) se...

0
Q: PHPunit tests fail with a doctrine mock

Greg.ForbesI have been trying to mock some models into which I insert an instance of the doctrine entityManager. Why do the tests fail with the following message associated with type hinting? Argument 2 passed to Property\Helper\Test::__construct() must be an instance of Doctrine\ORM\EntityManager, ...

0
Q: PHP Form Search JSON API

Dan O'SheaI'm trying to create a query.php with a query_result.php page for an API JSON feed. I get the return on 10 items at a time but by querying for a "year" I still don't get just that year, example YearBuilt = "1999" I still get returned vessels of all years. QUERY.PHP <!DOCTYPE HTML> <html> <head>...

0
Q: How do I use "parent" in twig without exception of recursion?

SubjectI use twig for render template page, but I have an issue. "Fatal error: Maximum function nesting level of '250' reached, aborting!" If I switch limit level (250 to 1000) it's similar. I don't understand why my script didn't work (I use it like the example on the official site). file1.php : ech...

0
Q: call external PHP script with parameters

David D.From a PHP page (http://site1.com/test.php), I would like to call another PHP file located on another web site (http://newsite.com/version.php) and passsing parameters (var1=123, var2=789). Version.php should do something and return true or false, so I can test the result in test.php (if ($result...

0
Q: How to Display Indian currency symbol using html instead of rs and format?

user3128919Can anyone tell how to display Indian currency symbol and the format of rupee using html and php?

0
Q: How could I swap two elements positions using php?

NetI currently have some php that displays two... I guess you could say Elements? <?php if ($left): ?> <<?php print $left_wrapper ?> class="group-left<?php print $left_classes; ?>"> <?php print $left; ?> </<?php print $left_wrapper ?>> <?php endif; ?> <?php if ($right): ?> <<?php print $...

0
Q: Joomla location base search plugin/module

user3130363I am storing latitude and longitude in my database. I want to implement "Location Base Search" in my application. I have SQL query to get the locations in some particular radius. Problem is, I don't know how can I create a separate "search module" for it or how can i integrate it with the existin...

 

« first day (307 days earlier)      last day (3 days later) »