I need to make a cURL request to a https URL, but I have to go through a proxy as well. Is there some problem with doing this? I have been having so much trouble doing this with curl and php, that I tried doing it with urllib2 in Python, only to find that urllib2 cannot POST to https when going through a proxy. I haven't been able to ...
I need to insert a class named "current" into a list like below depending on what page I am on.
All pages on my site are included into the index page like this,
Index.php includes a header file then it includes the body file and then footer file.
The body file will be one of the pages below.
It is included through the page like this in t...
Here's my query:
SELECT *
FROM daily_records
AND date = DATE_SUB(CURDATE(), INTERVAL 1 DAY)
I use this to generate a report of everything that happened yesterday. This works great, Tuesday-Friday. However, on Mondays, I want it to be able to search back to Friday (the previous business day, eg INTERVAL 3 DAY).
Is there a way to do t...
Hi,
I am working on a php program that needs to store many "Event" objects in an array. Each event has a "due" date, and I need to be able to easily get these events by that day. There may be more than one event on any given day.
I thought about using a MySQL-style date as the key, like $array["year-month-day"], but it's messy. I also ...
I am busy doing an UPDATE/INSERT request, but here is the crux:
table PLAYERS {
player_id
game_id
team_id
position
number
}
What is supposed to happen is the following:
I test if there is an entry where
player_id = '$player_id' AND game_id = '$game_id' AND team_id = '$team_id'.
If there is, then the following ha...
My PHP site has header,body,footer files that are included into the INDEX.PHP page.
On the header.php file I have a menu like this
<div id="bottomrow">
<div class="pad">
<ul class="menu left">
<li class="first <?=$current_home?>"><a href="/"><em>Home</em></a></li>
<li class="users drop <?=$curren...
I have an ajax script (jquery) that asks index.php to output generated variables. This index.php is also the file where the whole page is generated and initially populated with data. How can I only let the getNewData() function when ajax requests this file. Right now it duplicates the entire page and outputs it so there is two of everyth...
I have a lot of users that have accounts on a phpBB forum.
I would like them to be able to re-use their username and password on a new website.
So the plan is that if I look up a username/password in my app, and its missing, I would like to call a page on phpBB that will tell me:
If the username/password is valid
The email address...
How can you use the following sample data either with a foreach or while -loop?
I get the following sample data by running
$answers = pg_fetch_all ( $result );.
Sample data
[0]=>
array(3) {
["answer"]=>
string(7) "This is the answer"
["username"]=>
string(5) "roope"
["was_sent_at_time"]=>
string(26) "2009-...
Simple question but I got a headache to solve this game. Example regex.
[a-zA-Z0-9\s]
[whitespace]Stack[whitespace]Overflow - not allow
Stack[whitespace]Overflow - allow
Stack[whitespace]Overflow[whitespace] - not allow
Let me know
Update regex from JG and it's working.
function regex($str)
{
$check = preg_replace('/^[a-zA-Z0...
I'm having a bit of confusion in attempting to retroactively create a new base controller for my project. If I'm not mistaken, all I need to do is create a file in application/libraries called MY_baseController.php containing the following:
class baseController extends Template_Controller
{
public function __construct()
{
parent...
I'm trying to figure out how to redirect to a new page (different application, controller, action) and maintain the current POST data.
My app is validating the POST data and if a certain criteria is met, I want to redirect to a different location, but make sure the POST data is passed as POST data to that new page. Here's a rough exampl...
Guys, I'm stuck, banging my head off the desk for the past few hours.
I am trying to consume a service, and I have 8 other functions that I call that are almost IDENTICAL in nature to this one, but this one, results in a 'SOAP-ERROR: Encoding: Violation of encoding rules' error.
Heres the function call (wsdl omitted for security):
...
I am using PHP to create a process that monitors our database and puts up a maintenance page on our website if the database is down.
I'm using PDO and Oracle.
I am trying to use one database connection and query it once a minute, alerting people if there's a problem. However, if the database goes down, the script waits 15 minutes befo...
I need to create an array by searching a string for occurrences of '[' followed by 0 or more characters followed by ']'.
My test string:
$string="[item 1] [2] [] [item3]";
All of the above must be matched.
I think the regex to do so is
\[*\]
But how do I create an array out of the string? Do I use
preg_match_all("\[*\]", $stri...
How would you do this PHP switch statement?
Also note that these are much smaller versions, the 1 I need to create will have a lot more values added to it.
Version 1:
switch ($p) {
case 'home':
case '':
$current_home = 'current';
break;
case 'users.online':
case 'users.location':
case 'users.featu...
I am running IIS7 and for the longest time I have been dealing with only being able load index.php. All other requested files return a "File not found" type message in the browser. I have built my own OOP Framework making it mostly a non issue. Now I am doing some ajax stuff. Ajax REQUIRES that I make use of more then one file because if...
Hi all,
I'm messing around with templating and I've run into a situation where I need to echo to the browser a template that contains html & php. How do I evaluate the PHP and send it to the browser?
So here's an example (main.php):
<div id = "container">
<div id="head">
<?php if ($id > 10): ?>
<H3>Greater than 10!</H3>
<...
I'm looking for [free] server software to store hierarchal data efficiently. My key challenge is that an object or group of objects almost always has 2 "parents" and one or both parents can have different connections with other parents, and those descendants must remain distinct from the common parent's other descendants.
Example:
A an...
I'm developing a web app specifically for mobile phones, and I've run into a doozy of a problem. On the Blackberry emulator I've installed, everything works fine. But when I run my Openwave or Nokia N60 emulators, I can't log into my app any more. When I check the logs, I find that the reason is that ALL of the $_POST variables are em...