Im new with php. Have some questions on how to build. I include everything in index.php. Ex:
ob_start..
html...
functions etc..
if ($_GET['page'] == "forum") include('forum.php');
elseif ($_GET['page'] == "profile") include('profile.php');
else error...etc
/html...
I do it this way because I dont like to have to include a page in t...
Note: solution at the end
If I attempt to do a HTTP POST of over 1024 characters, it fails. Why? Here is a minimal example:
recipient.php:
<?php
if (strlen(file_get_contents('php://input')) > 1000
|| strlen($HTTP_RAW_POST_DATA) > 1000) {
echo "This was a triumph.";
}
?>
sender.php:
<?php
function try_to_post($char_count) {
$u...
Hello all,
There are a few APIs for grabbing the address book/contact list from the major providers of email.
I was wondering do APIs like this exist for grabbing emails/messages received?
Thanks all
EDIT
I am sure I can do this myself. However, I don't want to "re-invent" the wheel if someone has done it already. Probably better th...
Well right now I have a page (page2.php) and at the top it does some validation checking and if something fails it bounces back to page1.php. The problem is that page1.php is loaded by a post meaning it is the end result of a form. This means that all the post data I originally have on page1.php is lost.
So here is my code:
if ($vali...
I'm already proficient in PHP and Javascript, but for a project a client is insisting that it be done in Python instead. Its a good opportunity, so I've agreed to learn Python.
My questions are:
How easy/hard will it be to build AJAX powered web applications in Python compared to PHP
what are the main differences in the two languages...
Hi friends,
I had a doubt in CURL (PHP) . I want to login directly into a site using CURL. Is it possible, if possible please guide me.
I tried with the following but its not working
http://username:password@myurl
Please solve this..
Thanks in advance
...
Dear all i am using php and JQuery, and JSON.Now i need to know how to parseThe JQuery data in javascript.
load.php
<?php
...
$json =json_encode($array);
?>
It Returns jQuery by following data
[{"name":"STA","distance":"250","code":25},
{"name":"GIS","distance":"500","code":45}]
jQuery
$.getJSON("load.php", function(json...
Hi ,
i read one post regarding this topic, i also want to do the same,
i have my database on remote linux machine, and i want to connect using ssh and php funcitons,(i am currently using ssh2 library for that)
i tried using mysql_connect, but it gives me cant access (although i have granted permission)
when i tried using this function:...
I am working on an online portal, where researchers can upload their research papers. One requirement is, that all PDFs are stored in PDF/A-format. As I can't rely on the users to generate PDF/A conforming documents, I need a tool to check and convert standard PDFs into PDF/A format.
What is the best tool you know of?
Price
Quality
Sp...
Hi Stackers,
Problem
Basicly, it's impossible to use a full-size photograph with the background-image in a proper way imo.
Different resolutions, wide-screen etc etc. What im looking for is a JS/PHP GD solution for this problem.
Technique
From what i hear, it would be as follows. Javascript looks up available screensize (browser window...
Hello,
I have the following php code, which has been snipped for brevity. I am having trouble with the code after $lastImg is declared, specifically size never seems to get assigned any value, and the hence outputwidth and outputheight remain blank. I have been unable to spot the cause of this.
pic_url is just a string in the database,...
I'm building my personal CMS and need your advice organizing core functions and classes.
I have folders:
/shared
/classes
DB.php
Session.php
Config.php
...
/libraries
Arrays.php
DateTime.php
Email.php
...
The files in 'classes' folder contains core classes (one class per fi...
I'm in the process of trying to migrate my ASPNET site to Django. All my current data is tied up in MS SQL Server on a shared host that (helpfully) doesn't support python... I could use my existing code to export all the data but I've also stopped using Windows. The site is mainly compiled VB.NET so I'd need to install Windows and Visual...
I am attempting to download images saved in a url to a local folder, and have made the following attempt at doing so with curl. I would like to know if it is necessary to include curl or download it seperateley, or if my function will just work. I would like to know if there are any obvious problems with my implementation below. I am awa...
I have this simple php script
<?php
echo '<pre>';
// Outputs all the result of shellcommand "ls", and returns
// the last output line into $last_line. Stores the return value
// of the shell command in $retval.
$last_line = $output = system ("~/public_html/cgi-bin/srch.sh &> ~/public_html/errors.txt",$retval);
// Printing additional i...
I'm running PHP 5.2.4 with ibm_db2 v1.8.0 on Ubuntu 8.04.1 Server. I am trying to hit an IBM iSeries running OS/400 v5R3 but I'm not sure at all how to actually connect without a DSN. I've looked at http://www.connectionstrings.com/ but none of the DB2 or AS/400 connection strings seem to work. All I end up with is:
[IBM][CLI Driver] SQ...
Hi Everyone,
I'm having some problems getting my object to gracefully fail out if an invalid parameter is given during instantiation. I have a feeling it's a small syntax thing somewhere that I simply need fresh eyes on. Any help is more than appreciated.
class bib {
protected $bibid;
public function __construct($new_bibid) {
...
Hey,
I am getting an undefined index on my config page and it reads:
Notice: Undefined index: SERVER_ADDR in inc/config
.inc.php on line 3
Any idea on how I can fix that? I know its warning, but would still like to get at it. I am using it to check for the address whether to use my local or remote config settings.
Thanks,
Ryan
...
What would be the easiest way to have a page where it will display a list of directories that the user can click on to open, where there will be more directories or eventually files to download and have it all happen on the same page?
...
I have the same expression in Javascript but it won't work in PHP for server side validation. Here's the code
if (ereg('/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\\.([a-zA-Z])+([a-zA-Z])+/',$_POST['email-address']))
echo "valid email";
else
echo "invalid email";
...