I have a factory class I'm making in PHP. Each instance represents a row from a database table.
Since I'll be dealing with dozens of database rows, it would be silly to have each instance do a select on instantiation. So I have a method to just dump values in to the object, for use in conjunction with a database query that returns a lo...
i have a book form in which there is an ID field. i'd like the [disabled] textbox to display the ID from mysql when the user tries to fill the form.
it should check the database for the last id and accordingly display the next id. for example, if the last id entered is 8, then it should display to the new user- 9. how would i pre-gener...
Hello! I have a variable $ node-> field_work_start [0] ['view'] which denotes the date of birth. To follow up I want to do a background check on the fact that this date is included in the next period then 10 days from the current date. If true then x = 1, false x = 0. Help please with code PHP.
...
I am trying to use AJAX to populate some select boxes that were autogenerated using CakePHP's formHelper.
How do I add the onChange event listener to the select box?
...
Im trying to code a php script that will loop a process for each line in a Textarea post. I was wondering if someone can post an example.
...
Let me explain.
Normally when hidden fields are passed from a form to the page specified in the action of the form, those hidden fields can be accessed on the processing page like so:
The Form:
<form action="process.php" method="POST">
<input type="text" name="username" />
<input type="password" name="password" />
<input typ...
Hi all,
How do you print a new line break in CakePHP.
I have tried this out:
echo "<b>\nhelloworld\n</b>";
instead of printing the it into three separate lines like this way:
<br>
helloworld
</b>
it just printed in this way when I viewed the HTML source code:
<b>helloworld</b>
...
Hi i am trying to include a webpage link from another website into my website.
how can i do this?
i tried
<?php web_include ('http://website.com/website.html') ; ?>
but all the commands are not loading after this statement. I want to include another webpage into my homepage directly. my homepage is completely designed in php, but the ...
I am trying to submit a form with HTML data in it to my server, but it appears to be stripping it out and I cant seem to figure out why.
If I do file_get_contents("php://input") I can see my content in the raw form:
action=submit&content=%3Cp%3EAnteater+Alumni%3A+Help+current+UCI+students+reach+their+goal+of+raising+%2...registration+f...
I am building a database of products and manufacturers. I already have the database layout done. I am looking for a simple CRUD class that will let me setup Manufacturers and Products and create the records quickly and easily. I have looked at ORM's but they all seem to be over kill for what I am looking for. Thanks
...
Hi
is there any way to tell Apache that it should restart the session and drop an existing http-auth?
I've a system where a user is first authenticated with http-auth against apache and afterwards authorized for services within the PHP-Application. Once the user logs out I'd prefer to also reset the existing http-auth somehow.
Any idea...
Hello,
Im sorting a list and using ajax to update a database. I need help parsing the string, this is the query string that i need to parse:
images_list[]=32&images_list[]=95&images_list[]=97&images_list[]=96&images_list[]=102&images_list[]=103&images_list[]=99&images_list[]=101&images_list[]=98&john=hi
I have put john=hi to test to ...
How do I prevent a user from logging in from 2 locations at the same time? A username and password can only be used by 1 person at the same time.
Please send me the code in PHP.
...
Is there a php.ini directive that enables stack traces on errors? I already looked here: http://php.net/manual/en/ini.core.php. My shared-hosting does not have Xdebug installed for some reason. I tried putting these in .htaccess:
php_value track_erors On
php_value report_zend_debug 1
but no stack trace.
...
I know that by implementing iterable you can make an object able to be foreached over. I'd like to take it further and make an object react like an array would in as many places as possible where an array is called for.
(The reason for this is because I'm selecting data from a database, and the statement object that results by default ...
I have added a .htaccess file to my root folder, and i wanted everything written after the / to be sent to the index.php file as get data.
My root path looks like this http://www.site.com/folder/ and my .htaccess is located in the folder directory together with index.php
This is my .htaccess file:
Options +FollowSymLinks
RewriteEngine...
I'm trying to install PEAR, but I'm confused by the locations suggested.
I'm using Wampserver to run my PHP scripts, and I wanted to do unit tests. So I found PEAR.
I tried installing via the go-pear.bat file, but that didn't work.
I found out more about this here: http://blog.pear.php.net/2009/07/01/php-53-windows-and-pear/
So I down...
I'm working on a fairly large PHP project written in a procedural style (it was written before PHP 5), and I can't help but feel that some of the things I'm doing are a little "hackish." A modification somewhere else can easily break the application. All the design patterns and best practices I've seen seem to only apply to OOP. I cou...
Oi!
I have wanted a returntosamepageafterlogin-feature on my site for a long time. But whats the best way?
I was thinking about saving the url into a session and when he/she logins, i check if the returnto-session if set, if it is, i redirect to that page
Is that safe/good?
...
I'm needing to make a web site, that should list all the files that are in the directory /Files(where / is the Apache public - htdocs), but excluding if there is any sub-directory. Also, they should have links for every file. Like this:
echo "<a href='Link to the file'>Test.doc</a>" . "\n"
How could I do it?
...