scratching my head over this.
i have 350 strings average 90 chars long, all strings are unique.
Now, i wanna generate a unique id for each string.
i tried the sum of chars in the string wich gave two doubles, the returned sum
is not unique enough. Anybody any idea how to approach this? I thought of hash(), is that the best solution?
a...
hey guys,
i'm setting a path variable with a query-string.
what's the easiest way to check if the path (always a directory) exists or not.
if(isset($_GET['p'])) {
define(PATH, $_GET['p']);
so now i have like mydomain.com?p=files/folder/sub and everything works fine, i'm reading the contents of the folder.
however i can pass al...
I am using PHP 5.2. If I new an object at one page, when will this object be destructed? Is the object destructed automatic at the time that user go to another .php page or I need to call __destructor explicitly?
...
Hi I need to use the nested set model to mange product categories on my site. Does anyoune know of some good pre-built PHP libraries for handling nested sets in MySQL?
...
Hi All,
Having probs here.
I need to write the output of a PHP script to an HTML page to then be processed by DOMPDF so I can make a nice little PDF for some friends to use.
When I use file_get_contents to get the contents of a "donor" PHP script, it does that - literally. It grabs the unevaluated PHP and holds it for me to do as I w...
I'm trying to post a message to a user's wall using the new graph API and PHP. Connection seems to work fine, but no post appears. I'm not sure how to set up the posting code correctly. Please help me out. Sorry for the broken-looking code, for some reason StackOverflow didn't want to close it all in the code block.
Below is my full cod...
In my database I have over 600 users. The passwords were previously stored as plain text (slap on hand, I know). Anyways, I have changed my code to store STA1 hashed passwords, but I need to convert the existing passwords in my database so each user doesn't need to go in and modify their account.
Any help?
...
I'm trying to exract phone numbers from a set of data. It has to be able to extract international and local numbers from each country.
The rules I've laid out for it are:
1. Look for the international symbol, indicating it's an international dialing number with a valid extension(from +1 to +999).
2. If the plus symbol is present, make ...
hey guys,
i know it's not the best way of doing this but the whole thing is just a little project which doesn't need anything more difficult.
i'm passing directory names along with my url like domain.com?p=folder/subfolder/etc
i'm looking for the best way to check if the dir exists and i want to (at least) kind of prevent people from ...
Hi. I'm building my first WordPress Theme and I'm stuck on something.
I have a function in my functions.php called get_first_photo() which grabs the first image uploaded on each post and puts it on the blog archive page. It's working fine, but it loads the full-sized image and resizes it using CSS. I would rather it load the image at i...
I'm working on a project where I need to replace text urls anywhere from domain.com to www.domain.com to http(s)://www.domain.com and e-mail addresses to the proper html <a> tag. I was using a great solution in the past, but it used the now depreciated eregi_replace function. On top of that, the regular expression used for such function ...
Hi Guys,
What is the best way to search for a word in a string
preg_match("/word/",$string)
stripos("word",$string)
Or is there a better way
...
I am trying to communicate with a web service that is developed by .NET, and I am writing my client in PHP. One of the headache right now, is generating the SignatureValue and for SignedInfo.
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www....
Hi all,
I have a mysql question :
using php with mysql I actually have a schema that looks like this :
3 tables :
module
module_has_theme (pivot table)
theme
The idea behind this is to display the modules of my application using themes if they have,
and if they don't, then display them in an extra category (other).
So let's say if...
Sorry if a question like this was posted before, i searched but couldnt find anything.
I just finished college and im unemployed however im taking a year out to improve and become confident in my programming. My goal is to have a job by June of next year. I've learnt OOP with Java in college and im just starting to learn PHP with OOP. T...
OK, so I have this undefined index error occurring when I'm defining some variables to be used in a email contact form in PHP.
Here is my script (email address omitted for privacy sake:
<?php
$to = "[email protected]";
$subject = "Aquadual Contact Form Message";
$email = $_REQUEST['email'];
$message = $_REQUEST['message'];
ma...
I was wondering if when using the database library in Codeigniter there was a way to automatically escape all the inputs to prevent injection. I know I can use mysql_real_escape_string() to do it, but I wondered it this was already setup to do this automatically, if not are there any frameworks that have this included?
Thanks!
...
So my site's main page display's applications for a PMP. Users can rate these apps with 'Like', 'Dislike', or 'Neutral/None' (every app is rated Neutral/None by default.)
On the main page I wanted to list the games by the highest difference (So it would take the total Like's and Dislike's then add them together.) I'm having difficulty m...
Hi,
I can't quite figure it out, I'm looking for some regex that will add an atttribute to a html tag.
For example lets say I have a string with an <a> in it, and that <a> needs an attribute added to it, so <a> get's added style="xxxx:yyyy;" . How would you go about doing this?
Ideally it would add any attribute to any tag.
Am I aski...
Hi there,
Simple question really, I've been looking all over the Internet probably for the past few days for several hours a day looking for some solid information on OpenID and Facebook Connect integration on a website.
I have seen the same names popup such as Janrain offering their solution, but I see a lot of websites such as Invisi...