i have a submit page in html. when i submit the form data, it goes to a php page, which inserts the data in the database.
my question is how would i ensure that the data on the html page is not null or empty without using javascript? is there anyway this could be done in php? thanks!
Hello, I've recently started learning PHP, but I have a wide knowledge on C++. I've been wondering how to make a web bot and now, I would greatly like to make one. I won't be using this robot for spamming or anything, just as a test of what PHP/C++ can do online. I was wondering how I could go about doing this and if you have any articles/tutorials that would be helpful.
Thanks,
John
Hi,
I am developing online video streaming website on PHP.
I need two functionalities:
Need to add title/text at bottom of the video dynamically.
Need to add background music to video dynamically.
Is it possible with PHP or any available open source library?
Can anyone guide me or provide links to this type of library ?
Thanks.
I have this PHP code:
<?php
$username="root";
$password="******";// censored out
$database="bazadedate";
mysql_connect("127.0.0.1",$username,$password); // i get unknown constant localhost if used instead of the loopback ip
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM backup";
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
$raspuns="";
while ($i < $num) {
$data=mysql_result($result,$i,"data");
$suma=mysql_result($result,$i,"suma");
$cv=mysql_result($result,$i,"cv");
$det=mysql_result($result,$i,"detaliu");
$raspuns = $raspuns."#".$data."#".$suma."#".$cv."#".$det."@";
$i++;
}
echo "<b> $raspuns </b>";
mysql_close();
?>
And it should return a single string containing all data from the table. But it says "connection reset when loading page".
the log is :
[Tue Jun 15 16:20:31 2010] [notice] Parent: child process exited with status 255 -- Restarting.
[Tue Jun 15 16:20:31 2010] [notice] Apache/2.2.11 (Win32) PHP/5.3.0 configured -- resuming normal operations
[Tue Jun 15 16:20:31 2010] [notice] Server built: Dec 10 2008 00:10:06
[Tue Jun 15 16:20:31 2010] [notice] Parent: Created child process 2336
[Tue Jun 15 16:20:31 2010] [notice] Child 2336: Child process is running
[Tue Jun 15 16:20:31 2010] [notice] Child 2336: Acquired the start mutex.
[Tue Jun 15 16:20:31 2010] [notice] Child 2336: Starting 64 worker threads.
[Tue Jun 15 16:20:31 2010] [notice] Child 2336: Starting thread to listen on port 80.
[Tue Jun 15 16:20:35 2010] [notice] Parent: child process exited with status 255 -- Restarting.
[Tue Jun 15 16:20:35 2010] [notice] Apache/2.2.11 (Win32) PHP/5.3.0 configured -- resuming normal operations
[Tue Jun 15 16:20:35 2010] [notice] Server built: Dec 10 2008 00:10:06
[Tue Jun 15 16:20:35 2010] [notice] Parent: Created child process 1928
[Tue Jun 15 16:20:35 2010] [notice] Child 1928: Child process is running
[Tue Jun 15 16:20:35 2010] [notice] Child 1928: Acquired the start mutex.
[Tue Jun 15 16:20:35 2010] [notice] Child 1928: Starting 64 worker threads.
[Tue Jun 15 16:20:35 2010] [notice] Child 1928: Starting thread to listen on port 80.
Any idea why it outputs nothing?
I keep getting this error, although the file still gets moved into the correct directory. Anybody know why i'm getting this error?
Warning: rename(../Images/uploaded/1162504_56863010.jpg,../Images/uploaded/Portraits/1162504_56863010.jpg) [function.rename]: No error in D:\Data\Websites\wamp\www\StephsSite\PHP\addImage.php on line 21
I need some PHP classes that deal with image processing in a good manner. I have made a thumbnail creator myself but the end result quality is just horrible.
Is it also possible to let PHP convert and save all images to one type. For example take an image(jpg,png,gif), compress it, resize it, and save as png.
Can anyone recommend some good classes for this.
I have been playing around recently with jqgrid and am at loss on how to implement search in my controller using PHP (Zend).
I came across a post that is quite similar to the answer am looking for but what I need is the PHP version not ASP.NET.
i coded a random quote generator in php using mysql but also jquery. however when i try to integrate it with facebook, since i opted to use fbml, i could not use jquery.
how do i get the quote to display randomly in php at say, 30 mins, without using jquery or javascript?
I'm writing a web application in which i use several thirdy party commands calling them with the exec function in PHP (for example, I render Latex formulas through a command-line program).
My question is: what are the security issues of executing external command-line programs in php? What I have to be aware of? Can you give me a list of points to check?
Thanks in advance.
I have been asked to include some html snippet in this php/smarty page. It's basically a sales agreement at the end of an overview page before you pay.
What is the code to include static html into my php/smarty template?
Thanks...
I ask this question because i learned that in programming and designing, you must have a good reason for decisions. I am php learner and i am at a crossroad here, i am using simple incrementation to try to get what im askin across. I am certainly not here to start a debate about the pros/cons of pointers but when it comes to php, which is the better programming practice:
function increment(&$param) {
$param++;
}
Or
function increment($param){
return $param++;
}
$param = increment($param);
hi
i am trying to set up a home page with an email form, where i can fill out email address and subject and comments and the php page will run
mail -s [email protected] $comments
how can I do this via php to call the linux command?
thanks in advance
I'm interested in literature (articles on internet, in magazines, books, podcasts - I don't really mind anything) that describes how PHP works internally, about its gotchas and perhaps some advanced functions. Is there anything like this out there? I tried to search on Google, but majority of articles were about starting with PHP and its basic functions.
Any input is really welcome as I'm trying to understand the language internally - I'm tired of my mindless typing of code without understanding its essence.
Is there anyway to find the month difference in php? I have the input of from date 2003-10-17 and todate 2004-03-24. I need the results how many month is there within these two days. Say if 6 months, i need the output in months only. Thanks for guide me for day difference.
I find the solution through mysql but i need in php. Anyone help me, Thanks in advance.
hey
i made a script that uploads files to different servers using php curl and the problem is that it eats all my upload bandwith and my apache does not respond as i would like.
the call is made from the php-cli and can not use any apache bandwith limiting bandwith
thanks in advance
Hello everybody!
I've been wondering whether is possible or not to pass a function as parameter in PHP; I want something like when you're programming in JS:
object.exampleMethod(function(){
// some stuff to execute
});
What I want is to execute that function somewhere in exampleMethod. Is that possible in PHP?
Thank you so much.
How can include CodeIgniter content in a regular PHP page on the same server but not part of the CI app?
For example I'm am trying to load a header from CI into Wordpress. Whats the best way to include a CI controller (eg; index.php/mycontroller/header/) on the same server?
Hello guys,
I have a session created which is null when called from an ajax call on Safari.
header.php
session_start();
$_SESSION['test'] = 'this is my session';
mypage.php
session_start();
echo $_SESSION['test']; <-- NOT WORKING ON SAFARI
Thanks
How do guys suggest to share a constants file between PHP and JavaScript, in order not to repeat code? XML file? I am assuming mixing up javascipt inside PHP would not be the right solution!? Thanks
my scrip is supposed to look up contacts in a table and present thm on the screen to then be edited. however this is not this case. I am getting the error
Parse error: syntax error, unexpected $end in /home/admin/domains/domain.com.au/public_html/pick_modcontact.php on line 50 NOTE: this is the last line in this script.
<?
session_start();
if ($_SESSION[valid] != "yes") {
header( "Location: contact_menu.php");
exit;
}
$db_name = "testDB";
$table_name = "my_contacts";
$connection = @mysql_connect("localhost", "user", "pass") or die(mysql_error());
$db = @mysql_select_db($db_name, $connection) or die(mysql_error());
$sql = "SELECT id, f_name, l_name FROM $table_name ORDER BY f_name";
$result = @mysql_query($sql, $connection) or die(mysql_error());
$num = @mysql_num_rows($result);
if ($num < 1) {
$display_block = "<p><em>Sorry No Results!</em></p>";
} else {
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$f_name = $row['f_name'];
$l_name = $row['l_name'];
$option_block .= "<option value\"$id\">$l_name, $f_name</option>";
}
$display_block = "<form method=\"POST\" action=\"show_modcontact.php\">
<p><strong>Contact:</strong>
<select name=\"id\">$option_block</select>
<input type=\"submit\" name=\"submit\" value=\"Select This Contact\"></p>
</form>";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Modify A Contact</title>
</head>
<body>
<h1>My Contact Management System</h1>
<h2><em>Modify a Contact</em></h2>
<p>Select a contact from the list below, to modify the contact's record.</p>
<? echo "$display_block"; ?>
<br>
<p><a href="contact_menu.php">Return to Main Menu</a></p>
</body>
</html>
Possible Duplicate:
What PHP-specific questions would you ask in a job interview?
What topics, areas and interview questions should be covered in order to assess candidate for PHP Developer Position ?