« first day (221 days earlier)      last day (89 days later) » 
00:00 - 20:0020:00 - 00:00

12:17 AM
0
Q: Doctrine entitymanager clear doesn't fully clear

Reza SanaieI have this piece of code: 131 $entityManager->clear('Reza\MyBundle\Entity\ListItem'); 132 133 $identity = $entityManager->getUnitOfWork()->getIdentityMap(); 134 foreach ($identity as $class => $objectlist) { 135 if ($class == 'Reza\MyBundle\Entity\ListItem') ...

0
Q: How to custom render a ZF2 Collection with matching fieldset

mobiusI've created a standard application using collections to map one to many relationships (without using Doctrine) pretty much the way it is being described in http://framework.zend.com/manual/2.2/en/modules/zend.form.collections.html and I have something like the following code: class Person { p...

0
Q: MySQL and PHP Date and Time

kenn$date = date('Y-m-d g:i A'); mysql_query("INSERT INTO admin (firstname,lastname,status,date) VALUES ('$fn','$ln','$login','$date') ") or die(mysql_error()); displays: 2013-09-27 8:09 PM instead of 2013-09-27 8:09 AM im from philippines, time format is UTC + 8:00 Beijing, Chongqing, Hong Kong,...

0
Q: Get individual values ​​from JSON in PHP

EdorasThere is JSON code from URL: { "response": { "members": [ { "memberid": "123456" } ] } } If I use this code to extract individual values​​, does not list me nothing, why? $json_url = file_get_contents("http://example.com/json");...

0
Q: How to use a php restful api-centric design internal instead of with http request

B-radLang: php Servers: Amazon e2/lamp Database: MySQL I am wanting to create a php restful api-centric web application/website. Where as I have the data/api that gets called from my front end code. Besides making HTTP/curl request calls each time I load a page, what can I do for internal API cal...

0
Q: Facebook API: best way to get like, share, comment count for a page/group post?

DamnSemicolonWhat's the best way to get the like, share, comment count for a post? I'm trying via FQL but it doesn't seem to give any data when the URL is a FB post URL: SELECT like_count, comment_count, share_count FROM link_stat WHERE url="https://www.facebook.com/Macklemore/posts/10153256675935268" ...

 
12:35 AM
0
Q: Unusual values with PHP/MYSQL floats

AnthonyI just hit an odd issue. I have the following tables in MySQL: table:deposits user_id amount 1 0.50 table:withdrawls user_id amount 1 0.01 1 0.01 1 0.01 To get the balance, I run this: SELECT (IFNULL((SELECT sum(amount) FROM deposits WHERE user_id =...

0
Q: How to convert XML (rss.php) to html?

KrisI'm new to XML, I got rss feed from website.com/rss.php containing XML <rss version="0.91"> <channel> <title>News</title> <description>Powered by website.com</description> <link>http://www.website.com/</link> <language>en-gb</language> <item> <title> Product Title 1 </title> <link> http://www.we...

0
Q: How to avoid some SQL queries in PHP?

QuarktumI am developing a PHP web app with jQuery and Twitter Bootstrap. And it uses AJAX for everything. So, I show a form in HTML5, the user press a button (class="btn"), the form is sent to PHP (jQuery, AJAX), PHP makes a query to the MySQL and echoes an answer, which is shown in the form (jQuery). Th...

0
Q: Adding to url with link

AnthonyMy url contains many variables that I want untouched (don't worry they aren't important). Let's say it contained... ../index.php?id=5 How would I make a url that just adds &current=1 rather than replacing it entirely? I'd like... ../index.php?id=5&current=1 rather than.. ...

 
12:47 AM
-1
Q: PHP MySQL adding date once a number of rows is reached

user2825330Im trying to work out how to put a start date on a website, once a number of people have registered. I want people to register and then enrol themselves onto a course, once the number of people enrolled reaches a certain number, a date is generated and then published showing the people that have ...

 
12:59 AM
0
Q: Pulling specific terms in wordpress template

hopederossettI am trying to create a two different portfolios on a Wordpress site by creating two templates, as I need each portfolio to have a different background color and logo. I am attempting to edit the current filterable portfolio template. I can see the it is pulling in the term 'skill', which I label...

0
Q: How to do the following in case of Ruby on rails

BalamuraliHow to do subdomains & seperated databases for a rails app as shown in tutorial below for php i am a newbie to to rails & ruby as well so i would like now that is any thing possible which shown in this tutorial by anatgarg in php 1.subdomains 2.multiples databases 3.database switching based on ...

 
1:11 AM
0
Q: PHP & MYSQL - Query DB Table to confirm field is in a Column

grant117I've searched to find a resolution to problem, but the results were too complex, or too simple. I have a basic login box to my site. I have an LDAP server that I query, to pull in the username's information, i.e. positiontitle. I have a table named group_id, with a column named title. I want t...

0
Q: Get data-field of above td cell

user2690363I have a button that adds a row to a table. The table is editable on click (similar to one found here: http://www.9lessons.info/2011/03/live-table-edit-with-jquery-and-ajax.html) However, I get my table data from a database. Each <td> has a data-field attribute that cooresponds with the <td>'s fi...

0
Q: I have a blank page after submitting a php mysqli update form,

user2728522Hi I am trying to complete this update and It keeps sending me a blank page with no errors and not submitting the info into the DataBase. Everything works up to the point of the prepared statement as far as i can tell, it draws the id and the other variables no problem from the database and the p...

0
Q: Show certain content if a pound sign shows anywhere on the web page

JackWe have created the below to look for a flag on our website and display a message if certain country flags show on our website. I am wanting to adapt this though to show message below UNLESS a pound sign (£) shows anywhere on the page. How would I do this? Many thanks <p id="checkout_notificati...

 
1:35 AM
0
Q: Can I add <br> tag on all images that are displayed on the page?

KrisThis is the part of the code that I'm using to display content from rss.php feed. for($x=0;$x<$limit;$x++) { $title = str_replace(' & ', ' &amp; ', $feed[$x]['title']); $link = $feed[$x]['link']; $description = $feed[$x]['desc']; $date = date('l F d, Y', strtotime($feed[$x]['date...

 
1:47 AM
0
Q: chat comet nginx apache

alexI hope the gurus can help me. file php : www.mysite.com/get_activity.php (use comet) while(true){ $actibity = get_sql_Activity(); flush(); usleep($1000000); } file :/chat_view.php <iframe src="www.mysite.com/get_activity.php"></iframe> works fine, but when I open a tab in t...

0
Q: Zend Framwork 2 - mysqli connection configuration and testing example

user1179459I am trying learn zend framework 2 via the skeleton application given, however i dont have any kind of previous experience in zend, i do know about mvc from other frameworks i.e yii,symfony, my skeleton app seems to be loading fine, then the next step wat to configure a mysql db connection into...

0
Q: Laravel 4 Queue - [InvalidArgumentException] There are no commands defined in the "queue" namespace

Emmanuel FiguerolaI'm using Laravel 4 + Beanstalk + Supervisor on a CentOS 6 VPS. It was already a pain to install both beanstalk and supervisor on the VPS, but I got through it (I have done this same installation on my local server, a Macbook Pro, and it's working fine there). I want to take advantage of Larave...

0
Q: How to create a running list using new inputs (php)

Kevin T.Basically I have a simple form and instead of refreshing the page each time and replacing the echo just to add an echo for each time the form is submitted. For reference I'm trying to create a to-do list, but this code just refreshes the page and replaces the current echo. <form action="#" metho...

 
1:59 AM
0
Q: Cannot use string offset as an array breaks in php5.2, not in php5.4

MDWarI've got this problem with php, and I guess the worst part is that it's working fine on my dev environment (php v5.4) but breaks on the test/live site on the webserver (php v5.2). So when I var_dump my $_POST["formData"] I get an array that looks like this: array(42) { [0] => array(2) { ...

0
Q: PHP code for insert checkbox value into spesific column on mysql with select form

edyI need help php code to identify my checkbox value insert in to some spesific coloumn, my form like this. <input type="checkbox" name="A" Value="Animal">Animal <br/> <input type="checkbox" name="B" Value="Ball">Ball <br/> <input type="checkbox" name="C" Value="Champ">Champ <br/> <label for="sel...

0
Q: PHP Open Page using Server as Host

Seth DuncanI am grabbing an SSO token from an ASP.Net Webservice which requires that both the SSO Retreival and then SSO Validation Page both require a whitelisted IP Address. I pull the SSO Token back using cURL with the following: function getToken(){ /// Keep IE From Caching header("Pragma: no-c...

0
Q: error printing array when looping over it

Timothy CoetzeeSorry for the relatively newbie question. Ive been stuck the past hour trying to figure out why the array named $propname does not want to print when i loop over it. Here follows my code $result = mysql_query("SELECT * FROM `player_info` WHERE `position` = 'THP'") or die(mysql_error()) ; ...

0
Q: php session in class only exists in constructor

EricI'm working on a MVC app in php. I created an instance of my controller in my index.php page and the controller handles all the requests. At the top of my index.php, i have a classic. if (session_status() !== PHP_SESSION_ACTIVE) { session_start(); } I can trace the session from the constructo...

 
2:23 AM
0
Q: Select form value using PHP

PaulieSo here's a part of a form that I'm printing out using PHP: <input type="checkbox" id="'.$s["id"].'" value="1" checked/> I need to pass the value to JavaScript but that doesn't seem to be working right now. Here's what I'm using: $("input[type='checkbox']").change(function() { if($(t...

 
2:41 AM
0
Q: Using a foreach within an object that uses arrays

brizzthe following is working code: $openchart->type("BarChart"); $openchart->options(array('title' => "Opens Stats")); $openchart->columns(array( 'Date' => array( 'type' => 'string', 'label' => 'Date' ), 'yahoo.com' => array( ...

0
Q: What separates a "rockstar" developer from a good developer? Or a good developer from a bad one?

user2812608I've been thinking about this a lot lately as I actually hire and manage a lot of developers and sometimes you can give the same project to 3 separate people and get 3 radically different results, or have one complete it in 2 hours, another in 6 and another in 14. Sometimes the guy that takes 6 ...

0
Q: Entering numbers from form input into an array PHP

user2802966<form method="post" action = "handler.php" > <input type="text" name="number1" /> <input type="text" name="number2" /> <input type="text" name="number3" /> <input type="text" name="number4" /> <input type="text" name="number5" /> etc.. I have a form set up like this to take in 10 diffe...

0
Q: External Page Login using POST Form

newcomerI am trying to login a external page by using a POST Form as - <form id="login-form" action="https://www.superfax.in/superfax/do_login/" method="post"> <ul> <li><label for="id_username">Login ID</label><input id="id_username" class="text_box_small" type="text" name="username" maxleng...

-2
Q: how to find average of value by using php

mzavaam very new in php am skacking on this, please can any one help me on how to get average of this values of v01 from table "Marks" by using php. Note v01 or v02 is student idnumber,thank you in advanced. And this is Marks table with the following fields. Idnumber Math Geography English v01 ...

 
3:11 AM
0
Q: I need to take a master.txt file and copy all matches into a keyword.txt file

Isaac BodaI'm trying to reduce the amount of work I need to do each day through PHP and am a total novice to righting it, especially when it comes to using patterns and finding matches. What I need to do is take for example (master.txt) bonsaimimarlik.com,9/28/2013 12:00:00 AM,AUC imimarlik.com,9/28/2013...

-1
Q: Whats wrong, my code seems alright but my connection wont work to my database

Riong RiongPlz check my code and see if I made a mistake, I'm using 000webhost. I hate it. There connections are all so complicated: <?php $email = $_POST['email']; if ($email == null) //add more tests as needed. { die("You must fill out everything on the form!"); } else ...

0
Q: How to clean images from the cache folder

chandooI am creating dynamic thumbnails by PHP script in cache folder. But the size of the cache folder is becoming huge in volume. Do any body know? how and when it will be cleared.

0
Q: PHP Insert with foreign key relation

user2825471first at all thank you very mucho for read it. I have a problem making insert sentences. I have the connection making right and all those things cause i can insert that in other table BUUUUUT in this table i have a foreign key relation with another table called langs so the language_id is a f...

0
Q: PDO Find a needle in a haystack SQL statement

0n35I am using PDO, and am thrown an error when using the following code: $stmt = $pdo->prepare("SELECT username FROM users WHERE WHERE INSTR(`games`, '{$gameid}') > 0 "); $gameid = $gamedata['id']; $stmt->execute(array( ...

0
Q: Trying to join two simple tables using Doctrine 2

Rafael AdelI'm quite a beginner at Symfony 2 and Doctrine 2. I have two models a Blog post and Comment. They are related to each other by blog_id FK inside comment table. I just want to create a simple method that takes a blog id, Retrieves that blog and related comments. Instead of doing another query in ...

0
Q: MySQL Optimization for data tables and Query optimization

DrenferalisSo a LOT of details here, my main objective is to do this as fast as possible. I am calling an API which returns a large json encoded string. I am storing the quoted encoded string into MySQL (InnoDB) with 3 fields: (tid (key), json, tags) in a table called store. I will, at up to 3+ months lat...

0
Q: I cannot get my verifying email to work, what am i missing?

Kevo89$TableName = "interns"; if ($errors == 0) { $SQLstring = "SELECT COUNT(*) FROM $TableName" . "WHERE email=$email"; $QueryResult = mysqli_query($DBConnect, $SQLstring); if ($QueryResult) { $Row = mysqli_fetch_row($QueryResult); if ($Row[0]>0) ...

0
Q: How to authenticate user with symfony and facebook

pregmatchI was able to connect Symfony and Facebook API. I am getting all data that I need including email. I do not want to use ready to use solution (FOS or something like that) . Once I got email from fb I am checking that email against db table with doctrine and I am getting User object. How can I...

 
3:54 AM
0
Q: PHP and AJAX Error In Recieving Data

PHPorDieI have an input field on my website. When users start to type the name of their school in this input field, the <select> tag below should automatically do the following: 1. Access my JavaScript file (this works) 2. The JavaScript file should retrieve the value of the <input> and pass it onto a ...

0
Q: MySQL Transaction Patterns

user2545925I'm stuck on how I should fix this problem involving MySQL transactions. The scenario is complex, but an analogous situation is as follows: I have a post table, with tags bound to these posts through a one to one relationship (via a binding table). That's three tables. What I want to do is "upd...

0
Q: UTF-8 Foreign Chars Break When Sent To Facebook/Twitter API's

Todd JenkI am using both the Facebook and Twitter OAuth API's to register users and at the same time make a post (written in Korean) to the respective accounts. For Facebook I have opted to us their JavaScript SDK and once integrated everything seems to work fine. For Twitter I have integrated with a popu...

0
Q: How to get the difference of date now subtract "September 20, 2013"?

user2825509i want to get the difference of formatted datenow() and months written in words ex. $date1 = "10-01-13"; $date2 = "September 28, 2013"; ??

0
Q: why cant i echo imap headers subject line? php

user1397417Using the following class: class Email_reader { // imap server connection public $conn; // inbox storage and inbox message count private $inbox; private $msg_cnt; // email login credentials private $server = 'xxxxxxxxxxxx.com'; p...

 
4:18 AM
0
Q: if statement is equal to a value

Jess McKenzieI have a result(string) of 1,1,0,0 Currently all of my check boxes are checked. How can I code the code below so that if its 1 its checked else its not? foreach($assoc_categories as $sub_array) { if($sub_array['state'] == 1) { ...

0
Q: Prefilled html file input?

Lawrence SheaSo I have a very simple file upload form, code below... <form enctype="multipart/form-data" action="$theaction" method="POST"> <input name="source" type="file"> <input name="message" type="text" value=""> <input type="submit" value="Upload"/> </form> I was wondering if I can set with php ...

0
Q: Whats the root cause for "Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE"?

user1266343I have the below method, but when ever i run the application im getting following error, "Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE" public static getExcludedEmailCount($email){ db_set_active(TEST_DB); $sql = "select COUNT(*) from person WHERE SUBSTRING_IND...

0
Q: Select users whose birthday falls between two dates

Danny WalshI'm trying to write a query to select users whose birthdays fall between two dates. Not there their exact date of birth but their birthday. So basically if the day and month of their birth falls between two arbitrary dates. I have been able to select users whose birthdays fall within the next ...

0
Q: How to properly return success and failure from web service?

Adam JohnsFor example my login php server code does something like the following: if (validate_password($password, $hashedPW)) { echo "Successful login"; } Then on the client side if my response from server is the string "Successful login" I respond to a success. Otherwise I respond as if a failure oc...

1
Q: Why should we change the Security Salt value in CakePHP?

Hardik ModiWhile installing cakephp i got below mentioned error: Please change the value of 'Security.salt' in app/config/core.php to a salt value specific to your application I know the solution and it is working absolutely fine for me. But just for satisfying my eagerness, I want to know that Why shoul...

0
Q: Want to delete a row from a table using php pdo

prakashfireI want to delete a row from a table using php pdo.I am using the following code, $dsn = 'mysql:host=127.0.0.1;dbname=as1'; $user = 'root'; $password = ''; try { // Connect and create the PDO object $pdo = new PDO($dsn, $user, $password); $pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::E...

 
4:42 AM
0
Q: codeigniter connect two database

LighterI use codeigniter 2.1.4. I record my session to my database1, and I query database2 data. But session will not found database2 table. I don't want to record session to database2. The error message. A Database Error Occurred Error Number: 1146 Table 'database2.sessions' doesn't exist SELECT...

0
Q: Mysql Insert Large data

Snippetfor now im trying to optimize some codes.. What is a better way to insert a large data into table? Consider this code is running. $arrayOfdata = execute query (SELECT c.id FROM table1 ) getting all the data from table1 storing it to array and inserting it on the table. private function ...

0
Q: Stumped on code

Juliana WildeTrying to fix the code. I'm pulling errors on lines 3, 5, and 9. I'm stumped. It seems pretty good, but its not :/ <?php if($_POST['submit']) { if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST[$_POST['comments'])) { $error = true; }else{ $to = "theloreg...

 
5:00 AM
0
Q: How to check Referrer url is Domain OR Sub domain in PHP script

user891418I want to check the Referrer url is Main Domain or Sub domain, domain can be anything like .com , .net ,.co.in , in .. Sub Domain also can be different type… any one can suggest idea in PHP script ….. For e.g if referrer url is http://google.com is the Domain, http://in.google.net is the sub dom...

 
5:12 AM
-2
Q: please explane me ... xmlhttp.open("GET","gethint.php?q="+str,true);

user2819984in this code line xmlhttp.open("GET","gethint.php?q="+str,true); whate is meaning of gethint.php?q="+str and whay this is important

0
Q: How To Add An RSS Feed To My Search.php file?

OfficialAkashI'm running a social network and right now my search.php shows results for people, and tags. How can I add an RSS Feed? I own a blog and I wanted to add my RSS Feed to the search so whenever someone searches for a topic it will show up on the search page. Here's the search.php code: $feed = new...

0
Q: $.post to Codeigniter Controller/Method 404 Page Not Found

Matthew WittI have developed a Codeigniter prototype application and hosted with Godaddy.com during the development phase for testing purposes without issue. This application uses a combination of javascript, jquery, HTML5, CSS and PHP (Codeigniter Framework). This week I have transferred the application t...

0
Q: Tank_auth session stopped working when i was working with config.php in codeigniter

AH.<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /* |-------------------------------------------------------------------------- | Base Site URL |-------------------------------------------------------------------------- | | URL to your CodeIgniter root. Typically this ...

 
5:36 AM
-1
Q: Show details when I click "+" sign

user2656724Hello I have a big problem showing details when i click "+". I have really no idea about this but I think ajax andjquery` is required to this kind of problem. I have provided a link to what exactly I am looking for. Any idea or a link that will bring me to what i am exactly looking for is much ...

0
Q: inserting two rows with paired id mysql php

Edmar CruzI have a query: mysql_query("SELECT * FROM match ORDER BY id ASC"); The results will have these: ID Name Age 1 Mary 18 2 Edward 18 3 Jen 22 I want to pair Mary and Edward because they have the same age: The expected result will be: 1. Mary ID 1 Age 18 match to ID 2 Edward Age 18 2...

-2
Q: Online Subscription Payment System

Suraj KumarI need a quick idea how fresh books or zoho Invoice, and other online invoicing softwares process user payments through PayPal, 2checkout.com, and other payment gateways. Please help me!

0
Q: Why do I have to use POST instead of GET?

Debadrita NandiWhen I use <form action="code.php?id=1" method="post"></form>, the form id is passed in the URL. But when I write the same code by replacing 'post' by 'get', the id is not passed to the url. Why?

0
Q: Can I set max execution time in php.ini to be 30,000 in my case?

user2553381Scenario is that I wanna save 4046 images to a folder . (Have coded in php ) I guess it would take maximum of 5 hours . Initially max execution time in php.ini was set to 30 seconds . After 650 images got saved , The browser froze . And none of the images got saved .But the process was running . ...

0
Q: how to get data from url link to our website

Agoeng Lauwi have problem with my website,i want to get all schedule flight data from other website,i see its source code and get the url link for processing data. Can somebody help me how to get data from current url link then displayed to our website with PHP?thanks

0
Q: How to change column values into rows values in mysql?

user2711066Hi to everyone, I am working in xml feed parsing section.In my database table structure is shown like this: Here my needs is every sponsor are placed in single row not in multiple columns. For example : bookmaker_quote scommessatipo_quote q_1 q_2 q_3 PINNACLE ...

0
Q: Menu dropdown simple with PHP array

Ryoi need your help ... i want simple menu dropdown in array() .. example : <ul> <li><a href="?menu=home">Home</a></li> <li><a href="?menu=about">About</a></li> <li><a>News</a> <ul> <li><a href="?menu=news-1">News 1</a></li> <li><a href="?menu=news-2">News 2</a></li> <ul>

0
Q: Putting new line feed in the text for an email php

Muhammad UmarI am using following code $message = $mess0 . "</br>" . $mess1 . "</br>" . $mess2 . "</br>" . $mes1 . "</br></br>" . $mes2 . "</br>" . $mes23 . "</br></br>" . $mes3 . "</br></br>" . $mes4 . "</br>" . $mes5 . "</br>" . $mes6 . "</br>" . $mes7 . "</br>" . $mes8 . "</br>" . $mes9 . "</br><...

0
Q: \n not putting text on a new line in php error_log function

Brady LatshaI'm trying to get my errors in my error.log file to be on separate lines, but \n does not seem to be doing that. I feel like i'm missing something easy, but it's all on the same line so if i have a bunch of errors in there it will be almost impossible to find them. <?php $msg_one = "Error messa...

0
Q: Split serial number of an array

BasI have the following array of numbers ($data) and i want to split this into two arrays (range1 and 2). I just will not advance as you can see. Can someone give me a tip how I can fix this? $data = array( 16,17,18,19,20,23,24,25,26 ); $range1 = array(); $range2 = array(); $firstday = reset( $d...

0
Q: querying database with array variable

Timothy CoetzeeIm working on a page for a sports team where the coach can select his team. What im trying to do is: 1) Print different positions 2) Assign next to position name, players who are ONLY relevant to the position. (i.e if the positions name is flanker only flankers should be displayed in t...

0
Q: POST Request via PHP not returning anything

John SmithI'm new to OOP so I might be missing something. I've looked at the code for a bit and can't figure out why it isn't returning any results. The Class is below (my API key is correct - I just changed it so people can't access my account): <?php class Inputs { private $URL; private $Key;...

0
Q: compare many variables to a single value

user2805953please suggest me that i have more than 50 variable($vacent_seat1 to $vacent_seat50) and i want to compare them with 0 and then proceed for mysql query...... what is the easy way to solve them..... most thing is that these variable is not from database and like that in room 1(select by user) ...

 
6:30 AM
0
Q: PHP : Can retrieve data from db but can not insert

AvinashWhat am I trying to do is : insert data into a table having two columns and showing the updated value in the same php page. I am able to fetch data and show it but not able to insert any. Please guide me. file is named as mypage.php My code so far : <?php $con=mysqli_connect("localhost","test...

0
Q: create dropdown menu on each loop assign database value to option element

Timothy CoetzeeIm working on a page for a sports team where the coach can select his team. What im trying to do is: 1) Print different positions 2) Assign next to position name, players who are ONLY relevant to the position. (i.e if the positions name is flanker only flankers should be displayed in the drop-d...

0
Q: how to combine spinner android to my java file

Dwi Apriyantoi want to select value from spinner and then insert to php mysql? how to combine the spinner.java to my tambah_user.java file I have two java files. 1.spinner 2.insert data to mysql how to merge two files?? This is my java code any body help me? spinner.java public class spinner extends Ac...

-1
Q: How to connect HTML5 to Phpadmin database?

MrdahdoulAm currently working on a website(html 5) that calculate the expenses for the user, after the calculation, user has to save it as report for future purposes. So i wanna know if there is anyway to connect my website(html5) to database using phpadmin. thankyou

0
Q: PHP not running through next if statement?

Skylar WhiteI'm creating a wrapper for an API and it has many different 'actions.' It only runs the first action and returns the else statement if the $Action parameter in the function isn't 'getbalance' How can I make it work with all actions depending on the parameter I pass through? if($Action ...

-1
Q: Possible vulnerabilities in my php website?

Satheesh ThangavelI'm in a project of accounts. I know question sounds like crazy, But I wanna prevent from hacking as far as I can. So please some expert might be here, Let me know some basic/advanced vulnerabilities that cause hacking so that I can avoid those and strengthen the site. Thanks buddy.

0
Q: PHP if functions based on input information not working

Kevin T.Basically I'm pulling information from a form, and I want to echo different things based on a user's input. However, I'm only ever getting the first result. How can I fix this? Here is the code: <head> <title></title> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui...

-1
Q: receive sms via url : PHP code to asp.net C#

ahmad ebrahimiOur SMS web service provider permit us to receive SMS through URL, but sample code is written in PHP, may some one help convert it to asp.net c# : <?php $sms_username = 'YOUR USERNAME'; $sms_password = 'YOUR PASSWORD'; $from = $_POST['from']; $to = $_POST['to']; $message = $_POST['message']; $t...

-1
Q: Encrypting PHP page

Andrew SmithI have a basic PHP page that uses user input from a HTML page to generate a list for the user. How do I encrypt this page to prevent users from accessing the source code? Thanks, Andrew

0
Q: Not recognized xDebugger for phpStorm 6.0.3, working with lampp

cuttySarkFrom a few days I am struggling with connecting xDebugger with phpStorm. My env consist linux(on ubuntu 12.04) lampp, phpStorm v6.0.3 When I pass ./php --version under /lampp/bin it shows: Xdebug requires Zend Engine API version 220090626. The Zend Engine API version 220100525 which is installe...

0
Q: error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax

user2663230I want to find near by locations (php & Mysql), "SELECT * ,((ACOS(SIN(33.9697897 * PI() / 180) * SIN(`lat` * PI() / 180) + COS(33.9697897 * PI() / 180) * COS(`lat` * PI() / 180) * COS((-118.2468148 -`lon`) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS distance FROM `gladlashes` HAVING distance<...

0
Q: PHP Gearman installation

PRASANTHi have trying to sort out gearman extension for php for nothing is going correct. I have tried to install gearman-1.1.2 as per the instructions given in the website. Install gearman Thanks for the great article since the install went on smoothly. But after restarting apache2 and tried to enter p...

0
Q: Error: Data truncated for column 'lat' at row 1

farzaneh abolqasemii want store my point on map into mysql database by submit form. my 'lat' data is float(25,20) and i try to save 37.41590458202049 in this field. but i get this error:'Error: Data truncated for column 'lat' at row 1'

0
Q: Open.window with PHP variable passed to it

tripleddevHow can I get the following to open a window with the message variable? I'm assuming there is a way to get this to work but so far I've had no luck. echo "<script>myWindow=window.open('','','width=200,height=100'); myWindow.document.write("$message");</script>"; given the contents of the ...

0
Q: Why is this echoing the values that don't match?

Isaac BodaI believe I am setting the if(strpos()); correctly. I've tried setting in a else{}; and elseif {}; after seeing it in a few examples, but they prompted for unexpected '}' and so forth. <?php $extension = '.com'; $lines = file('testdomains.txt'); foreach($lines as $line) { // Check if the l...

0
Q: How to redirect through 'POST' method using Javascript?

Satheesh ThangavelI've queried and doesn't work out what I've found. Is there any way to redirect to give url with POST method using Javascript or jquery?

0
Q: Access Gmail's email without imap or pop3

WasimI have a problem, i have developed a code to access Gmail's email via imap but most of online server don't allow opening of port 993 even on dedicated IP which is necessary for imap. I am confused, How to access gmail's email without imap What's online server mean when they say they support ima...

 
7:24 AM
0
Q: Issue while coping tables on PHP SQL

RiKoAll id are auto_increment. I will try explain my issue understandable. I just want copy 2 tables to another 2 tables. Here my tables at below: table1 id number 10 100 11 102 12 105 13 106 table2 id number_id subnumber 52 10 10 53 11 15 54 13 ...

0
Q: How to know the remaining monthly payments based on the amount received?

user2825509may I ask some question .. and here it goes . if I input an amount of P200,000 then my monthly payments are the following: ############################### # Monthly Payments ## Remarks # ############################### # 43,590 ## Pending # # 43,590 ## Pending # # 43,590 ...

0
Q: selecting Month from time stamp

user2802100I want to fetch data according to month. Date is stored in timestamp. select pdate,COUNT(*) from qchat_sessions WHERE month(pdate)='10' i am using this query but thats not working correctly. and how to echo the date from time stamp Thanks

0
Q: The pattern value under Rules in Yii, why stars with "/" and ends with "/u"?

rajuI am analyzing some regex concepts basics, we all know '^' symbol used in beginning of expression starts with some value and '$' used in the end for expression ends with certain value and if they are used together '^exp$' it can be matched only by exp. But in Yii while declaring rules like For a...

 
7:36 AM
0
Q: how to make comments or comment box like facebook?

user2717260i need comments to display like facebook i attached one photo from facebook you can easily able to understand my point here is my code image for example ---- http://phptestingweb.6te.net/ index.php <html> <head> <script src="jquery-1.9.1.js"></script> </head> <body> ...

0
Q: htaccess redirction from www to non-www url with ssl certification

user2825802i would like to redirect my site form www to non-www url with ssl certificate. i have write the code RewriteCond %{HTTP_HOST} ^www.(.) RewriteRule ^.$ https://\%1/$1 [R=301,L] that works but if url have any get request it'll get redirect to the home page.

0
Q: Return value from php top level php script gets swallowed

arkaschaI am hunting a bug in an application which I could narrow down to a required return value not getting returned as a result of a http request to an http server. The request is a POST uploading a file, the return value should be a confirmation in form of a string that can be used to access that fil...

0
Q: PHP foreach loop takes array element not in order

sandyI have an array I am building like this: $acids = array(); foreach ($sortedArray as $h) { $acids[] = $h['account_id']; } $uniqueAids = array_unique($acids); When I then run through that array to output it, I expect this: Array ( [0] => 353 [1] => 176 [2] => 9 ) but i get this : Array (...

0
Q: Issue with curely brackets php

JestyI have a registration page to register students, but my page keeps reflecting theres an error with my curely bracket Parse error: syntax error, unexpected '}' in C:\Program Files\EasyPHP-5.3.3\www\Enrollment_System-www.webdevelopplus.com\enrolsys\registerwrite.php on line 65 Source <?php ...

 
7:55 AM
0
Q: Ajax call not updating first time

marvanI used Ajax call for display data and update data. Ajax call working well but it's not updating at single time. database updating well in server. For UI part it's not updating. Used Ajax Call $('#loginbutt').click(function(){ $.post('data.php',{action: "update"},function(res){ $('#resul...

0
Q: how to run composer.phar self-update in travis

kimsiaI am facing warning statements in my travis builds. Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/home/travis/.phpenv/versions/5.3.26/bin/composer.phar self-update" to get the latest version. How do I then run this? See an e.g. here

0
Q: JS inside accordion tab menu not loading

user2784854Thank you guys and stackoverflow for support. I have a accordion tab menu. Every tab I am having chart like line chart, bar chart, pie chart and so on. I have included the js for the charts on the head section of html. When the page load only the chart on the default open tab is showing when cl...

0
Q: Htaccess to 2 domains, change tecnology, change folder

user2825824I have this situation: The first domain (Es: forniture.endomain.it - old site in English) will have to do a 301 in the sub-directory domain-specific www.301pointdomain.it (Eg: www.301pointdomain.it/en/). The second problem is I have to do the 301 www.originaldomain.it in the sub folder for the I...

0
Q: How to get rid of highlighting any other day except current in the current month?

user2825126Here's my php-code responsible for a navigation. function previous_month() { return mktime(0,0,0, (CURRENT_MONTH == 0 ? 12 : CURRENT_MONTH - 1), (checkdate((CURRENT_MONTH == 0 ? 12 : CURRENT_MONTH - 1), CURRENT_DAY, (CURRENT_MONTH == 0 ? CURRENT_YEAR - 1 : CURRENT_YEAR)) ? ...

-1
Q: Getting users hoatname

user2809625I'm trying to get the users hostname. but I can't find any script on this. example if a user is sending _post from his domain to my domian. This is writting in PHP $Cus_hostname = $_SERVER['HTTP_REFERER']; echo $Cus_hostname; This is giving me the total url. ex. http://www.userdomain.com/bla...

0
Q: Thumbnail from Blob PHP/MSQL

amitI have a situation where, i am using an Api which returns me "medium BLOB" data of image which i upload. And i have to show all image stored in database on browser....which i am able to show. Problem: I wanted to show the thumbnail image now on page from the blob content from database, which is...

0
Q: Get lastest message between users and when viewing message display all messages between users

user1415303I have made a pm system , atm it works so each message is individual in the database and just gets the sender and receiver id's i need to find a way of calling the last message beteen users on the inbox page and when viewing a message display all messages between them and have a quick reply form....

0
Q: post xml using curl

Harun Thuoi'm trying to post xml via HTTP POST method...the code works fine and displays the desired message.."Data received successfully"..problem is, on looking it up on the backend, the data is not posted on the Agenda Creative backend..where could i have messed up??thanks in advance. <?php f...

0
Q: getting date from string in object

AtroXI save my dates as datetime in my db (e.g. 2013-09-23 15:00:00). When I create an object I call this date by $event->start When I just echo it, I get the right value but it is a string and no longer a datetime. That is why this won't work: date_format('d-m-Y', $event->start) To use date() ...

0
Q: Webview load to original stage when screen orientiation change in Android

ThihaHere my Activity class public class VisitmmActivity extends Activity{ private WebView visitmmWebView; private static final String VISITMM_URL = "http://mobile.dev.fio/"; /** * called when activity is created */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCrea...

0
Q: How to check if a category has a parent category?

PhatToniIm trying to check if 'categoryone' has a parent. Right know I can check and see that there is a category called categoryone, but not if categoryone has a parent category. I have tried to code something like the code bellow. $tid = term_exists('vvt', 'category', 0); $term_ids = []; if ( ...

0
Q: PHP MySQL Search and Results

CarlLets say I have table with the following... id | name | tag 1 title tag-1, tag: 2 A post displays a link like so... http://www.site.com/tag/tag_2 On the tag page, it searches the $_GET for the tag and displays the results. I want to display the original tag name which would be ta...

0
Q: how to set an image as featured image of a post with php on Wordpress?

JojoLapin45i would like to set an image as featured image of a post. I found this piece of code in the wordpress documentation, it saves the image in the upload directory but the image is not set as featured image of the post (37 in the code) anymore. Can you please take a look ? thanks a lot <?php $wp_...

0
Q: can't display user's avatar for different users stored on database sql

Darah Janica dela cruzi want to display user's avatar. this code only display same avatar.the avatar of the logged in user. supposedly this is for user's avatar when posting status. help guys. data type is long blob for the pics <div id="newsfeed"> <table> <?php $isa = "Select * from status order ...

-2
Q: how to use variable to the place of element in array in php?

user2805953can i use this in php where $avseat1_10(available seats in room 1 for rooms capacity-10 ), $r1_10(Total seats in room1 for rooms capacity-10) i want to ask that how to use variable to the place of element in array in php? ` $vacancy=array($avseat1_r10=>$r1_10,$avseat2_r10=>$r2_10,$avseat...

0
Q: Proceed if current time is within the 15 minute period after a specific time

cianzIf I have a specified time (23:55 for example), and I want to proceed if the current time is between 23:55 and 00:10, how do I do this? the specified time does not have a date attached to it.

0
Q: PHP optimization with class

Alessandro MinoccheriI have a project in codeigniter but isn't releveant. I have to search inside many external server cars with some search criteria like (sell zone, price, model...). I make a query in xml to some external server that response to me with an xml, now I have create a model foreach provider (external...

0
Q: POST data and maintain connection to receive response

Chud37Is it possible to POST dat via PHP, and maintain the connection in order to recieve a response? My thinking would be that in order to have a two way conversation going, I would POST data by cURL and then provide the second party with another URL in order to talk back to me. However I am being t...

0
Q: Parse error: syntax error, unexpected T_PRIVATE

user2825890I'm getting the above error on my site, here is the code and it says line 104 which relates to private function SetPreorderData() - ie the first line of my code. If anyone can shed any light on this i'd appreciate it! private function SetPreorderData() { $GLOBALS['SNIPPETS']['ProductExpected...

0
Q: PHP Imagemagick installation - XAMPP and macosx

sbaaaangHi how can i nstall Imagemagick extension for XAMPP on a macosx Lion? I'm trying both googling both searching for past questions about but i can't find anything. I Only found how to install it on windows :( Any help appriaciated thanks!!

-1
Q: Is it possible to include a file which is in my PC?

aqkhanI am trying to do a little tricky thing to include a file in my index.php file so that when ever a user try to access that page it checks for the file test.txt in the user PCs (My documents) if it is there JUst ok.If the file is not there exit , dont let him show the login page(index.php). this ...

0
Q: Will adding no cache meta + php headers cause css/js not to cache too?

y2kHad a problem with the dynamic site (100% ajax) not updating when it goes to different pages. I just want to cache the html pages. The css and js is unchanging, I WANT that to cache you know? I added the following php Response::header('Cache-Control', 'no-store, private, no-cache, must-revali...

 
8:55 AM
0
Q: How To Grouping And Then Sorting Query SQL Server 2000 From Different Database Using PHP

Ronal DamanikI had a case like this. there are several branches database. I already can create a report using PHP that show name product, total sales, then grand total for all name product. Now i want create a report for all branches database. How to do it? I want create a report like this, The report must b...

0
Q: insert multiple arrays to database

user2825914I am creating a multiple choice quiz and I don't know how to insert multiple arrays to database. Please help. Here is my code. <?php if(isset($_POST['btnCreate'])) { $inQuestion = array($_POST['inQuestion']); $inAnswer = array($_POST['inAnswer']); $inA = array($_POST['inA']); $i...

0
Q: PHP reading a word file

Subhan AliI have problem reading a use case from a word file in PHP and extract the data from the use case to represent in XML format for the further processing. I need the code Of the given problem.

0
Q: Yii many_many condition not working

gooseI have a many_many relation between Product and Interest. I'm trying to select 5 products that are attributed to a particular interest. The code I have so far isn't working and I can't find the route cause. My relations: public function relations() { return array( 'interests'=>array...

posted on September 28, 2013 by user2802100

i am having problem while creating a script/ I want to fetch dates in the database and count entries on that day based on the month. I want do it in php . i need it same as fiddle Data stored in database: 2013-09-25 07:39:10 ,abc 2013-09-26 07:39:10 ,def 2013-09-27 07:39:10 ,ghe 2013-09-27 07:39:10 ,jbl i would to show it as: date     

0
Q: Magento Get Selected Custome Options into Subtotal.php?

Rock DeveloperPlease help me to get the selected custome options into Subtotal.php. this is path of the file. app\code\core\Mage\Sales\Model\Quote\Address\Total\Subtotal.php over there i want to get selected custome options. Thank you.

0
Q: Cannot print full url text when there is slash in URL

opencI have made a form where when i send values with a slash, in the same page i read the url value sent by my form input and prints it from $_POST request value. But something strange happens, if the sentence does not contain slashes it reads it all.If it contains one slash it reads the request unti...

0
Q: PHP code to round decimals up

user1823053I am using $p1 = 66.97; $price1 = $row['Value']*$p1; $price1 = number_format($price1, 2, '.', ''); To do a simple calculation and then show the price to 2 decimal places. this works fine. I would like to round the result up to the nearest .05. So 18.93 would be 18.95, 19.57 would be 19.60 et...

0
Q: Sort filename like abc 1.1, abc 1.1.1, abc 1.0 in PHP

Kushal GandhiI have used natsort(), but it didn't work as I want to have. It display sorted array like this: 1) abc 1.0 2) abc 1.1.1 3) abc 1.1 But I want: 1) abc 1.0 2) abc 1.1 3) abc 1.1.1 So, please tell what is the possible solution of this in php

0
Q: use mysqli_connect and mysql_select_db

DaniyalThis code works correctly! $con=mysqli_connect("localhost","root","","laboratory"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM test"); while($row = mysqli_fetch_array($result...

 
9:31 AM
0
Q: BBcode parser, size not changing

user2590369I am using a simple BBCode parser, which I have had to manipulate and add things to as it has a limited number of commands, which then I have had to extend. Everything else works perfectly, but the size is just not changing. It does not show the BBCode tags, so it is converting it to something bu...

0
Q: Strpos with both integer and word.

Isaac BodaI'm stuck. Ignore the top line, no use for date yet, but will be using in a bit. Having issues primarily with this line: if(strpos($line, $extension) !== false and (preg_match('#\d#',$line !== false))){ I'm trying to do is that if a domain name ($line) is a .com and has no numbers then echo ...

-1
Q: Looking for a jQuery plugin to draw chart like flow chart or diagrams

xanaI searching for a jQuery plugin which will help me to create a flow charts for work process and the plugin can be enter some text too..

0
Q: Codeigniter validate_upload library can't upload file

conmenI was referred to @raheel shan's thread on this page and use this My_Upload extended library to have if(!$this->upload->validate_upload('photo')) validation of input file, the validation is work fine if user try to upload invalid file type and the message is just shown in the right place. Someho...

0
Q: JFactory failing to import

NicholasI am trying to make a login system for an android application that works in with my 2.5 Joomla website. I am trying to do this by making a Joomla plugin which the android application sends post data to a php file which that then authenticates the user to see if the credentials are correct or not ...

0
Q: Php read directory with absolute path

ToniqI have this php script which reads mp3 files from the directory: // Set your return content type header('Content-type: text/xml'); //directory to read $dir = ($_REQUEST['dir']); $sub_dirs = isBoolean(($_REQUEST['sub_dirs'])); if(file_exists($dir)==false){ //echo $_SERVER['DOCUMENT_ROOT']; ...

0
Q: Cannot submit HTML form using PHP on iPad

Mirko SimanićRecently I got this problem that I cannot solve. My HTML form cannot be submitted by using iPad, but the same form CAN be submitted from my laptop (windows machine). Please check this out: http://www.gomap.ch/admin/pages/test.php - this is submitted correctly http://ipadpreview.com/previewer?url...

1
Q: action tag in a form didn't work out in google chrome

user2825946can anyone tell me why is that the action in the form tag is not working on google chrome?i use echo to display the the table and form.. i have this code.. echo "<form method='post' name='computation' action='savepagibigcomputation.php'>"; echo "<table>"; echo "<tr>"; echo "<td>Blocknumber:<

 
10:01 AM
0
Q: Process to upload multiple image associated with a unique id

user1545232I have a simple small application in which user will add its vehicle and 5 images associated with that vehicle and the vehicle description is inserting in table1 and images is inserting in table2 associate with vehicle id of table1. The problem i am facing in that is i have one form to upload ve...

1
Q: Strip out harmful code but allow Iframe

Timothy De GrootI have a selfmade cmssystem where users can insert, edit and delete content. I would like to allow them to insert Iframes ( for video purpose, for sites like Vimeo and Youtube ). I secured the output from my database to my website with htmlspecialchars. Offcourse it converts the IFrame to a stri...

0
Q: selecting only distinct values from an array

Naresh KamireddyHere, I have the following variable $countries_all: Array ( [0] => stdClass Object ( [countries] => India,Afghanestan,Japan,South Africa ) [1] => stdClass Object ( [countries] => Singapore,South Africa,India,Pakistan ) [2] => stdClass Objec...

0
Q: Regexp PHP PRCE trouble

devzorgIn a string I have many HTML elements and one of them is input that should be parsed. <input name="generate" value="52FadA=" type="hidden"> I have made the regexp but it doesn't work. May be escape characters, it's not clear :( preg_match_all('/input[\s](?:(?:name\="generate"[\s]value\="(.*)"...

0
Q: Magento pages broken after editing product view.phtml

valenI was writing some custom php for the product view page in Magento, and accidentally executed an infinite while loop on the server. I erased this code (I've gone all the way to put view.phtml back to what it was before I started working with it), flushed/cleared every kind of cache, but NO pages ...

0
Q: Wordpress Showing Posts data in Sidebar

xyroI need to show main image from posts belonging to category in a slider added to Wordpress sidebar, the code is working perfectly if I was in a page, but not in homepage or search results page, this is my code: <ul id="sliderContent"> <?php $joiners .= " LEFT OUTER JOIN wp_term_relati...

0
Q: Ratchet PHP WAMP - React / ZeroMQ - Specific user broadcast

Jimbo Note: This is not the same as this question which utilises MessageComponentInterface. I am using WampServerInterface instead, so this question pertains to that part specifically. I need an answer with code examples and an explanation, as I can see this being helpful to others in the future. ...

0
Q: List Down All Non-Paid Students But Having Some Issue

user2826037I am trying to list down all the students who dont pay their dues between two date ranges. I first select all the student ids from fee table and then store it in a variable and then compare these ids with student table to list down all non paid students. But my problem is it works only on last id...

0
Q: Components VS Includes directory in a web project

elkebirmedI'm just confused about using a directory in my new web project to put CSS/LESS/JS/PHP files inside it. some developers are naming this directory as "components" and others stick with the "includes" name. Which is the best for best practice? Also: same issue with "images" and "img"

0
Q: how to send image mailer using php mail function

abhinav dixiti am trying to send html image mailer using php mail function on linux platform. There is one issue when i am trying to send simple html content then it successfully get delivered to its subscriber. but when i try to send emailer which contains few images then it fails to deliver it. below are tw...

-1
Q: change the node value of xml in php Dom

user2050483i have the below xml file and i want to change the node value of carColor in php(xmlDom) <?xml version="1.0" encoding="UTF-8"?> <cars> <car> <registrationNo >APC-204</registrationNo> <carMake>Honda</carMake> <manufactureYear> 2013</manufactureYear> <...

0
Q: How send to email using codeignater

Yuvi $config['protocol'] = "smtp"; $config['smtp_host'] = "ssl://smtp.tch-pnt.in"; // $config['smtp_port'] = 587; $config['smtp_user'] = "bnft@tch-pnt.in"; $config['smtp_pass'] = "********"; $config['charset'] = "utf-8"; $config['mailtype'] = "html"; $config['newline'] = "...

0
Q: Laravel MVC: Best Practice Register a user in model or controller workflow

GravyI'm looking through a lot of tutorials on the net, and the majority of them suggest the something like the following: User Model: Attributes: id, name, email, password UserController: Method getRegister() // Show registration form Method postRegister() Further detail in postRegister() meth...

0
Q: why coinbase callback url not working?

user1838367i have the below code for button creation. public function createButton($name, $price, $currency, $custom=null, $options=array(),$callback) { // $callback=$this->generateReceiveAddress("http://www.tgigo.com"); // print_r($callback);exit; $params = array( "name" => $n...

0
Q: storing pdf files on server securely

nikhili am deploying a website from where user can purchase the pdfs. now i am searching for the way for storing the pdfs so that it only can be downloaded when payment is done. I have came across one way in which i can store the pdfs in to the Mysql database and generate the path to it when required c...

0
Q: csv file not creating

user2802100I want to create a csv file with fetched but its not creating the file. Its create the file with whole html of page. CODE: $sss=mysql_query("SELECT DATE(pdate),COUNT(*) AS mycount FROM qchat_sessions WHERE MONTH(pdate)='09' GROUP BY DATE(pdate)"); while($rows = mysql_fetch_array($sss)){ $ar...

0
Q: Yii beforeAction compatibility issue

iamagentI just started learning Yii today and dont know anything in it, so this question might sound really stupid. While testing some demos apps in yii, I came across this error message. Strict standards: Declaration of SiteController::beforeAction() should be compatible with CController::beforeAction...

0
Q: PHP - Username must only contain letters, numbers and underscores

AngelI am making a registration form for a website and want to check that the username must only contain letters, numbers and underscores. it cant contain spaces, commas, dots,slashes or any other symbol. I want to do it with the function preg_match. can you please help me writing a good validation co...

0
Q: how to use json array key to javascript variable

user2496644i am try json_encode($updateArray); and this is call by ajax and after ajax success return me json string on responseText something like this type {"title":"superAdmin","id":"50"} now i want to use this two key like var text = title; var id = id; who can i user this two to as diff. varia...

0
Q: Order SQL search results by how many fields match

Otto JaansooMy question is, if I have fields like: rooms, district, bathrooms, floor_material etc. then how can I order my Query results by the number of field matches? How do I check before echoing, how many fields match? Also, I don't want to display results, where all fields match, but also results where...

-5
Q: php gmail contacts to store both title and address in same table at once ? can u help us

user2826048<?php $xml->registerXPathNamespace('gd', 'http://schemas.google.com/g/2005'); $result1 = $xml->xpath('//gd:email'); foreach ($xml->entry as $gname) { $exec="INSERT INTO gmailcontacts(contact_name)VALUES('".$gname->title."')"; mysql_query($exec) or die('Query failed:'.mysql_error()); } ...

0
Q: Jquery .load() sends POST parameters only once per page load

Chris45234325I have this script: $('#openBtn').click(function(){ $(".modal-body").load("/show.php?fFuehIFj1L0vS6Hp", {oi: $("#oi").val(), txtid: $("#txtid").val()}, function(result){ $('#myModal').modal({show:true}); }); }); And this html: <a href="#" class="btn" id="openBtn">O...

0
Q: Doctrine error: "Failed opening required '/tmp/__CG__Source.php' "

Jorrit SteetskampI am trying to migrate my PHP application to an Ubuntu server, but without succes. Any help would be appreciated. First I installed Doctrine successfully into /jorrit/myapp, following the first part of Doctrine's Getting Started manual (till "Generating the Database Schema"). Secondly I placed m...

 
11:07 AM
0
Q: Update icloud calendar via php curl

AndreaI want to realize a script for managing events to a shared icloud calendar. I've stored on my db several events and, on request, i need to create an event to be seen on remote phones/ipad and so on. Thanks to Andy and his post I had no problem for write an event to icloud, but when I try to upda...

0
Q: New to coding and looking to modify a few pages to log into my joomla, or embed them in it with sessions.

user2823996As the title says I am 100% coding novice, and am able to copy and paste and am learning as I an destroying this stuff. the code I am looking to get to work with my joomla is here, well the first one anyway. I have a few of these smaller helper site and such I would like to incorporate into my si...

0
Q: Trying to use Facebook Chat API to send a message

themartinI'm trying to make a little app which will send a message on the persons behalf to one of their friends. I'm really struggling with the chat API. What I have so far is the the standard API code, and it just displays Test platform connect for XMPP And keeps trying to load indefinitely. Look...

-3
Q: Insert Hour value like 50 hour in mysql database?

Shailesh Singhi like to assign hour to the student for his course, when he attend the class hour will deduct amount of class duration time.can any body help how to insert time in hour like 50-hour and perform operation on this like add 30 minutes, 1 hour in mysql database?

0
Q: removing &nbps through php

user1224233i have one string if i echo it , it shows spaces $str1 = "10-20 NL Holdem1 1-3 NL Holdem5 5-10"; echo $str1; but when i try to explode it on the basis of spaces it didnt so i did this $str2 = str_split($str1); it gives me this [0] => 1 [1] => 0 [2] => - [3] => 2 [4] => 0 [5] => [6] =>...

0
Q: remove index.php file from url using codeigniter

user1858692I cannot able to remove index.php from url in codeigniter i have tried this .htaccess file code. RewriteEngine on RewriteCond $1 !^(index\.php|public|\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?$1 and i removed index.php in config...

0
Q: Doctrine 2, Query Builder, Select inside select

Сергей Колпаков Hello guys! I need to select all articles and count of all articles refer to the user. Im trying to do something like $qb = $er->createQueryBuilder('c') ->select('c, SELECT COUNT(c.id) AS articlesCount FROM c WHERE c.user = c.user') ; obviously it's not working. How can i fix this? Tha...

0
Q: Symfony2: Combining choice field/checkbox with dataTransformer

user2739610I've got 3 entities user, project and module. Module entity got fields user_id, project_id and array modules filled with boolean. What I am supposed to do is to build form with choice fields from array modules. I am passing userId and projectId to dataTransformer. Next my dataTransformer look...

0
Q: want to get the comment typed in a text area without submitting the form

prakashfireI want to collect the comments which are given by a particular user for a image.This all done by clicking a comment link.After clicking link i have to carry the comment and imagename. This is the code for comment page,and its all inside a form echo"<tr><td colspan='2'>Your Comment: </td>"; echo"

1
Q: php show notice within that interval dates

Rakesh MishraIn php I want to show a message in the page within the activated dates means the date from and till date will selected by the admin and within those selected days the message will be shown in the page. For date picking I have used jQuery datepicker. I have made my database like this CREATE TABLE...

0
Q: Eliminating space between number and currency

june8My script for showing the discount amount or percentage is; function DisplayDiscount($value) { if (strstr($value,'%')) $discount = "%".substr($value, 0, -1); //$discount = $value; else $discount = $value.SITE_CURRENCY; return $discount; }...

0
Q: Imagemagick portrait effects

UdhayHello I'm using imagemagick to create Polaroid style images like this. using the following command, convert -pointsize 35 Tulips.jpg -bordercolor white -background gray40 -set caption "Congrats for your new office!" -polaroid -0 Tupoloroid.png but i don't know how to create the polaroid ...

0
Q: PHP - imagepng() changing fileowner

Barry ChapmanWe have a webserver (nginx) running as user nginx in group webdev. When we process an image in php using imagepng() - it changes the file owner/group to apache:apache. What is causing this? its creating write issues for the webserver.

0
Q: Phalcon jquery-ajax on button click

NedimoI am warking in phalcon framework, and i am trying to call controller's method to get simple string using jquery-ajax. When i placed my ajax call inside $(document).ready(function() ajax call worked, but when i placed same code inside $('#dugme').click(function() ajax call reported error. I am co...

0
Q: PhP calculation percentage not coming well

user2535089I am making Vote Yes and Vote No, Then making their percentage and dividing that percentage into 0 to 5 stars. Unfortunately its not calculating well and giving wrong results. Codes are following. function rating($y, $n){ $YnN = ($y + $n); if(!$y == 0){ $Likes = ($y / ...

0
Q: MySQL Query with Multiple Select options

AntonI'm a designer and not developer, so I don't even know HOW to ask this question. I have a select box in my script and it shows only one user type. But I need it to show more user types, for example, user_type 2, but Ive tried adding AND / OR and it doesnt work. Heres the script code. $result =...

0
Q: Laravel: unable to access to configuration files

CerberoI'm developing a package using Laravel. Until I had only one config file I read it without problems. Now I have three files and I'm not able to access to them. If I try \Config::get("package::file.option") I get null, if I try \Config::get("package::file") I get an empty array. The followings are...

0
Q: problems with php in_array

misulicusHey guys got an issue with the in_array not returning true. my code is as follows: if ( in_array( 'item_name', $this->conditions ) ) { print "test"; } this is just a test code. the $this->conditions is set in someplace else in the files and it looks like this: Array ( [0] => Array ...

0
Q: A valid use for traits

DavidIn my application I have a Config object which my service layer and views have as a class property. Any time I want a config value I have to do $configValue = $this->config->setting('setting.name'); What I want to be able to do each time I want a setting is $configValue = $this->config('setti...

0
Q: opencart add decimal point in product quantity

user1912097i am using open-cart 1.5.5.1 with fresh market theme.i want to use decimal points in product quantity. i have already tried this code http://forum.opencart.com/viewtopic.php?t=20441 it works fine for default theme but when i use fresh market theme it will not count decimal in quantity.when i ord...

0
Q: Checking if user is active mysql and PHP

user2826200Hi everyone I have a problem this is my code the function is to check whether a user has activated his/her account: function is_active($username) { $username=mysql_real_escape_string($username); require "dbc.php"; $sql="SELECT COUNT users_temp,user_id FROM users1 AS s1 ...

0
Q: server side programming language decision

Amir.Ffirst of all, I'm trying to avoid this being closed as non constructive, so that's why I will supply my considerations, and also not ask what is the best solution, because they all obviously have their advantages and disadvantages Purpose: first of all the server side is built for a phone app, b...

0
Q: transaction in SQL is committed but only 1 of the queries is done correctly

ghostriderI am having 2 tables, and in the one I want to increment a counter in a specific row while make an insertion in the other one table. I am using php. Here is my code: function incrementCommentCounter ($id,$photoId,$text,$date) { $query1= "UPDATE photos SET comments=comments+1 WHERE IdPhoto=$...

0
Q: How to align the text description if it includes image beside it?

AkkiI want to align the text description on my page such that if anybody puts a string of long length without space, the string should break where image starts & following text should come on the next line. I've uploaded an image what actually is happening. Here's my code:: <div class="right"> <d...

0
Q: paypal payflow integration using php giving empty result

Mohammad ArshiI am trying to integrate paypal payflow But getting empty response. Here is my code $endpoint="https://pilot-payflowpro.paypal.com" $plist="USER=username&VENDOR=vendername&PARTNER=PayPal&PWD=pwd&TENDER=C&TRXTYPE=S&ACCT=cardno&EXPDATE=expdate&NAME=cardtype&AMT=1.00&CURRENCY=USD&COMMENT1=Sale ...

0
Q: url rewriting with .htaccess file

user2826209this my actual url : http://www.Example.com/blog/hostel-details/?hname=White+House+Bed+and+Breakfast&city=Dhaka&date_st=28+Sep+13&date_end=01+Oct+13&num=3&propnum=56687&guestnum=2 I want to rewrite in the form http://www.Example.com/blog/hostel-details/White-House-Bed-and-Break...

1
Q: How do I add a tooltip (based on conditions) to an image in javascript?

user2826193I've found the line in a PHP file that changes the actual image depending on whether the support line is available or not, but it has no tooltip and can be confusing. Can someone please help? This is the line that works: var seFeSX=document.createElement("script");seFeSX.type="text/javascript"...

0
Q: how to submit form values from the following form using php?

nikkihow to submit form values from the following form using php? when i try to submit the array "keyword[]" i only get the value from the first input field only. please give me a php code that can fetch all the values from the form below :) <body> <h2><a href="#" id="addScnt">Add Another Input Box<

0
Q: PHP sql query result differs from query tested in phpmyadmin

user2629220I have a very strange problem. I am trying to extract all the unique bill_no from a table. $qr = "SELECT DISTINCT bill_no FROM customer_goods_list WHERE dt >= '$fdt_str' AND dt<= '$tdt_str' "; which produces a query like SELECT DISTINCT bill_no FROM customer_goods_list WHERE dt >= '2013-03-...

0
Q: Csv file not creating correctly

user2802100I Am creating a csv file using array.But created file is not correctly creating. Code am using to create file: $sss=mysql_query("SELECT DATE(pdate),COUNT(*) AS mycount FROM qchat_sessions WHERE MONTH(pdate)='09' GROUP BY DATE(pdate)"); $array=array(); while($rows = mysql_fetch_array($sss)){...

-1
Q: Why my php code does not woking?

Yuri Molchanov<!DOCTYPE html > <html> <head> </head> <body> <?php echo "My first PhP doc"; ?> </div> </body> </html> And it shows me an empty blank? Help me please!

-2
Q: in this code first foreach not working it prints only once

user2826048<?php //this code for importing gmail contacts $xml->registerXPathNamespace('gd', 'http://schemas.google.com/g/2005'); $result1 = $xml->xpath('//gd:email'); //in this code to print emailid ,username foreach ($xml->entry as $gname) { foreach ($result1 as $title...

2
Q: SQL Queries vs Conditions in PHP

Shivam KhandelwalIf we are having an array of about 1000-2000 elements, and a mysql table of about 1000-2000 (can increase). We have to find that table content is in array or not. Which is a better approach ? 1. Getting an element from array and run simple mysql query like SELECT *...... WHERE..... (Running 1-2k...

0
Q: how to assign checkbox value to php variable in same page without submit and without reload page.?

Mirabel Amoradothis is my page ,when u check checkbox thn check box value will pass to javascript ..now i want to assign javascript variable(checkbox value) to PHP variable in same page ..without submiting form & without refreshing page..I know it not possible by javascript ...but plz tell me how to do tht by u...

0
Q: How to switch connection file in php?

pranaliHow to switch connection file in php? I have two database whose name is connection.php and connection1.php. when i submit username and password i want to check first database and then if it results empty then need to switch another database. but right now it is connecting only first database and ...

0
Q: Javascript validation is ok but I want to hide the error msg when I will go next field.

sourav royI create a javascript validation in my text box and text area field. Validation is ok. But the error show all time when I input the data clearly. But I want to hide the error msg after give the right input and when I will go next field. I just share my code please give me the solution ...

0
Q: Yii File upload model validation not working

redGREENblueI am trying to upload a file (xls,xlsx,csv) and read the data from it and then insert into the table. I am able to read the selected file and everything but for some reason the validation is not happening. If no file is selected (and also there's another required field, a dropdown, with same issu...

0
Q: compund conditions in php

hymesThe compound conditional statements doesn't work. What is wrong with my code? {{if (parseInt(address) >= 6001 && parseInt(address) <= 31999) ||      (parseInt(address) >= 35004 && parseInt(address) <= 38589) }}           <span>Some text here....</span>           <span>Another some text here...

-1
Q: sql_query to update after every five minutes

Faisalmp3isongs[dot]com. Here the recent searches update frequently as soon as making a search. I want these searches to update after every 1 minutes. This is what added in my source for sql query $newMusic = mysql_query("SELECT * FROM search GROUP BY term ORDER BY id DESC LIMIT 30") or die (mysql_er...

0
Q: Running java in PHP using proc_open() and getting the output

user2800050Help please. I can't figure out what the problem is with running java files thru proc_open(). It worked on C programs and I was able to get the output per line so I think nothing is wrong with fetching the output stream this way: $ctr = 0; $score_ctr = 0; $out2 = ""; while (!feof($pipes[1...

0
Q: phpseclib login failed, hostname wrong or what?

Emiliano CostanzoI have a serious problem with phpseclib while trying to connect to my sftp. The thing is I always receive Login Failed, and I don't know how to debug the code. include('Net/SFTP.php'); include('Crypt/RSA.php'); $sftp=new Net_SFTP('192.1xx.x.xxx'); if (!$sftp->login('webmaster','981xxxxxxxxxxxxx£...

0
Q: How should i order by price in this case

wikiI want to order by price. But I am getting the price from two different table and compare it to get the minimum price and print it if price is above 0. It is also possible that price is present in only one database. The rough structure of my code is: query1 = choose products while = fetch the p...

0
Q: Load each clicked post into a page

user2826276I am working on my first and stuck with each posts not displayed on a new page. What I want to achieve is when a post is clicked on, the post contents should be displayed as a page and not as a website. If I comment out the (function showarticle) bit, then when you click on each posts, it takes ...

0
Q: Adding category title to WordPress theme file

user2327671In my archives.php file in my custom WordPress theme, I have the following code: <div class="page-title"> <?php if ( is_day() ) : printf( __( 'Daily Archives: %s', 'sturd' ), '<span>' . get_the_date() . '</span>' ); elseif ( is_month() ) : ...

0
Q: Paypal keeps giving missing class and require errors

gilm501I have downloaded the Adaptive Payment paypal sdk, And I ran the install.php, and every time I run a sample it gives me a class is missing and I keep including those classes (like AdaptivePayments.php class and AdaptivePaymentsService.php class). Shouldent It be included allready ? what am I mis...

-1
Q: php url rewriting with .htaccess php file

user2826209this my actual url : http://www.Example.com/blog/hostel-details/?hname=White+House+Bed+and+Breakfast&city=Dhaka&date_st=28+Sep+13&date_end=01+Oct+13&num=3&propnum=56687&guestnum=2 I want to rewrite in the form http://www.Example.com/blog/hostel-details/White-House-Bed-and-Breakfast/D...

 
1:08 PM
0
Q: Validating php within html tags

JestyI have a registration page that uses both html and php I wish to validate the ALL user information before he recieves this alert >> Your ID number and password will send to your email address when the casher confirm your enrollment Here is my code <html> <head> <title> </title> <link rel="styl...

0
Q: how to define multiple languages in html 4

RoiI want to build my website in Hebrew lang. When I write <meta charset="utf-8"> in the title the labels are looks good but the letters from the DB are all question mark - "????" When I write <meta charset="windows-1255"> letters from DB are OK but all labels are "???". BTW - I'm also use...

0
Q: User id dynamic pages .htaccess

KakitoriI have this url www.mydomain.com/profile.php?id=524170354d5a6 and I want to convert it to a friendly url like this : www.mydomain.com/profile/524170354d5a6 I already tried with .htacces file but it doesn't work, my .htaccess is located inside my folder proyect (www/project->.htacces) Does this ...

0
Q: How to output mysql query to a html table?

Acelasi Euneed your help again. So I have a query, with multiple variables which I have to output to a table. Here is the query: SELECT DISTINCT zi.zile, ore.ora AS ore, materii.materie FROM zi LEFT JOIN orar ON zi.id = orar.id_zi LEFT JOIN o...

-1
Q: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' on line 7

Macesanu Madalin FlorentinThis is the code i do not understand where the problem is. <?php class WM_Rebuild { private static $allowedLocals = array( 'localhost' 'yourdomain.com' '127.0.0.1' this is line 7 );

0
Q: Trying to implement a form with php/ajax without success

GregI'm trying to implement a form based on a tutorial found on the internet. Unfortunately I can't get it working. When I click on "Send" the page reloads and that's it. Any idea what the issue is? Many thanks HTML: <div class="block-right"> <h1>Formulaire de contact</h1> <!-- CONTACT...

0
Q: PHP - chained references

user1518183I trying to understand PHP reference, but I found a problem, when working with chained references. $values = array(); $values['a'] = &$values['b']; $values['b'] = &$values['c']; $values['c'] = 1; Return: array( 'a' => NULL, 'b' => 1, 'c' => 1 ) Why value for key 'a' is NULL? I expected that...

0
Q: How to set text file encoding in PHP?

Programmer.zipHow can I set a text file ENCODING (for instance UTF-8) in PHP? Let me show you my problem. This is my code: <?php file_put_contents('test.txt', $data); // data is some non-English text with UTF-8 charset ?> Output: اÙ! fwrite() has the similar output. But when I create the test.txt by no...

0
Q: How to pass query string from Mozilla extension popup

hariprasadI created a Mozilla extension for displaying an iframe on a popup and now its working. Am using the following code to display iframe. function handleOnLoad() { var iframe = document.getElementById("myframe"); iframe.setAttribute("src","http://www.mydomain.com"); } Now i need to pass an...

0
Q: session start without locking? or an workaround?

IsmailI have done some research about session start and why it locked all my other ajax request. I found out that the user's session is locked until the page is done executing or session_write_close() is called. with session_set_save_handler you can set your own handlers for session, but i don't know ...

0
Q: Contact form error - All fields must be filled, but they are filled

SunSky$(document).ready(function(){ $('#submit').click(function(){ $.post("chapters/ajax.php", $("#contact").serialize(), function(response) { $('#success').html(response); }); return false; }); }); part of ajax.php if((empty($_POST['name'])) || (empty($_POST['e...

0
Q: elgg register page handler - passing parameter with a slash

user1877042I registered a page handler. I pass a parameter with a slash in it. elgg explodes on '/' characters and passed as an array to that function so it splits the parameter into two parameters because of the slash. I tried to encode the parameter but it's still not working. any help? thanks.

0
Q: get different value between recently value with previous value

user2826323How to compute different value between recently value with previous value in do while loop and stop if different value < 0.5? (different = recently - previous < 0.5) function iterasi($data,$limit=0.5) { $matrix1=$matrix2=$data; $count=0; do { $max=$temp_max; list($matrix3,$r_va...

0
Q: include-paths in included file fail

jotaenI have some troubles with PHP include-paths and do not understand, what wrong there. First, I’d like to show you my file/dir structure: File/Dir structure |index.php |foo/ |baz.php |bar.inc.php |asdf/ |qwerty.inc.php /index.php: include('foo/baz.php'); /foo/baz.php: ...

0
Q: PHP algorithm to generate all combinations of a specific size from a single set

asim-ishaqI am trying to deduce an algorithm which generates all possible combinations of a specific size something like a function which accepts an array of chars and size as its parameter and return an array of combinations. Example: Let say we have a set of chars: Set A = {A,B,C} a) All possible combi...

0
Q: PHP email encoding

Dr. ZoidbergAny ideas what could be wrong with my code? Every time somebody fills out my web form using national characters (-eg.: ž, š, ô, í) the email created by PHP script looks like this: I tried fixing it by adding "charset=utf-8" to headers, but that doesn't seem to work. "MÔŽE BYŤ ná možnosÅ¥...

1
Q: PHP file inclusion error

user2822075I am trying to create a config.php file similar as wordpress does. My code does create the file but i have been facing problem with file inclusions. I have a file defines.php in includes directory inside admin directory. But when, i include the file defines.php in my setup-config.php (in admin di...

0
Q: using PHP include and symbol outputs

Jonathan RosenfeldI'm building a website for a friend using Wordpress. There is one particular element he is going to need to update and he's not used to code so I have created a file that he can edit without getting involved in wordpress. In wordpress I call this file using PHP include which works wonderfully un...

0
Q: How to "start" / load xDebug?

automatixxDebug doesn't need to be started. One just has to install the plugin, the set the xdebug.ini properties, and configure the IDE. That's it. I've done all these steps, but the xDebug is still not working (Eclipse: Launching : waiting for XDebug session - 57%) and its port (9000) is not in use: # ...

0
Q: PHP changing .xlsx file by modifying xml files in its zip archive

ladislav_pragueI'd like to modify my excel file without using PHPExcel library. So I tried this: $zip = new ZipArchive(); $zip->open("invoice.xlsx"); $sheet1 = $zip->getFromName("xl/worksheets/sheet1.xml"); But I got this response: Warning: ZipArchive::getFromName(): Invalid or unitialized Zip object ...

0
Q: Retrieve wordpress posts with featured image via SQL

John SmithI'm using this query in a PHP script outside Wordpress to retrieve entries with their featured images SELECT ( SELECT guid FROM wp_posts WHERE id = m.meta_value ) AS url FROM wp_posts p, wp_postmeta m WHERE p.post_type = 'post' AND p.post_status = 'publish' AND p.id = m.post_id AND m.meta_ke...

0
Q: formatting regular php into smarty code

NelsonI am familiar with php but not familiar with smarty template code. I am trying to set a value that is set by my script that is formatted like this {$p.youtube_key} it's a variable that will output the given url when a user has set a video as their upload post. So in smarty, {$p.youtube_key} wil...

 
2:32 PM
0
Q: Communication between JSP/Servlet and PHP pages?

Vinay JainI am working on a web based java application(on localhost) and I want to send email using a PHP script which is hosted on a free web hosting site and also return to my java app. Like this -> Java(localhost)---->PHP(send mail)---->Java(localhost) Few questions regarding this? How to do this? ...

2
Q: Javascript check for empty fields, secure?

user2826397This is a simple question. I have a registration form made with html and PHP. I want it to update while a person enters his information. When a person then enters his name, it uses javascript to check if the box is empty or not. If it is not empty, you can proceed, else you get a message saying t...

0
Q: Change CSS Class by a php function

user1735856I use a function to initialize a page in my wordpress. function bp_group_calendar_init() { require( dirname( __FILE__ ) . '/groupcalendar/bp-group-calendar.php' ); } add_action( 'bp_include', 'bp_group_calendar_init' ); Now, I want to change the following css class of my menu: From: <li id=...

0
Q: Inserting data into two tables from Form

CDubYaaI am trying to insert data from a form into two different tables using the following code: $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('Could not connect: ' . mysql_error()); } if(! get_magic_quotes_gpc() ) { $date = addslashes ($_POST['date']); } else { $date =...

0
Q: PHP - Looping trough and adding values to array, loop back if end is reached to add remaining values

StianbrFirst of all, sorry about the title, I didnt know how to explain this in a few words any better. A similar question has been answered here: PHP - Rearranging a string into order But this (kinda) doesnt work for me. I have an array with poker players, I allready know alot of information about t...

0
Q: PHP session is empty jquery ajax

user2632980I have moved my site to a new hosting where PHP is 5.3.23. Now when I call a page with ajax, it do not have a session. <?php session_start(); var_dump($_SESSION); ?> session returns nothing.

0
Q: PDO login keeps showing false

Dahnny012Hello im working on a basic login script with php. For not im not worried about security i just want it to work. But for some reason it keeps returning false when in the database the values are there. Edit: connection.php contains the information to login to the database. $config['db'] = array(...

0
Q: Trouble with installing Apache (XAMPP)

hherklj kljkljkljAfter downloading XAMPP on my Windows 8, I get the following error. Since I am not too good with computers, I don't know what it is saying or how to fix it. If anyone who is familiar with the code does and can help me, I would appreciate it! 7:53:42 AM [Apache] Problem detected! 7:53:42 AM ...

0
Q: $user[$i] ['Inhalt'] email send doesnt work

user2826395btw. all i write is in same .php my idea is=any while result have one picture behind. If pressing this, it ask with >confirm< if user sure, to do this (this works, but->) email sending doesnt work with while result first i have make javascript in head <script type = "text/javascript"> fu...

0
Q: How to implement cache system in php for json api

Cristi SilaghiI have a few custom social buttons on my website for whom I get the share number/followers number using json from API. I have tried to implement a cache system to reduce the load time and eliminate de risk of being 'red-flagged' for over-using the APIs. However, I had no success in this area, bas...

0
Q: Taking input from text field and fetching data from database using ajax and jquery

Abhishek KoserwalI have a input text field and when user give input in text field, it should fetch the data from database with respect to user-input <p><input type="text" name="ajax" id="ajaxtest1" ></p> <script> $(document).ready(function(){ $("#ajaxtest1").blur(function(){ var dt=$(this).val(); $.p...

0
Q: Incorrect value from php/mysql query

SC-LeeAfternoon, I have a function here where I am trying to return a simple value of 0 if there are no records where a user has a role of Administrator or 1 if they do. The command line SQL works absolutely fine, however when running it via the page it always returns a value of 4, which is the numbe...

1
Q: Symfony2 caching issue

CaballeroI'm trying to create a "Hello World" with Symfony2 and it seemed to run the first time, but whatever changes I do and save the controller - no changes on the front end whatsoever. This is how my controller looks like: namespace Test\CalcBundle\Controller; use Symfony\Component\HttpFoundation\...

-1
Q: PHP Redirect to another Folder - 2 Levels higher

fishspyI am trying to redirect to another Folder - 2 Levels higher This is the strcuture Location 1 : myforum - Loginform - getLogin.php Location 2 :myforum - Table Forum - subfolder1 - subfolder2 - postform.php Currently I am at Location 2 - postform.php.. how to redirect to Location 1 - getLogin.php

0
Q: What type of email-address do you need to have to use this function?

Gabriel LindgrenI wonder if you need to have a special email-address to make a contact form where visitors can mail you with. Thanks!

-1
Q: Hashed PHP code

user2826439I have hashed? code: "$dwbjmj1792='!Ak;!Cb,, gd`cdq ..,,=!Ak';$mdbxbp1793='!Ak;!Cb,, gd`cdq^dne ..,,=!Ak!Ak';$grmbuu1794='!Ak!Ak;chu hc<!Ccroheexb`kdmc`q!Cc bk`rr<!Ccsdws!Cc=;.chu=!Ak!Ak;!Cb,, ancx ..,,=!Ak;s`akd anqcdq<!Cc/!Cc vhcsg<!Cc0//$!Cc bdkkro`bhmf<!Cc1!Cc bdkko`cchmf<!Cc1!Cc=!Ak ;sq=!Ak...

0
Q: Yii select first record from table where it does not have a record in a related table

Mark WinterbottomI have a MySQL database with two tables: quiz_questions has 2 columns: question_id (pk) question quiz_results user_id (fk to user) question_id (fk to question) answer_id (fk to answer) I would like to get the next question that does not have any answers associated with it. In other word...

0
Q: how do i search zip codes within a certain radius in php?

Philip NagelI want to search for people on my website with a zip code within a radius of the zip code someone else search i want it to be within either a 5 mile 10mile or 20 mile radius how could i do this, specific help would be appreciated im not that god at this here is my code for my search function its ...

0
Q: Calculate the number of clicks on each ad

msoaI'm developing an advertising website. I want calculate the number of clicks on each ad, but not know how do it! I'm looking for a solution that could distinguish humans from robots. What solutions are there?

0
Q: Play a sound file when new data has been added to mysql table

user2826352I want the browser to play a sound file when a new table row has been added to database. This is my php file for the table. I'm using ajax for refresh. I'm thinking that Javascript is going to be my solution. Do you have any ideas how to accomplish this? show_table.php <script src="ajax2.js"><...

0
Q: How are web pages scraped and how to protect againist someone doing it?

a23zizIm not talking about extracting a text, or downloading a web page. but I see people downloading whole web sites, for example, there is a directory called "example" and it isnt even linked in web site, how do I know its there? how do I download "ALL" pages of a website? and how do I protect agains...

-1
Q: Remove and unintall php from Windows 8

hherklj kljkljkljHow do you uninstall/remove php from Windows 8? I tried using the control panel to uninstall the program but I don't see php. I found some links with instructions but they were no good so if anyone can help me, I would appreciate it. And also, explain it like your talking to a child.

0
Q: Segmentation Fault in Apache with Wordpress

GorThis is not a question... rather an answer. Problem Browser is returning: "ERR_EMPTY_RESPONSE", "no data received", "the connection was reset", etc... Apache error log is returning: "Segmentation fault" sudo tail -f /var/log/apache2/error.log [notice] child pid 10857 exit signal Segmentation...

0
Q: Curl post to Google form - no error - no data

mjpsr11I have a google form that I am trying to post data with curl. Here is my code (form key redacted): $curl = curl_init('https://docs.google.com/spreadsheet/formResponse?formkey=xxxx'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($c...

-1
Q: The same jquery version doesn't work if there is on Google Apis

Jordi Martí DomínguezI'm very confused, so if I put this in functions.php, on Wordpress, it works function modify_jquery() { if (!is_admin()) { // comment out the next two lines to load the local copy of jQuery wp_deregister_script('jquery'); wp_register_script('jquery', 'http://sitgesgro...

0
Q: send data to a new page and include it in the index-page

Marcus StrandbergI'm trying to send data from a form to a new page that handles the result from the first page. however, if I use <form action = 'new_page.php' method = 'post'> the browser swaps page to "new_page.php" and only shows that page. I'd like to display "new_page.php" in a separate div on the first ...

0
Q: How do i search zip codes within a certain radius

Philip NagelI want to allow someone to search for people on my website by letting them type in there zip code and then showing them people who are withing a certain radius of there zip code. I want it to be within either a 5 mile 10 mile or 20 mile radius how could i do this, specific help would be appreciat...

0
Q: Unable to decode JSON returned from API

ChordsUsing the following code, I'm able to get a response, JSON formatted, but I need the data in a PHP array: $url = 'https://xboxapi.com/games/Major+Nelson'; $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_URL, $...

0
Q: Symfony 2 - Generating a Bundle (Windows)

AnchovyLegendI am new to Symfony. I am running Windows and am using xammp to learn Symfony 2. How would I run the following command? I seem to be getting an error and not sure how to run commands like these successfully. I appreciate any suggestions. Must I use CMD to do this? Is there an easier way to genera...

0
Q: How to check a particular part of url using php

GaneshI have a url in a variable. <?php $a='www.example.com'; ?> I have another variable, that has like this <?php $b='example.com'; ?> In what way I can check that $b and $a are same. I mean even if the url in $b is like 'example.com/test','example.com/test.html','www.example.com/example.html' ...

0
Q: example.com and www.example.com are treated as different sessions

John KariukiSo i have a small website that requires users to log in with a username and password. Everything works fine apart from 1 tiny problem when the user logs in using the url studeez.net, he or she is redirected to a page where the top bar displays his Firstname, lastname and an option to logout. B...

-1
Q: Displaying a Query

Kevin HarrisonSo I am making a basic Q&A Forum right quick. I made it so that it correctly stores the post title, content, author, etc... I'm just wondering how I could make it display all those on one single page using PHP without having to input each individually. I was thinking of doing something with the a...

0
Q: CURL saves half downloaded images

user2806378We have script that downloads remote images from another server and save the files locally. Out of a post of 10 or so images, 1 or 2 might be downloaded only half way, such as this: http://i.imgur.com/guEirHW.jpg I converted the php from file_get_content to using CURL in a hope it would solve th...

0
Q: PHP get external page

zoran404I need to get an external page on the server. I tried file_get_contents and fopen, but apparently the settings don't allow that. So I tried cURL with this script, but the error says curl_init is undefined. $url = $_GET['url']; // create curl resource $ch = curl_init(); // set url curl_setopt...

0
Q: .htaccess - 3 different rewrites for 3 different URL structures

Viktor SvenssonI'm trying to achieve the following using htaccess on my blog portal: STRUCTURE 1 example.domain.com/link/sublink -> /blogdisplay.php?page=example&page2=link&page3=sublink STRUCTURE 2 en.domain.com/link/sublink/subsublink -> /index.php?lang=en&page=link&page2=sublink&page3=subsublink STRUCTU...

0
Q: str_replace() or htmlspecialchars() for escaping special characters in <pre> blocks

its_me Certain characters have special significance in HTML, and should be represented by HTML entities if they are to preserve their meanings. That, with the limited knowledge that I have, can be easily done in two different ways in PHP. Like this: <?php $some_code = '<a href="#test">Test</a>...

0
Q: MySQl insert in phpmyadmin

Tako Andghuladze$result = mysql_query("INSERT INTO add_subject (sname,class,hour_week,hour_year,exam,year) VALUES ('$sname','$class','$hour_week','$hour_year','$exam','$year')"); what is a problem there? :(

0
Q: How to make a search engine in PHP?

TheWebManI have a MySQL database with a table that looks like this FName |LName|Info --------------------------------------------------------------- John |Doe |Enjoys eating food --------------------------------------------------------------- Jennifer |Doe |Likes asking stupid questions on sack ...

0
Q: Pass Raw HTML to the view with Synfony

x_vi_rI got a project running Symfony2. I created a controller which crawl a webpage, extract some part of the page and store it in a variable like this : $myHTML = $this->get_news('http://thewebsite/search' . $searchTerms,'.domEltToExtract'); In the myHTML var i got some HTML code. Then i want to ...

0
Q: php verification for calls to a database

ScottI have set up a page on a site for collecting member information. I simply want to key off a check box that needs to have a verification on it fail if not checked. Also if any required field is NOT filled out. I am NOT checking emails. I have the following $_POST['FirstName'],",". $_Post['LastNa...

0
Q: Infinite loop issue

heronHere is my function.Using Yii fw. public function generateMenu($type, $class = "", $curl, $parent = 0) { switch ($type) { case 1: //LEFT MENU $html = "<ul $class>"; if ($parent == 0 && $type == 0) $ht...

0
Q: How do I create a registration, login/logout form, and a profile page for users in php

Riong RiongI've asked questions before on how to connect to the database using 000webhost, I've failed many times on connections and what not. I need some help on creating a sign up form and email verification and a login/logout form. I am a beginner web developer, should I switch to a different hosting pro...

0
Q: How to use javascript using PHP?

user2826499Scenario: I created a filtering using IF ELSE where when the user click BOX A AND BOX B... Then assuming the BOX A is already full, after the user hit the "SAVE BUTTON", a confirmation message will display saying that... "The Box you chosen is already full. Do you want to save the other items?" ...

1
Q: Php says it can't find a class which is already included

BluemagicaI am getting a Fatal error: Class 'Hybrid_Auth' not found When I am sure I included it like this: require_once( $base_url."/includes/hybridauth/Hybrid/Auth.php" );//$base_url is the domain where I am running this, currently, localhost And just to be sure, I modified the class file like: echo...

0
Q: Comet iframe apache

alexI hope the gurus can help me. I'm doing a chat using comet. Works fine but when I open another tab, the tab is locked, waiting to close the first. Does anyone have solution to this? file php : www.mysite.com/get_activity.php (use comet) while(true){ $actibity = get_sql_Activity(); if...

0
Q: Storing and retrieving an array in a PHP cookie

user2559745Good afternoon. I'm looking to store some data from some 'virtual' index cards. Each card has a front and a back, and the user can store multiple cards. Each side will have data on it. I ----------------- I I CARD 1 FRONT I I------------------I I --------------- I I CARD 1 BACK I I------------...

-1
Q: Download all needed files

dubanIm working on a webapp and I need show images just for 500ms, Im using jquery for change the images, the app is working OK in local but I need a way to charge all the images before the pacient start to use the app because in the server the images dont have time enough to charge in this 500ms. An...

0
Q: sum values of an array when keys are not values of another array

user2808753i have 2 arrays: $a=Array ( [25] => 21.00 [33] => 63.00 [12] => 45.00 [14] => 12.00 [17] => 22.00 ) $b=Array ( [0] => 24 [1] => 25 [3] => 14 ) I want to sum only the values of array $a that their keys do not much the values of array $b. For instance in this example the output would be 13...

0
Q: PHP fork process - getting child output in parent

workwiseI want to achieve the following: Initialize an array. Child process adds some elements to the array. Parent process adds some elements to the array. Finally before exiting, print all elements. Following is the code that I wrote: <?php $values=array(); $pid = pcntl_fork(); if (!$pid) { sl...

0
Q: Trouble with Session

user2216080On MY website, I have a animation that I only want it to play once when the use first visit the website. So I set up a session to check if the user visit for the first time. Below is my code: if(!isset($_SESSION["playedit"])) session_start(); if(isset($_SESSION["playedit"])) $_SESSION["playedit...

0
Q: How to get window foo to refresh when bar is submitted

amartin94So i have 2 windows.. my main browser window (foo), then it has a href that calls a bit of JS that will make a mini window (bar) pop up.. The mini window contains a form which posts to itself and query a database and updates fields.. It works fine. if($edit_type == "email") { if($update == t...

0
Q: Round a Value after While Loop in PHP

Clark GibsonHey with the following code I am trying to round the variable $CelNum, and since I am new to PHP I am unsure of how to do it correctly if you could help me I would appreciate it. <head> <title>Temp Conversion</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

0
Q: Cakephp select database in base of login

Alessandro MinoccheriI would like to know if there is a way to do a multiple database system For example I have many clients registered to my system and I want when the y login to select its databasse because I want to divide every client with an own database. Is this correct? Because I want to separate information ...

0
Q: PHP - subtracting time return nothing

user007I found a function form SC to output human readable time. like ` 5 hours, 1 hour, 5 years, etc function human_time ($time) { $time = time() - strtotime($time); // to get the time since that moment $tokens = array ( 31536000 => 'year', 2592000 => 'month', 604...

0
Q: Trouble inserting PHP variables into Mysqli

user2785884I am trying to insert data from a form I have made into my MYsql table using mysqli but whenever I submit my form it just displays the successfully connected to db server. Any ideas? It should show my errors for the insert shouldn't it? <?php if ($_POST['submit']) { $errormsg = ""; $name...

-1
Q: PHP how to access key inside foreach function

adpoPHP how to access array key inside foreach function foreach ($base as &$value) { $value = '' // how to access the key? }

0
Q: Error #1241 - Operand should contain 1 column(s)

superTrampI am trying this QUERY, and return this weird error. WHat does it mean? Here is my query: SELECT * FROM newRowP a WHERE a.rowId IN (SELECT * FROM newCellP b WHERE b.cellId IN (SELECT * FROM newproviderP c WHERE c.pId IN ('3000344','245')))

0
Q: json IP to db or file

DavidFirst of all here is my code: <html> <head> <title>the title</title> <?php $con=mysqli_connect("localhost","root","","test"); mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("grandpaswine"); $query = "SELECT * FROM ips"; $result = mysql_query($query); $dServer = ar...

0
Q: Using grep to find and edit the correct form

Doug FirrI have a website, built on a CMS (Ushahidi) that has built in translations. At the top right of each page is a drop down for 30+ languages. I'm trying to edit this so that only two languages remain: English and French. In order to find which files to edit I have been using grep like so: grep -R...

0
Q: Free PHP WebSocket API

NeroI am looking for a WebSocket API service that supports PHP and jQuery, like Pusher.com or Pubnub.com. I got some problems with "Pusher", so I'm trying to find some other websites like that. Do you know about some websites like that? Thanks

0
Q: Assign class to namespace that's not yours?

nbrogiI'm building this website editor with another developer. It's called Snaplive. Now, what gets added on pages are modules (ex. Text Block, Gallery, etc.). To print the module's HTML, Snaplive initializes a class that the module has defined, passing some info like ID, pageId, etc., and then calls ...

0
Q: Generate Jpg from folder PHP

user2329695I'm new to PHP and am learning how to create a photo gallery. I want to know how to generate thumbnails instead of a list. So on this code, I'm generating a list of jpegs instead of thumbnails. The page is set up like this, header on top, a picture displayed mainly between the header and the list...

0
Q: Simplify two MySQL queries to one by join and/or union

Perjés LászlóI have two query: (SELECT b904_Vasarlas.PrintedFigure as Image, b904_Vasarlas.ProductColor as Color, SUM(b904_Vasarlas.QTY) as QTY FROM b904_Vasarlas GROUP BY 1, 2) ORDER by 1, 2 With good output: Image;Color;QTY "villamos","blue","5" "villamos","pink","5" "virag","blue","5" "virag","pink",...

0
Q: php get unique sub array

Amit Kumar SharmaI want to get a solution in PHP to get unique array based on sub array bases. Like this Array ( [0] => Array ( [0] => 1227 [1] => 146 [2] => 1 [3] => 39 ) [1] => Array ( [0] => 1227 [1] => 146 [2] => 1 [3] => 39 ) ...

0
Q: Joomla default backend controller

Anindit KarmakarI am following the 'Developing a MVC Component' for Joomla. While coding the frontend, the default controller in com_helloworld\site\controller.php was left empty as shown below \\----com_helloworld\site\controller.php---- <?php defined('_JEXEC') or die('Restricted Access'); jimport('joomla.a...

0
Q: WP on GAE Insert Image in Post: "An error occurred in the upload. Please try again later."

NoahI've been banging my head against a wall on this one. I'm running Wordpress on AppEngine and have everything working fine (followed the GAE install instructions) except I can't insert an image into a post. I've installed the GAE WP plugin and have the cloud storage set up properly (which I know b...

-4
Q: Quiz Script in PHP and or MYSQL

TheWebManI am developing a quiz website for my pals and am wondering how to do this. I would prefer PHP and/or MYSQL. The script needs to be easy to change/edit

1
Q: Imagick transparency in animated GIF's

MartijnRecently, I tried a basic jQuery "marching ants" effect, based on http://www.sunpig.com/martin/archives/2010/02/10/marching-ants-in-css.html The jQuery code (it's not quite a plugin) is on JSFiddle here: http://jsfiddle.net/mwvdlee/xTZuZ/ and is fine. The animated GIFs supplied on that site are...

0
Q: Codeigniter User Session Error

EbrahimOut put Array ( [id] => 2 [firstname] => Maruf [lastname] => Ifftekhar [slug] => [email] => support@russelhost.com [email_subscribe] => 1 [self] => [phone] => 01767820010 [company] => Russel Host [default_billing_address] => [default_shipping_addre...

0
Q: Chrome api from PHP to Python

freeMinderI saw this page recently. I describes how to use Google's streaming speech recognition service using a PHP script. The script is available for download at the bottom of the page. I just wanted to know if somebody could write an equivalent Python script. I am weak at writing and understanding PHP...

0
Q: call a php page using cron jobs in direct admin

Sys Soft co.I have a php file that sends an email and it works fine when I open the page with browser. (test.php located in root of my website) But I want the page runs automatically once a day. I found that this is done using cron jobs. I searched a lot and tested a lot of commands and configurations but no...

0
Q: Return array in php

Fer SalasSo, I'm filling an array with data from a database using a query. I want to know what is the correct way to return the whole array. Note that the code has been edited to ask this specific question, so it may have syntax or other errors. I only want to know if im returning the array correctly. Tha...

0
Q: How to fix syntax error with single and double quotes

Jeremy TylerI am new to php and cannot seem to find the error in what I have. I am trying to update a database with a number. I am using an exact replica of what works in another row of the same table. However, I keep getting an error that says there is a syntax error near 'order=IF(LENGTH('3')=0, order, '3'...

0
Q: laravel 4 union genrate wrong sql

diligent Here is one $f = DB::table("topics") ->join("recommends", "topics.id", "=", "recommends.courseid") ->where("recommends.re_type", "=", $re_type) ->where("recommends.re_location", "=", $re_location) ->orderBy("recommends.weigh", "desc"); $s = DB::table("topics") ...

0
Q: Symfony2: FormBuilder for entity - optionsResolver

user2739610I've got 3 entities: Project,User,Module Module entity got fields: $id $user - Many to One with User entity $project - Many to One with Project entity $modules - ArrayCollection ModuleController: $form = $this->createForm(new ModuleType($em), $module, array('user' => $userData, 'project' =>

0
Q: current years in dropdown select box

user2715503I have this function for print current year in select box but option value not equal with option text. i.e :current years in selected value is 2013 but html text output is 2012. how to fix this? PHP: <select name="year"> <?php for($i=date("Y")-5;$i<=date("Y");$i++) { $sel = ($i ...

0
Q: Converting JSON string to Associative array in PHP

Khalid DabjanWhat I'm trying to Do is so simple yet everything I tries had failed. I have the following string: "{"msg":"background1.jpg"}", and I want to convert it to an array to access the msg value. this should simply be done like so(or so I've thought): $theString = "{"msg":"background1.jpg"}"; var_dum...

0
Q: PHP echo code from database

Zach HarkyI have a database set up to store user input and it then displays what they put on the page. $input = mysql_real_escape_string(stripslashes(addslashes($_POST["input"]))); //Later on echo '<div>'.$input.'</div>'; I went to the textarea and typed in some basic php code "," and it submitted to th...

0
Q: What are the relations between Model, View, Controller and Module in Zend Framework 2?

BineroI have created a Module with a Controller. My module is called 'App\Module\Foo' and the controller is called 'App\Controller\Foo'. I have configured Zend trough the application.config.php by using Zend\Mvc\Application::init(require 'config/application.config.php')->run();. (I have setup a custom ...

0
Q: Symfony _format on Route dont works propertly

rkmaxI have a simple crud controller generate by doctrine <?php namespace MyBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Sensio\Bundle\FrameworkExtraBundle\...

0
Q: Is this a security risk

kevin olsIm pretty new to php, and started to test a few things on my app and noticed this about my URL When I enter my site by mamp its http://localhost:8888/project/info.php But if I would add /'%25 to the end of the url string my CSS breaks all togehter Eg: http://localhost:8888/project/info.php/'%2...

0
Q: selecting all fields into two different table with same id_ref

user2656724i have two tables. salessumarry and rsales . both table have common id_ref. so what i am trying to get is select all those values from rsales and salessumarry has the same ref_id. here is my code so far. but this is not running. i don't know what's the problem with this. $result1 = mysql_query...

0
Q: Keep all html whitespaces in php mysql

sagitsi want to know how to keep all whitespaces of a text area in php (for send to database), and then echo then back later. I want to do it like stackoverflow does, for codes, which is the best approach? For now i using this: $text = str_replace(' ', '&nbs p;', $text); It keeps the ' ' whitespac...

-1
Q: Access php object value

Tsung YouI have this object i am able to access the name by $object->name but not able to get the starline and endline. I try $object->starline it return null. PHPParser_Node_Expr_Variable Object ( [subNodes:protected] => Array ( [name] => var ) [attributes:protected] => Array ( [startLine] => 2 [endLin...

0
Q: PHP - Naming class like a function

LukasI'd like to write a File-Class, but there is already a function in PHP which is called file(). Am I allowed to name my class like the function? <? class file{ public function __construct(){ /* DO_STH */ } } $a = new file(); ?> It works without a probl...

-4
Q: Go to URL after OK button in confirm bo is pressed in php

Gerad Sioco<a href ='monitor.delete.php' onclick=if(confirm('really?')) return true; else return false;><center>DELETE</center></a> I want a code that will redirect to delete.php when clicked 'ok' in a confirm box. But this won't work. Please help. Thanks

0
Q: Removing duplicate values from SplDoublyLinkedList

Marius MiskinisIs there a method to remove duplicate values from a list? I was trying to create my own method, but it takes quite a lot time depending on how much there is duplicate values: $arr = new SplDoublyLinkedList(); for ($i = 0; $i < count($arr); $i++) { for ($j = $i; $j < count($arr); $j++) { ...

0
Q: Are I'm using PHP Mcrypt the right way?

Guido KrömerI have written a small wrapper class for using PHP Mcrypt for encrypting and decrypting some text data. This class generates a salt for hashing the key and encrypts the given data with the generated key hash. The encrypted data get stored with the initialization vector and the key salt into a con...

0
Q: input button is not sending info, it is not doing nothing

user2826723I press the button and anything happens help me please amm... i dont know what to say more... the red square thing is driving me crazy! HTML: <span>register</span><br> <label>login :<input type="text" name="login" maxlength="20" placeholder="login" autofocus></label><br> <label>password :<...

0
Q: Alter table works intermittently

CarpetfizzI have a small PHP script where it adds a column to an existing table based on the registered username. However, this only works sometimes. I really don't know what keeps changing, because the code is the same. It only alters the table sometimes, but sometimes the table is unaffected. What could ...

0
Q: Script stopping when storing a session var in a javascript var

sebI am getting ~ 2k cities name from my Database that I am storing in a session variable than I am trying to convert my session variable into a javascript variable but my code looking to crash Code for session variable $sql = "SELECT nom FROM Villes ORDER BY nbSearch"; try { $resultat = $bd-

0
Q: Is it possible to build a native C++ app including HTML & CSS?

iBrazilianI'm a web developer, currently interested in programming desktop apps based on web applications. I'd like to start an app project based on a user interaction web application, where they'll be able to send private messages and check a users profile. It must remain constantly connected to the ser...

0
Q: Get image type from mime type in PHP

GreesoIn PHP, there are two functions, image_type_to_extension and image_type_to_mime_type, however, I am looking for the oppsite. Is there something like mime_type_to_image_type so I can retrieve the type from the mime (I only have image/jpeg, or image/png, and like to eventually get the extension)? ...

0
Q: Convert a 2D array to a string

JennyI would like to convert each element of a 2D array to a string, within an each But I cannot use do (specific requirement). The array is called families, and is defined as follows: #family.rb class FamilyDetails attr_accessor :name, :sex, :status, :age def initialize (name, sex, type, role,...

0
Q: Using '@' sign in input doesn't alter table

CarpetfizzI have a line of code that alters a table by adding a column for an email. For some reason, whenever there is an @ in the string, it doesn't update the table. Does anyone know what's wrong? mysqli_query($dbcon,"ALTER TABLE ipList ADD ".$userName." VARCHAR(100)"); It works fine if I type in som...

0
Q: PHP - number_format fails with math operations

gtilflmThe PHP function number_format produces weird results when using it with math operations. Run this... echo number_format(32545000 - 24343400) . '<br>'; echo number_format(32545000) - number_format(24343400); Why does the second one produce an answer of "8" instead of the correct answer?

0
Q: Block IE but keep some reserved links

iSunI blocked Internet Explorer (IE 6~9) via Apache .htaccess, so all links will be blocked if the agent equivalent to Internet Explorer, Now I want to ask that is it possible to ignore some reserved links? here is my current .htaccess: RewriteCond %{HTTP_USER_AGENT} "MSIE [6-9]" [NC] RewriteCond %...

0
Q: Strategy For Scheduling Email Alerts in PHP

AgilEI'm writing a PHP project in Laravel. The admin can queue email alerts to be sent at a specific date/time. The natural choice was to use Laravel's Queue class with Beanstalkd (Laravel uses Pheanstalk internally). However, the admin can choose to reschedule or delete email alerts that have not ye...

-1
Q: 500 Internal Server Error. How to fix it?

user2781811Sorry for my english Hi i have problem but if i go to my website i see this: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@netearn.aligator.xaa.pl an...

0
Q: Upload image in Wordpress with jQuery

aggeneraleI'm tring upload an image on wordpress front end. I built my form where there is: <input type="file" name="choose_file" id="choose_file" /> And then on click, starts this jquery code: jQuery('#upload_temp_image_results').load(pathname, {'image': jQuery('#choose_file').val()}); Finally the u...

0
Q: PHP not all post data is received on server

Anton GildebrandI am posting data with a size of approximately 200KB to my server running PHP 5.3.3.7. The data is actually a JavaScript object with nested properties, in the request it looks something like this: myObject[prop1][subprop1][key] = 5. However, all data isn't received on the server. The last part o...

0
Q: Basic Multiplication with PHP

KiranConsider the below code in PHP $a = 8425996523 * 121212713; $b = sprintf('%.2f', $a); $mul = gmp_mul("8425996523", "121212713"); Output is 1.0213378982814E+18 1021337898281396864.00 1021337898281396899 The actual answer is 1021337898281396899. Hence, it is clear that we need to use any ...

0
Q: coptic date of today like php javascript code

Michael tawfeakam looking to get coptic date of today with any code type like php or javascript to display coptic date to my site header. i tried search into internet but not found any thing like it at english i need it in arabic or english too link about it http://www.copticchurch.net/easter.html htt...

0
Q: submit form and close pop window using magnific-popup

Skye LansI'm using Magnific Popup. Within the popup I have a form and would like to close the popup when the form is submittied. I also want to provide a text link within the popup so the user can close the popup. I can't find how to do this within the documentation. Below is the code I'm using. <scrip...

0
Q: Json decoding the response returned from the Google Dictionary API in PHP

AttikAttakI trying to make a request to this url to get a definition of a pizza... http://www.google.com/dictionary/json?callback=a&client=p&sl=en&tl=en&q=pizza My initial response looks like this..... a({"query":"pizza","sourceLanguage":"en","targetLanguage":"en","primaries":[{"type":"headword","terms"...

0
Q: Auto Suggestion search box with php and jquery

Mohammad99Peace be with you all, I am having a problem with this code, it's about a search box that uses ajax to make auto suggestions for the user, I am testing the code but it seems to be not working, anu suggestions? :- the HTML code :- <input class="autosuggest" name="autosuggest" type="text"></input>

-1
Q: PHP: Help Accessing "__construct" objects from "extends" class

Nero F RoxI'm working on an MVC and i came across this issue and can't figure it out. Basically the VIEW of the MVC has gotten too big so i decided to try and split it into pieces and i figured using "extends" would do it but for some reason objects passed to the parent class are not accessible thru the ...

0
Q: Checking for empty fields after encryption

user2826397I have this chunk of code: <form action="register.php" method="post"> Email: <input type="text" name="email" /><br /> Username: <input type="text" name="username" /><br /> Password: <input type="password" name="p" id="password" /><br /> <input type="button" value="Register" o...

0
Q: Find closest point on line segment to another point in PHP

Jacob RI have been trying to figure out how to find the closest point on a line segment to another point in PHP and calculate the distance. I am doing this with geo coordinates(latitude and longitude). Lets say I have coordinates A and coordinates B, I use A and B to create a line segment which we will...

0
Q: SimplePie CRON job in Windows XAMPP

Drizzit12I am attempting to set up a CRON job on XAMPP in Windows but I am having some trouble. I have the timing set up so that it should run every 5 minutes, and this part works because I see my command prompt pop up every five minutes. This is the code for the CRON.BAT file that runs. Both locations a...

0
Q: php4 escape input with postgres options

user2073343I have a server that only has php4 and postgressql. As far as I can tell PDO and pg_query_params don't exist in php4. What alternatives are there? Or is raw escaping the only option?

0
Q: Sublime Text snippet to insert PSR-0 namespace

alcesleoI'm trying to make a Sublime Text-snippet that inserts a PHP boilerplate class, in the lines of: <?php namespace Namespace\Subnamespace; class TestClass { public function __construct() { //code... } } When using PHP-FIG standards(or similar), both the namespace and classn...

0
Q: Install Tor on my server

KeinStein I want to install Tor on my Hoster. (My domain is hosted on Hostgator, if it matters). I want to run it on my server and let it download websites through tor when I call a script like this: www.mydomain.com/loadwithtor.php?url=www.someotherdomainthatIwouldliketoload I know how to download ...

0
Q: PHP 'Trying to get property of non-object' with static class member

sgwatstackI have a class that displays ads on a page. I want to keep track of which ads have been displayed so I added a private static member to the class which will hold an array of numbers. I want to add IDs from a db query result to the static member as a way to exclude those IDs from the next query....

0
Q: How to display image and text (from a .txt file) in a modal popup?

KayeI need to create/customize a modal pop up in PHP or javascript. and I got these requirements: format the modal in two columns. display image from directory/folder on left column get/display text value(USUALLY PARAGRAPH/SENTENCES) from .txt file (in the same directory/folder as the .jpg file) on...

0
Q: CakePHP: Change dropdown selection with JS helper

develdevilI have two dropdowns: #GameVenueId and #GameHometeamId. Each Venue has a default Hometeam, so when #GameVenueId is changed, I'd like to update #GameHometeamId with the default Hometeam. (I also want the user to be able to select a different hometeam in the case of rare exceptions, so that's why I...

0
Q: Multiple file upload Jquery

Cudelcu Medvidek EmilekI'm trying to make a multiple photo upload,but it doesn't.I used the input between and now I made an ECHO in PHP with a table and put the input in a .I change the code in Jquery but it doesn't work anymore.Can someone help me?This is the Code JQEURY $(document).ready(function(){ $('#add...

0
Q: How to make soapclient add xsi:type to request

Oleksandr KhavdiyAPI server requires to specify a type of the passed value <anyType xsi:type="xsd:string">vvvvvvvvv</anyType> But soapclient generates request without xsi:type="xsd:string" <anyType >vvvvvvvvv</anyType> How can I make soapclient to add xsi:type="xsd:string" to the request?

0
Q: Server take long time to response

asad razaI've 2 website one host on hostgator.com and second host on hosterpk.com my both website are same, which is host on hostgator its response is fast, (2second) and which site is host on hosterpk it response is slow, it take 10-20 sec to load, i try many technique to solve problem, i Reduce my pa...

0
Q: Do You know, how to use ADD command into memcached?

Alexandre KalendarevI'm using in my project many counters by memcached: $data = $mc->set('sasa', 100); $data = $mc->get('sasa'); var_dump($data); $res = $mc->add('sasa', 100); var_dump($res); result is int(100) bool(false) int(100) If I use memcached native protocol: get sasa VALUE sasa 1 3 100 END add sasa...

0
Q: Magento Class Method Override Not Working

MatI'm trying to override the Catalog Search functionality of Magento so that it searches using 'AND' rather than 'OR' for search terms. The 'correct' way to do this, that is update proof, is to create my own module. So this is what I've done. Unfortunately, this isn't working. The updated method i...

0
Q: PHP empty: take a single 0 as a string only?

lauthiamkokI want to take a single0 as a string only for db injection but not 00 or 0000 as string. $post["content"] = '00'; if (empty($post["content"]) && $post["content"] !== '0') { echo "this field must not be empty!"; } It does not return it as an error. What should I do?

0
Q: How to display a text file on a webpage with original formatting

amartin94So im pretty annoyed i cant get this one simple little task completed after doing PHP for the entire night.. but the server im hosting on wont allow you to href text files directly.. I mean, it will, but it will display a blank window.. So i decided i'd build a php for the href and that php can h...

0
Q: PHP variable lost in scope issue

aserwinSimple data access layer program. I have a class with some protected variables for username password, etc. I have a function that reads the an INI file and fills those protected variables. like this class SqlAdapter { protected $_connection protected $_username protected $_passwprd ...

0
Q: Get random data from each category with different limit for each category php-mysql

user2826544I have one question table with id, type, question, option1 .. 4 and answer fields. Have three types of questions A,B and C. I have to take random 7 questions for A and B type each and 6 random questions for type C. Show total 20 questions for each test. I have to show only one question at a tim...

-1
Q: PHP check if date between two dates

Papa De BeauI got this code from Stackoverflow and changed it slightly to work with today's date. I want to check if today fits between two dates. But this is not working. What am I missing? $paymentDate = date('d/m/Y'); echo $paymentDate; // echos today! $contractDateBegin = date('d/m/Y', '01/01/2001'); ...

0
Q: Better way to handle multiple instances on AppFog when using Yii's CAssetsManager

luttkensIf you are running an Yii-app on Appfog with mulitple instances, and you are using CAssetsManager for your static files, you will (at least I did) experience issues with broken links to static files. I concluded that the reason is that each instance on AppFog will have a different paths to each ...

0
Q: md5 returns empty string

user2734072First of all I searched on Google and didn't find any help to my problem. I'm working on my local server with MAMP and I'm following a tutorial to try securing a php page with md5. In my login.php page there is a form with login/password fields which calls a JS function when submitted: <form i...

0
Q: cURL Display from another page

TehEnforceIm running PHP 5.4. This is my setup: ../cronscript.php ../index.php from conscript.php I use a cronjob to run it each 5 minutes or so but I want the echo of the cURL to display on index.php. How do I receive the echo at index.php? And how do I use a sort of cache so everytime I visit index.p...

0
Q: Setting PHP timeout for xml fopen

UltraWhile accessing xml file with fopen that don’t exist we get failed to open stream: HTTP request failed! But it takes 30 seconds. How to return this error immediately or short after not finding a file. Also, why when file is not found Apache scans lots of ports?

0
Q: TOR hidden service: PHP sessions

Daniel ElkinsIf someone was making a TOR hidden service using PHP, Apache, and MySQL, would sessions have to be done differently? Considering that many different users could be coming from the same IP address (using the same exit node), how does that change things? Should I rely on setting client-side cooki...

0
Q: Php mysql groupby result in array

user2437172********************** * id * typ * cl * ********************** * 1 * 1 * 1 * ********************** * 2 * 4 * 1 * ********************** * 3 * 7 * 1 * ********************** * 4 * 2 * 2 * ********************** * 5 * 4 * 2 * *********************...

0
Q: remove bengali diacritics unicode php

AunnoyIs there any way which prints the vowels of Bengali without the circle. I found a link which says printing the vowels by concatenating NBSP to it should work. It does, but not for the vowels which precedes a consonant (e.g. ো ে ি). I could not attach an image since I am new to this site. If anyon...

0
Q: Symfony2, Doctrine2 - force update - table already exists on many-to-many relation

user8542214After I successfuly created TaskBundle with One-to-Many relation between category and tasks, now I'm trying to create a new TaskBundle with Many-to-Many relation. I get also problem with checking checkbox in this relation, but now it is not a primary problem (maybe after solving this). I deleted ...

0
Q: What am I doing wrong? strpos, strlen, and preg_match

Isaac BodaSo essentially I'm opening a large file (I think it's large - 19MB) and trying to comb out anything that's not a 4 letter .com and dropping from the registry on todays date. So what I am trying to do below is call out the file and for each line in it find strings with date in line and 35 or less ...

0
Q: $id is not going with the link

pandithere i am making hyperlink in foreach loop. hyperlink is working fine. but with that i am sending $id value is not working. my link is showing http://****/test/index.php/test/view?id=**. i don't what i am doing wrong here. foreach($list as $item) { $rs[]=$item['una...

0
Q: Pagination LAST PAGE link. How to? PHP

user2759665I created my first successful pagination script following an online tutorial. Here it is: <?php include 'core/database/connect.php'; $per_page = 6; $pages_query = mysql_query("SELECT COUNT(`user_id`) FROM `users`"); $pages = ceil(mysql_result($pages_query, 0) / $per_page); $page = (isset($_GET...

0
Q: Where to validate a captcha in a MVC application?

DavidI have been wondering this for a while and today as I was going through my code I was looking at my register($accountType, $username, $password, ....) method in one of services and thought something did not look right. I use the reCaptcha captcha and in order to validate it you must have the use...

0
Q: Export large CSV file

Twisted1919I have a mysql table where each record can have unlimited custom fields (EAV model, doesn't matter this) and each field can have unlimited options and each option can have unlimited values. Right now i am trying to built a export tool that will export all these custom fields with their values, th...

0
Q: submit action results from a third party

dana danaI have this form, where users upload a file to be converted and the result (the conversion and the file converted=on fly) of the submit action is in a third party.it is possible that the users get the result (staying on my site) without being redirect to that third party? for the record, i'm not ...

1
Q: PHP PDO Update Query not working

asdasd asdaI am PDO newbie and i dont know how to catch error's or see what wrong anyway look at this code : Call The Function here : $this->storage->updateTriplet($cookieValues[0],$newToken.$this->salt, $cookieValues[2].$this->salt, $t, $expire); The problem function : public function updateTrip...

1
Q: Yii insert series of data

redGREENblueSo, I got a series of data that I need to insert into a table. Right now I am using a for loop to iterate through each entry and save the model one by one. But that doesn't seem like a good way to do it, moreover using transaction would be an issue. What's a better way to do it to improve perfor...

0
Q: One-To-One Self-referencing Problems

user2826942I am trying to implement a One-to-One Self-referencing relationship in Doctrine 2. So, my entity Membro_model is: <?php /** * * @Entity * @Table(name="tb_membro") */ class Membro_model { /** * @Id @Column(type="integer") * @GeneratedValue(strategy="IDENTITY") */ public $id = ...

0
Q: My first pagination script. Adding next and previous PHP

user2759665This is the first pagination script I've coded with help from a friend. I customized it a bit and want to also add NEXT and PREVIOUS buttons. Here is my code. <?php include 'core/database/connect.php'; $per_page = 6; $pages_query = mysql_query("SELECT COUNT(`user_id`) FROM `users`"); $pages = c...

0
Q: Magento multi range price options

UMII am new to Magento, and I have quite different price options to manage which I have already managed in another website but that was custom so I did manage without any issue. Now scenario is, there is standard e-commerce price which gets multiplied with added quantity by customer but now we have...

0
Q: Not receiving email from the PHP mail() method

jh_I have tried to set-up an email.html and an action.php so that someone can send an email from a website. Here is the code in email.html <form action="./action.php" method="post"> <p>Your Name</p> <p><input type="text" name="name" /></p> <p>Email</p> <p><input type="text" name="em...

0
Q: PHP / JQuery upload and crop solutions

user2737457I'm trying to create an avatar upload script that uses a cropper in JQuery but I'm unsure on which is the best one to use for my particular setup. Here's the sort of thing I want to happen: User clicks on a default "Browse" input button and selects the file The photo gets uploaded to a temporar...

-2
Q: jQuery -> PHP Array -> jQuery Array || Can't figure this out

GeorgeI'm making a username checker that takes POST data and sends it to a PHP script which creates a simple array (only 2 keys right now) that gets passed back into jQuery and echo's it into a tag. I can call it by writing all of the data, but whenever I try to access a single key in the data (keep i...

0
Q: How to insert an array to array in php

hitesh ranautplease help me in this thanks : i have an array like this Array ( [full_name] => Hitesh Ranaut [title] => Staff Author [articles] => Array ( [0] => Array ( [title1] => title 1 value ) [1] => Array ( [title2] => title 2 value ) [2] => Array ( [title3] => title 3 value ) [3] => Array ( [ti...

0
Q: why running a simple sql select query over mysql takes about 2 seconds in php?

Yuness MehdianMy code is : $sqli = new mysqli("localhost", "root", "mySelectedPass", "mydb"); $sqli->query("set names utf8;"); $sql = "select title from group"; $res = $sqli->query($sql); while($row = $res->fetch_assoc()){ echo $row["title"]; } Same query runs in phpmyadmin in 0.0004 sec. What's ...

 
7:45 PM
0
Q: Dokuwiki sends Ajaxrequest to not existing file

Umingomy dokuwikiinstallation at http://www.umingo.de makes some odd moves. with each pageload, at the end the file /lib/exe/doku.php is called like 10 times The odd thing: there is no file /lib/exe/doku.php. i even downloaded a fresh dokuwiki installation. there is also no file in the exe folde...

0
Q: Encode PHP code using gzdeflate

McSharkI want to encode my PHP code using gzdeflate, then use gzinflate to read, and eval the code $domain = "domain.com"; $license_key = "XGHJ"; function license_check{ // PHP CODE HERE } I encoded the PHP code above using gzdeflate, then tried to decode using gzinflate, I receive this error : Wa...

0
Q: Add Form Fields Dyanamically with JS

Brett PowellI current have a page called "device.php" that is used to either create new device listings or edit existing ones. I allow the user to add as many inventory items to the device as needed, which works fine for creating a new device. However, when editing it, the problem is that I load the existing...

0
Q: xdebug.trace_format=1 ignored

Johannes ErnstI'm trying to find a memory leak in my PHP code using http://derickrethans.nl/xdebug-and-tracing-memory-usage.html It appears that xdebug.trace_format=1 is being ignored and I don't know why. I'm running the PHP script from the command-line on the Mac. /etc/php.ini has: [xdebug] ; xdebug.ideke...

0
Q: Parse error: syntax error, unexpected $end On LDAP Login Form

emachine117I have been a long time reader or stackoverflow, but this is my first post. I am not very experienced with PHP and want to make an LDAP login page to for some of my administrative tools on my website but ran into an issue after using a few templates I got. I finally selected a template/tutorial...

0
Q: Adding next button to php pagination script. Its short and simple

user2759665This is the first pagination script I've coded with help from a friend. I customized it a bit and want to also add NEXT and PREVIOUS buttons. Here is my code. $per_page = 6; $pages_query = mysql_query("SELECT COUNT(`user_id`) FROM `users`"); $pages = ceil(mysql_result($pages_query, 0) / $per_pa...

0
Q: 3 Conditions + Random Order + Pagination (Code Igniter + MySQL)

Adriano d'Avila BorgesI have a tricky issue to solve, let me see if you can help me... Im developing a services directory using CodeIgniter + MySQL and, due to my client's business rules, theres 3 plan types. (Platinum, Gold and Silver - in this order from best to worse) There is a table with the companies tha adver...

0
Q: Loss special characters while converting session var to javascript var

sebI put an array containing name of cities into a session variable. Example of array : Saint-Tite, QC Saint-Émile, QC Sainte-Adèle, QC Sainte-Agathe-des-Monts, QC When I converting this session variable array into a javascript array var availableTags = <?php echo json_encode($_SESSION['villeDB...

 
00:00 - 20:0020:00 - 00:00

« first day (221 days earlier)      last day (89 days later) »