I'm making an online dictionary. Now I have two options:
1) Use AJAX for retrieving results
2) Just use some regular PHP scripts
If I choose the first option more likely the online dictionary will have one page and it's fast. If I choose the second option I'll have more pages (separate page for each entry with it's own URL), but it's s...
I have a script that i wrote, but it prints the first part of the array twice.
The output that i get is the following:
2009_06_09_02_07_57_Phase2_04.jpg
2009_06_09_02_07_33_Phase2_03.jpg
2009_06_09_02_07_57_Phase2_04.jpg
The code is below:
$currentPath = $path.'images/galleries/phase2/folder1/';
$dirNew = opendir($currentPat...
hi there,
I'm looking to retrieve the most recently published post in a wordpress system. I have some basic mysql understanding and I can find where the revisions are stored in the wp_posts table but what I can't seem to find is how to retrieve the permalink for the most recent post.
any ideas on how to retrieve the most recent post w...
Hi!
I am requesting a webservice to pull lat/lng coordinates by using country names from a php file using this code:
$defaultcountry = $_REQUEST['country'];
$daurl = "http://ws.geonames.org/search?q=".$defaultcountry.'&rows=5';
$contents = file_get_contents($daurl);
$xml = new SimpleXMLElement($contents);
$lat = $xml->geoname->lat;
$l...
Hi.
Im using mysql with PHP, I was just wondering if this query, $query = "UPDATE tblName SET field='$fieldValue' WHERE field2='$fieldValue2'" would cause an Out of Memory Error in mysql. Will this query, $query = "UPDATE tblName SET field='".$fieldValue."' WHERE field2='".$fieldValue2."'" consume less memory than the previous one?
Im ...
I'd like to be able to extract some array elements, assign each of them to a variable and then unset these elements in the array.
Let's say I have
$myarray = array ( "one" => "eins", "two" => "zwei" , "three" => "drei") ;
I want a function suck("one",$myarray)as a result the same as if I did manually:
$one = "eins" ;
unset($myarray...
I have a if function that works out how much of a users profile is completed however the way I include below was the best I could think of, however it seems really inefficient.
What is the better way to do this?
if($user['first_name']!==""&&$user['last_name']!==""&&$user['pemail']!==""&&$user['dob']!==""&&$user['ambitions']!==""&&$use...
I'm trying to come up with the best way to handle configuration in an application. At first i just used SimpleXML and put the code in a singleton.
I've decided to try to create a way to query the configuration with something like $config->getConfig('/module/name');
Do you have to use xpath to do this or is there any other method that ...
I'm looking to generate all possible values of n-digit number, in the following order, where the sequence is dictated by the sum of the individual digits.
For example, with n = 3:
111 sum = 3
112 sum = 4
121
211
122 sum = 5
212
221
113
131
311
114 sum = 6
141
411
:::
999 sum = 27
The order within the sum group is ...
I would like for my site when someone clicks "Back" or "Forward" for the server to tell the browser to load the cache instead of reloading the entire page. I've tested some headers and done research, but I can't seem to get this to function as intended.
Update:
The if-modified since header is not something I'd like to do. There's got ...
I am wondering what are the limitation of System-V message queue i.e. Maximum queue size, maximum size per item etc.
As I am working on integration of C++ with my PHP scripts and have very large amount of data which will be pushed into queue from php and C++ process will read that data on the other end.
I have devised an strategy in whi...
Hi i want to know that how the auto increment id can be get from the mysql db for two fields in a table
...
Does anyone know if recaptcha can be fully customize without the default frame. I need the recaptcha image to only be a certain width as well as the input field. Has anyone done this before with success.
...
I am looking at user/subscription management software such as aMember Pro. This uses folder protection methods to prevent access to areas of the site. As such the PHP scripts require Apache (linux/unix).
My webserver is IIS windows 2003 and I use a MySQL database to store user id and subscription status / access privileges. We really o...
Hi
what is the securest way to do a "stay logged in" feature?
i think thinking of user logs in store their userid, timestamp and a hash of timestamp + salt + hash of their pw in a cookie. then when they visit the site next, check if a hash of the cookie timestamp + salt + hash of their pw is valid
(ie... (untested, and ignore lack of m...
I have an action (view for example) in a controller that is called from multiple other actions in other controllers. How is the best way to create a "Back" button that will take me back to the page that got me here?
I've used named parameters like "back_controller" and "back_action" and that works fairly well but they get awkward when ...
I have a website where various parts parse request URLs by themselves and some don't (e.g. a vBulletin forum). The .htaccess I have to send requests to the appropriates scripts is:
# wiki, shop, admin
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !(.*)\.js
RewriteRule ^wiki/(.*)$...
I'm trying to extract the first src attribute of an image in a block of HTML text like this:
Lorem ipsum <img src="http://site.com/img.jpg" />consequat.
I have no problem creating the regex to match the src attribute, but how do I return the first matched src attribute, instead of replacing it?
From pouring over the PHP manual, it ...
Hi,
I am totally new to coding and i would need some help regarding this question of mine.
the question is that,
I have around 5 html pages.I am trying to walk the user through each phase and thats the reason i have diffent page for entering the info.Each html page has certain text fields.For ex
Page1:lastname,firstname,mi...
Page2:ad...
I am planning to make a project management with PHP/MySQL/Codeigniter.
It will have 10 - 20 users and 20 - 30 projects going on at the same time.
Let's say John is a member of project A, B and C. Cindy is in A, D, F G etc.
I want to make it only members of project can access the project.
Now I am not sure how to approach this.
Wha...