-
Passing values to a pop-up window
Date: 08/03/06
Keywords: php, web
I'm not sure if this is where I should post my problem, but I'll give it a shot.
I'm developing a php website and I need to pass some values to a pop-up window. The user enters their information like their name, age, and address into a form. When they press the submit I want that information to be displayed in a pop-up window. I can get a pop-up window to appear but using $_POST does not work. I've been doing some searching and have seen something about using $_GET and appending the values to the URL but I want to try and avoid that.
Any help would be great thanks :)
Cheers!
Source: http://community.livejournal.com/php_dev/71794.html
-
HTTP_RAW_POST_DATA = null even though php.ini is told to pass it... help
Date: 07/26/06
Keywords: php
I'm at a loss here. I want to look at the raw http post data, but for some reason it's not coming through.
print $HTTP_RAW_POST_DATA; returns null
in the php.ini always_populate_raw_post_data = On
why doesn't it work?
[Edit:]
OK so it doesn't work because it's a multipart/form data. It doesn't work with fopen('php://input','r') either. ANy suggestions how I can view the raw http post?
Source: http://community.livejournal.com/php_dev/71596.html
-
I was wondering...
Date: 07/14/06
Keywords: php, security, web
I was wondering, just how many people write PHP to be console based "applications"? I find myself more and more using the language with the #!/usr/bin/php at the top to make it an executable script. I've found some great uses, one of my projects in fact is a SHOUTcast Automatic DJ system, customizable and modular of course, but it needs to be purely console based for the simple fact that the person I'm writing it for and myself want security and don't care about a web interface for this as it's unnessicary and very bloating. He'll want a web interface later, but I figure that can be done once I lay out the "application" in console, yanno? Back to what I was posting here about, I wanted to know how many people are using PHP in the command line environment as handwritten "app" to be able to do something or another. Curiosity gets the best of me, and if the response is high, I'll go ahead and post my library of functions i've found, written myself, compiled, and edited for CLE usage for everyone else to enjoy and use as well.
XPosted
Source: http://community.livejournal.com/php_dev/71287.html
-
Another question...
Date: 07/11/06
Keywords: php, java, web
I hope you guys aren't getting sick of me....you've all just been a huge help in my learning of PHP I can't help but come back here.
Anyway, new problem....it's so foolisly simple yet so ridiculously complex...lol. Here it is:
I've got a webpage with two drop down menus, using a separate form for each menu. The second drop down list is populated with information based on what the user selects from the first drop down menu. There are no "submit" buttons...I'm using an "OnChange" Event.
Once the user make a selection from the first drop down menu and then makes their selection from the second drop down menu, I want to be able to display the two selections that they have made just using a print statement in PHP. But what is happening is when the second drop down menu selection is made, it's completely swiping the selection from the first drop down menu from memory. I tried to create a variable in PHP that would store the first selection but it keeps getting swiped from memory. How do I fix this? Is it the ONCHANGE event that I'm invoking with the drop down menus? The javascript I'm using is: javascript:document.menu1.submit() and for the second drop down menu I'm using: this.form.submit(). I can't seem to maintain the selections that are being made.... :(
I hope that makes sense. Essentially, I'm just trying to let the user know what they selected by putting it to screen, but when I click the second drop down menu only the second drop down menu's selection gets displayed. The first drop down menu's selection output is blank because it has been swiped! Ahhh! This is driving me crazy...lol..
Cheers!
Mags
Source: http://community.livejournal.com/php_dev/71044.html
-
resuming http file transfer
Date: 07/06/06
Keywords: web
My boss wants to allow a person to try uploading a 20-30mb file and if it stops 1/2 through we wantt o be able to resume the upload. The upload mechanism will not be a webpage but a 3rd party application. I'd like to do this through http post if possible but I haven't found any good information by googling, maybe I am using the wrong keywords, some help would be appreciated.
Source: http://community.livejournal.com/php_dev/70665.html
-
OO Magic
Date: 07/04/06
Keywords: no keywords
I did a bit of research today, and came up with the following interesting method:
class MyClass {
private $sub_data; // some random object
public function doSomething() {
...
}
private function __call($name, $args) {
if( is_object($this->sub_data) ) {
return call_user_func(array(&$this->sub_data, $name), $args);
}
else {
echo "Error: sub_data is not an object. This method was not found\n";
return;
}
}
}
I have a class defined with a property ($this->sub_data) that holds a variable class instance. What the $__call() method allows me to do is to proxy method calls invoked on my "container" class down to the $this->sub_data class without having to know anything about the sub_data object instance.
More info:
Overloading
call_user_func
Source: http://community.livejournal.com/php_dev/70642.html
-
Maintaining Drop Down Menu Selection
Date: 06/15/06
Keywords: php
Hello,
I've a problem that appears it may have a simple solution but I can't seem to figure out. :)
On my php page I have two drop down menus. You make a selection from the first menu and click submit. Doing this will populate the second drop down menu with data corresponding to your first selection. When you make your second selection some information is displayed at the bottom of the screen. My problem is that when you make your first selection and click submit, the page gets refreshed and your selection is no longer displayed in the drop down menu. The same thing happens when you make your selection from the second drop down menu. Once you press submit, the page refreshes and the drop down menu displays the first item in the menu instead of the one you selected.
How do I get around this refreshing problem? I hope you can help :)
Cheers,
RM
Source: http://community.livejournal.com/php_dev/69647.html
-
TextArea Issue
Date: 06/11/06
Keywords: no keywords
Have any of you guys run into an issue where you get a 403 server error (below) when you attempt to enter too much text into a textarea field? Do you know what the limitation is for the amount of text it will accept? Since it is a server error, does that mean on a different host the limitations might be different? I've been googling it and finding mentions of using Post instead of Get for your form action, but I'm already using Post....
Error message is: "You don't have permission to access 'particular page' on this server."
Thanks in advance for any help.
Source: http://community.livejournal.com/php_dev/69414.html
-
A PHP Archive?
Date: 05/31/06
Keywords: php, mysql, html, sql, java, web
I've created a site hoping to archive php coded forums from the world wide web. This way an internet surfer can login and search categorized listings of forums so they can easily find what they're looking for.
Since there are thousands of php coded forums of all different content, I'd like to set up categories and list them under it.
unfortunately I know very little php. I know how to implement MODS into my forums and that's just about it.
Here's the site I'm working on. http://phpforumarchive.com/
Any suggestions or anyone willing to help? I am sure this will be a decent site when completed and people (internet surfers) will probably use it frequently. Forum owners will like it because of the free advertising they get for their site.
I know html, some javascript, no php beyond pre written MODS that show you how to instal them. MySQL? Forget it.
Tell me I'm in over my head.
Source: http://community.livejournal.com/php_dev/69050.html
-
Image editing
Date: 05/22/06
Keywords: php, browser, database, linux
Hello All.
I want to write an application that does the following.
1)Upload an image from browser,
2)Resize the image to 300 x N
3)Save the image to a database table or file system.
4)Create a thumbnail of that image sized to 75 x N
5) Save the thumbnail to a database table or file system.
I have all mechanics of the database table or file structure down as well as the uploading of the file. I am not sure how to do the image editing part however. I am assuming after some research that the GD library is what I want to use. Is that correct? Or do I have to write an interface to GIMP? That wont work, because although I am developing on Linux its gonna end up on a Windows server.
Can I install GD after PHP has been installed?
Thanks for any advice on how to accomplish this task.
Source: http://community.livejournal.com/php_dev/68567.html
-
Question for all the smart people
Date: 05/18/06
Keywords: php, mysql, sql
The company that I work for hired someone to write an application that tracks the business. She is developing it in PHP/MySql on her local Windows box using Dreamweaver's code snippets. I have never used the code snippets in Dreamweaver mostly because I preferred to write the code myself so that I knew what I was getting. There are no comments in her code and I am afraid that at some point I am going to inherit this mess.
So my question is, have any of you ever used these code snippets to write large applications that need to be secure enough to store credit card numbers and sensitive client information as well as the companies financial records. The site may at some point be hosted on the internet so that remote users can access it as well.
Thanks.
Source: http://community.livejournal.com/php_dev/68168.html
-
Calendar
Date: 05/03/06
Keywords: php, web
I have a need for a particular set of functions in a calendar application for events (for use by a group that schedules events).
Basically, I want to have:
* Authenticated users adding events to the calendar.
* Anonymous users being able to search events in the calendar.
* Relatively flexible event scheduling, e.g. "third thursday of every month", "alternate fridays", etc.
* Relatively flexible event searching, e.g. "show me all events of type X in or near postcode Y" (and much more complex searching than that, too).
Now I'm reasonably resigned to the fact that I'm going to have to code a lot of this to get the searching functionality working the way I want it to at least, but can anyone offer me some starting points? I've looked at a few PHP calendar packages such as ExtCalendar2, phpCalendar, and WebCalendar, and also the PEAR Calendar class, but does anyone have any experience extending / modifying these to give me the sort of functionality I'm after?
Source: http://community.livejournal.com/php_dev/67995.html
-
Mail Server Configuration
Date: 04/28/06
Keywords: software
After spending a few months with a WAMP connection on my home machine, I've finally realized that I never set up the mail server. I have no experience with this sort of thing, so I was wondering if there was a way I could set one up without spending any money, compiling software, or downloading a new OS?
(cross-posted to a few different groups)
Source: http://community.livejournal.com/php_dev/67667.html
-
Abstract: global configuration logics
Date: 03/30/06
Keywords: php
Hello everyone,
This is not a question in particular, rather something I'd like to put up for discussion to hear different opinions from developers.
Ok, I guess any medium/large scale script involves configurations, often those being stored in files. Some, mostly large scripts store conf settings in the DB, however this still requires for at least the DB configurations to be stored in a file.
Now since global variables are a bit of an inconvenience in php, in my opinion of course, I've always had a problem with choosing the best way to store this kind of stuff. The problem being you cannot just create a $conf var somewhere in the application head and use it throughout the script, because you will have to declare it global whenever out of scope.
Very many people use define() calls, however I believe that in the age of OOP doing this is somewhat clumsy and possibly wrong.
What I personally do, is store my conf variables in a function which returns the whole array of configuration key/value pairs. Since functions in php are global this basically eliminates all inconveniences mentioned above. Still I find this method extremely artificial.
I would like to hear how you approach this or similar issues, especially when dealing in an OOP envioronment.
Source: http://community.livejournal.com/php_dev/67494.html
-
More PHP Help
Date: 03/17/06
Keywords: php, html
Okay, a little back story. For several years now I've had some PHP queries of story listings. I don't want them run repeatedly, so in addition to this I run a cron job with curl statements like:
curl http://.../all-stories-num.php -o /home/.../all-stories-num.html
This has worked beautifully, makes an HTML for each file, and I just run it nightly to account for updates during the day. However, as the site has grown, there number of PHP files has grown to 1010. So I thought I'd consolidate them into a few files passing variables in to differentiate. Then still run a cron of curl statements, except now they'd look like this:
curl http://.../charbytitle.php?cid=80&letter=W&pageno=1 -o /home/.../ofcw.html
Well after extensive testing, apparently this won't work, at least not the way I've done it. The curl statement doesn't handle the variables passed in.
Does anyone have any ideas of how else I could get the same effect? i.e. one HTML for each type of query without having to maintain over a thousand PHP files? Or someway to cache the results for 24 hours if I used the PHP files directly?
cross-posted to php and my journal
Source: http://community.livejournal.com/php_dev/67216.html
-
File Manipulation
Date: 03/17/06
Keywords: no keywords
I am able to add data to an existing file. How do you clear it, or delete data from it?
Source: http://community.livejournal.com/php_dev/67020.html
-
API Security Practices.
Date: 03/11/06
Keywords: php, security
For the past 2-3 days I have been playing with the flickr API using REST, via PHP. This has gotten me thinking about an API that the company I work for wants to create for connecting to our services. Part of that API will require some kind of security token for an external application to access our API methods. I have never done anything like this so I am not quite sure where to start.
Looking at flickr as an example.
Flicker has an authentication URL. This URL contains a query string with an api_key, perms(ie permissions), and an api_sig. The sig is a combination of these 2 query strings and a "secret". in this format. secret+"api_key"+yourApiKey+"perms"+requestedPermissionType which is then turned into an md5 sum. The secret is given to you when you place a request for an API key with flickr
When you pass this information to their authentication application, it returns a "frob" key Which you can then use to get a token for the user that is using your application.
I don't know if I need to go quite as far as using a frob and getting a token for my companies's application, as our application doesn't allow other people tp use our users, but more or less they have their own users and we just manipulate data between us.
Ideas? Suggeston? Comments? Links?
TIA
Source: http://community.livejournal.com/php_dev/66628.html
-
PHP/MySQL Developer job position
Date: 02/22/06
Keywords: php, mysql, rss, css, html, database, sql, java, web, linux, apache
I hope job postings are welcome here.
We are looking to hire a PHP/MySQL Applications Developer at our offices in Charlestown, MA (part of Boston). This is a full-time, on-site position. If you are interested in applying, please send your resume, links to successful projects, and a code sample (100 or more lines showing your coding abilities and standards) to mo at smarterliving dot com.
PHP/MySQL Applications Developer
We are looking for a smart, creative, motivated self-starter who wants to join a strong team of developers in a rapidly growing company, building some of the leading consumer websites in the travel industry.
The PHP/MySQL Applications Developer will be a part of our Applications Development team developing scalable, database-driven web applications for our production websites (www.smartertravel.com and www.bookingbuddy.com) in a LAMP (Linux, Apache, MySQL, PHP) environment.
We offer competitive salary & benefits and a great work environment in T-accessible office space with parking on the Charlestown/Somerville line.
Job Qualifications:
The ideal candidate has 2-5 years experience developing with PHP 4-5 in a professional team environment using Object-Oriented Design principles. A strong understanding of XHTML, CSS, MySQL and JavaScript is also required. Experience with AJAX, JSON, RSS or other emerging technologies is a plus.
The successful candidate will communicate well, be committed to delivering quality work on an aggressive schedule, and must be able to function independently as well as part of a team. Must document code faithfully and take good coding practices seriously.
To apply:
To apply please provide a resume and cover letter including links to successful projects and summarize your participation. A code sample sufficiently long to show coding style and design methodology is also required. In addition, please indicate the best time to contact you, between the hours of 9:00 a.m. and 6:30 p.m., Monday through Friday.
IMPORTANT: Any submission not including code samples and links to working online applications that the candidate has written will be ignored.
The location for this position is in Charlestown, MA. It is a full-time, on-site position.
X-posted.
Source: http://community.livejournal.com/php_dev/66526.html
-
PEAR
Date: 02/22/06
Keywords: php
So I finally got PEAR to work in my Windows installation of PHP. The problem was that my test program was called pear.php. The require statement at the top of the script was:
require_once('pear.php');
Which meant that it was trying to call itself and not the PEAR module. Simple problem, I can't believe that I missed that.
Source: http://community.livejournal.com/php_dev/66257.html
-
PEAR
Date: 02/21/06
Keywords: php, mysql, sql, apache
I am trying to install PEAR on a Windows XP machine. I have Apache, PHP and MySql running. I followed the installation instructions very carefully. However all my paths were screwed after the installation was complete. I reinstalled PEAR and now everything looks correct. However (there is always a however) the PEAR_Error package seems to be missing. When I make a new DB object I get a message saying Pear_Error cannot be found.
Using the list function for the CLI I can see the packages that are installed. However when I try to use the CLI to verify the packages it says they cant be found.
Has anyone else loaded PEAR in the same environment as me? Are there problems with the CLI and Windows?
Thanks.
Source: http://community.livejournal.com/php_dev/65904.html