PHP is an open-source server-side scripting language widely used in web development. Use this tag for questions about PHP classes, methods, functions, syntax and use.

learn more… | top users | synonyms (6) | php jobs

0
votes
2answers
15 views

PHP object inheritance : how to access parent attributes?

I wrote this little test script for PHP object inheritance : <?php class A { protected $attr; public function __construct($attr) { $this->$attr = $attr; } public ...
0
votes
2answers
16 views

How to insert into database using ajax on php?

I have html form with three values fname,lname,age. I want to send it on server side php file and insert into database. My html form is like this: <html> <head> <script> function ...
1
vote
2answers
16 views

Partially override a function in php

Consider the following code: class Manager{ function a(){ $var1 = 10; $var2 = 20; var_dump($var1 * $var2); echo "<br> var1=" . $var1 . "<br>"; echo "var2=" . $var2; ...
0
votes
0answers
11 views

Run node server from php script (cron)

I wrote php script that runs node server: <?php file_put_contents("/var/www/executed.txt", "wykonano"); $url = "http://xxx.pl"; $http = curl_init($url); curl_setopt($http, CURLOPT_RETURNTRANSFER, ...
0
votes
1answer
21 views

Multiple actions for a single <form> [duplicate]

I've a form "dataEmp" where user has to enter username and password and "submit".I have successfully sent the form data to "checkLogin.php" file but what if i want to send that same form to another ...
-2
votes
1answer
35 views

CSS doesn't work when using DOCTYPE

I have a very simple html page: <!DOCTYPE html> <html> <head> <title>Title</title> <link rel="stylesheet" type="text/css" ...
0
votes
1answer
11 views

.htaccess with codeigniter redirecting

I am using codeigniter trying to achieve this test.html redirect to index.php/test/test well 1st test is folder name & 2nd test is controller
0
votes
2answers
31 views

How to put PHP while loop inside a HTML option menu?

I have downloaded a shopping cart for my site, It has a PHP file to fill out the basket. the basket will show added items in rows, here is the code : <?php define('INCLUDE_CHECK',1); require ...
0
votes
1answer
27 views

how to check if a particular row of a table is empty

I'm tyring to make a login page where user's login time will be inserted in the table if an entry is not present in the "loginTime" row of "emp" table otherwise no updation. The idea is to enter only ...
1
vote
2answers
19 views

Fetch mysql data using while condition in div

Before i was displaying zones records static although i have records in database table HTML <div class="pub_fot_sec_menu pub_fot_list_fst"> <h2><a ...
0
votes
0answers
13 views

How to send a file from server after a form submit to a email using PHP mail function

This is a simple PHP application where a user fills the form and when they submit it a new file is create using the fopen() where all the form input data are store. Here's what my code looks like. ...
0
votes
0answers
22 views

Should I allow \n store into database

I have textarea in my form when user type Enter key, it will store \n into database should I allow \n to store into mySql database? or should I str_replace it, what if user type abc\n\n\n\n\n\n\n\n ...
0
votes
1answer
21 views

Rename Image with PHP if image already exists

I'm working on a system that uses images, and the images are named by a md5-ed email. And I'd like to add a -1 -2 etc after the newly uploaded image if an image with the md5-ed email name already ...
0
votes
0answers
6 views

FB friend-selector frame is in https and cannot interact with hosting page in http

I have implemented an invite your friends feature on a site. Lately it stopped working (Due to the continues pleasure of the "stable" Facebook graph API...) I'm trying to wrap my head around this one ...
0
votes
0answers
6 views

Integrate PHP library in WP site

I have a WP site and I would like to integrate "Advanced Member System" PHP into the site. I need to have the look and feel of my website to the external PHP. The problem is that I don't no exactly ...

1 2 3 4 5 26899
15 30 50 per page