|
Thank you everyone for all your replies. I have no updates on the issue as I do not have time to pursue this project any longer.
See ya,
Antone
|
|
|
|
|
hi, am building a simple social network, but how can i make each user view only his personal profile, friends in his network, share photos with his netwok without creating for each user his private page. as this will be wastage of computer resources and make the machine slow.
could anybody have some examples on this or know a link to tutorials that can help in this..thank u for your response in advance..
|
|
|
|
|
Check out a piece of software called dolphin, it's the best open source php based social networking software I can think of off the top of my head.
|
|
|
|
|
Use a database such as MySQL.
Steps:
1- Create a input page where they can add info and change profile styles etc.
2- Create the profile page and use posted variables to update the content
i.e.: profile.php?id=1001
and retrieve the info from the database for that user and print it in the profile page.
(So you've made 2 dynamic web pages and 1 database table)
Do the same process for the other pages.
|
|
|
|
|
I have to code php for a public service announcement that :
It is simply a form that has a place to enter your name and announcement. When you click the submit button, the application takes the form data and appends it to a text file. Each time you view the form page, before it presents the form it displays the contents of the file you were saving the data to. I am a beginner and in a hurry.
|
|
|
|
|
|
I'll second fly 904 - good resources.
|
|
|
|
|
Hi everyone,
I'm relatively new to PHP and am experiencing a problem trying to loop through multiple arrays whilst comparing strings during each iteration of the loop.
What I have is two arrays; one with a list of illegal file names and one with a list of filenames pulled from a scandir function. Although it doesnt work this is what im trying to do:
$illegalArray = array(".php", ".html", ".sql");
$filesArray = array("general", "connect.php, "_sql", "test.sql");
foreach ($filesArray AS $f) // Loop through the file names array
{
foreach (illegalFiles AS $i) // Loop through the illegal file names array
{
if (strstr($f, $i) // Check to see if the the string held in $f contains any of the text held in $i
print "illegal file";
else
print "valid file";
}
}
Hopefully that kind of makes sense. Basically I want to loop through the files array, check to see if the file name contains the string held in the illegal array. If it does then do something, if it doesnt, do something else.
I can get it working to the point where it outputs a list of the files that it shouldnt include (the illegal files) but I cant get it to output a list of files that it should include (from the $filesArray these would be the "general" and "_sql" file names).
If anyone can shed any light on what I am doing wrong here I would be eternally grateful.
Thanks for reading (sorry about the length)
Bryant
|
|
|
|
|
What you had was fine, up until the point where you output the file each time it passed a validation check in the other array. eg. 'general' would output 'valid file' 3 times and 'connect.php' would output 'illegal file' once and then 'valid file' twice.
What you should wait for is for all the checks to be done before outputing a result. The following snippet should work fine.
$illegalArray = array(".php", ".html", ".sql");
$filesArray = array("general", "connect.php", "_sql", "test.sql");
foreach ($filesArray as $file)
{
$is_safe = true;
foreach ($illegalArray as $illegal)
{
if(strstr($file, $illegal))
$is_safe = false;
}
if ($is_safe)
{
echo 'Valid File ('.$file.')<br />';
}
else
{
echo 'Illegal File ('.$file.')<br />';
}
}
Outputs:
Valid File (general)
Illegal File (connect.php)
Valid File (_sql)
Illegal File (test.sql)
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Fly you're a legend. Thank you very very much for that, that has bugged me for almost 2 days (believe it or not).
The beers are on me
|
|
|
|
|
send me the code to insert the data in mysql through php form
|
|
|
|
|
|
from where can i get php projects for beginning level/??
plz send me waqarnaeem2@hotmail.com
|
|
|
|
|
Have you heard of Google[^]?
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
what is joomla?pearl?
how are these different from PHP??
what is iphone developer?
what is sharepoint developer
|
|
|
|
|
|
Hi,
In my project there is singleton pattern used in php 4.4.4 and also Smarty used to display pages. Now we want to convert php 4.4.4 to 5.2.0 or above.
There is error occurred in singleton pattern like below.
"Non-static method" PaDbConnection::getInstance() should not be called statically in config.inc.php on line 177.
In config.php line no 177 is like below.
$db =& PaDbConnection::getInstance();
So I need help that how to modify the singleton class related to php5.2.0. anyone help me.
modified on Friday, July 3, 2009 12:22 AM
|
|
|
|
|
Go to php.net and check the release notes for all version of php between 4.4.4 and 5.2.0. In there you will find all the commands that have changed - and thus you should be able to find and fix your error. You should also get an error message that tells you what line is causing the error. that may help you in finding deprecated and removed commands.
|
|
|
|
|
Hi,
I am very new to PHP .
can any ne tell me how to strat and what to download for PHP and where to write php code?
Help me!!
|
|
|
|
|
|
1) First get a php & apache server running on your development machine like xampp[^]
2) Choose an editor. You can use notepad (if your using windows) but it doesn't colour the code for you, so it's hard to read. Good free alternatives are notepad++[^] and aptana studio[^]. If you don't mind parting with a bit of cash, Dreamweaver[^] is the don.
Then go through some tutorials like:
http://www.w3schools.com/[^]
http://www.tizag.com/phpT/[^]
modified on Wednesday, July 1, 2009 6:20 AM
|
|
|
|
|
Refer below sites. It will very useful for understanding and learning about PHP.
http://www.tizag.com/phpT/
http://www.w3schools.com/php/default.asp
|
|
|
|
|
In addition to other replies you can also download
WAMP server for PHP. It is bundled with Apache MySQL ... just like XAMPP.
for IDE you can search in google for eclipse PDT. Currently i am using it and its good.
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
Hi all,
I'm looking for some direction in how to approach this problem.
$arr = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20);
I need to create a second array using the values in the first array in a random order, without repeating or omitting any of the values, except one of them.
I'm having such a hard time with this next part, and I even struggle to explain it. So please clarify as needed.
I need to fill the second array with a random combination of the first array, with one value repeated. But the value that is repeated has to be randomly selected from the first five positions of the new array, and it has to be placed randomly into one of the last five positions of the new array.
so assuming that the first five values of the randomly generated array are:
3, 7, 8, 19, 14
I would need to continue randomly filling the 2nd array with values from the first array ($arr, above) until I fill position 15 (the 16th value). Then positions 16-20 (17th through 21st values) need to have the 4 remaining numbers and one of the numbers from the first five spots (3, 7, 8, 19, or 14 in this example).
So that the final array would look something like this
$arr2 = array(
0 => 3,
1 => 7,
2 => 8,
3 => 19,
*4 => 14,
5 => 1, 6=>2, 7=>4, 8=>20, 9=>18, 10=>16, 11=>15, 12=>12, 13=>11, 14=>6, 15=>10,
16 => 17,
17 => 5,
*18 => 14,
19 => 9,
20 => 13);
I've indicated the repeated number with an asterisk and have used position => value nomenclature hoping for clarity.
In this case the value in position 4 is repeated in position 18.
I need this part randomly figured out during each iteration in addition to randomly filling all the original values contained in the first array. So the example above would be only one possible outcome.
Thanks in advance for any guidance you can provide. Please let me know if what I'm asking is not clear and I will try to clarify as needed.
Cheers,
Chris
|
|
|
|
|
Hi,
here is a hint: if you have a collection of numbers and need all or some of them, without duplication, then the easy way is: use a random number generator to get a random number in the range [zero, collectionLength-1]; then pick the number at that index location AND remove it from the collection. Repeat as often as required.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|