|
it sounds like you want to convert the php scripts to an executable. Besides doing a lot of coding by hand, I can only think of one application that may help you and it is called "hip hop". It is used by facebook to covert their php scripts to compiled executables to improve the performance. I am not sure how the cacti license is set up so your on you own there.
http://developers.facebook.com/blog/post/358[^]
|
|
|
|
|
when i run:sudo make
the console write ouput :
compiling FrameworkTest.cpp
In file included from /usr/include/c++/4.4/memory:53,
from tests/Fit/FrameworkTest.cpp:15:
/usr/include/c++/4.4/bits/stl_tempbuf.h: In function ‘std::pair<_Tp*, int> std::get_temporary_buffer(ptrdiff_t)’:
/usr/include/c++/4.4/bits/stl_tempbuf.h:95: error: ‘operator new("/usr/include/c++/4.4/bits/stl_tempbuf.h", 94)’ cannot be used as a function
can you tell me why? thank you
|
|
|
|
|
Please Give us stl_tempbuf.h
|
|
|
|
|
Why apache tomcat creates problem in windows 7 while working.its tomcat 6.0.26. i have tried on several systems but on every system having os as windows 7,it creates problem.
Actually ir starts working at that time but when we restart pc then its working stop and we need to reinstall it to work on.
Can anyone elaborate this reason?
|
|
|
|
|
this beacause apache company didnt devlop the version which support windows7 yet
|
|
|
|
|
|
Posted Today, 12:07 AM
Hi All
Thanks in advance for the help, I have the PHP code below to read contents of the file.
//The code does not work, it returns the output below
" outputResource id #3
Quote
Warning: Invalid argument supplied for foreach() in C:\XAMPP\htdocs\kampcoordinators\test.php on line 10"
|
|
|
|
|
Its how you are handling the variable $output.
1st you assign it a file resource returned from the fopen function.
2nd you use a str_replace on said file resource, not sure why it does not barf here.
3rd the foreach loop requires and array as the first value.
... try replacing the fopen() with file_get_contents() as it will return the entire file contents as a string. Then uncomment the explode which will take the string and replace it with an array. That should allow the foreach to work.
always remember to find out what the return type of a function call is before you use it.
|
|
|
|
|
$output should turn into an array after the explode() right? i think something else is wrong.
|
|
|
|
|
the php function defines for reference.
--------- fopen function....
resource fopen ( string $filename , string $mode [, bool $use_include_path = false [, resource $context ]] )
--------- explode function....
array explode ( string $delimiter , string $string [, int $limit ] )
--------- foreach looping construct....
foreach (array_expression as $value)
statement
foreach (array_expression as $key => $value)
statement
now step through his code....
$output=fopen("testfile.txt","r") or exit("Unable to open file!"); <--- $output is a file resource, this is not the file content.
$output = str_replace(","," ", $output); <--- he takes the $output which is a file resource and does a string replace on it and re-assigns the variable $output as a string.
echo "output"; <--- echos a string called "output"
echo $output; <--- echoes a variable currently a string and most likely just the name of the file resource returned from the fopen call.
foreach($output as $var) <--- in a foreach the first argument MUST be an array!, it is a string right now and so reports an error.
{
echo " ";
echo"display each value as array ";
echo $var;
}
...again more function definitions.
string file_get_contents ( string $filename [, bool $use_include_path = false [, resource $context [, int $offset = -1 [, int $maxlen = -1 ]]]] )
if he writes his code like this.....
$output = file_get_contents('path/to/file.txt'); //<--- Reads entire file into a string, so $output is a string and contains the files content.
$output = explode(",",$output); //<-- Split $output by "," and returns an array, $output is an array.
// these are moved outside of foreach loop so they do not repeat with each pass.
echo " ";
echo "display each value as array";
foreach($output as $fragment)
{
echo $fragment."<br>"; // this will print each "fragment" of the variable array $output.
// <br> is for browser output, change to \n for consol output.
}
----------------- BTW
if he wants to read each and every character then his original code will never work unless the contents of his source file contains a comma between each character.
If it is just text then he could just load the file contents using the file_get_contents() then use strlen to get the total character count of the contents and then he can use a for to walk through each character of the file contents. like this....
$output = file_get_contents('path/to/file.txt');
$cnt = strlen($output);
for$i=0;$i<$cnt;$i++)
{
echo $output[$i]." ";
}
|
|
|
|
|
I see, it was a resource indeed. I think he also tried to replace the spaces with a comma but did it the other way around. The comma (if there was any) was replaced by spaces then he used explode with comma as a delimiter.
|
|
|
|
|
it may indeed be what you suggest with the commas, but at any rate even if he did it that way he would end up with words being split and not the characters.
One of the nice things with strings in php is you can treat them as an array and just step through them.
|
|
|
|
|
I think this is what happened. You misused the str_replace() function. If you will check the documentation for it. What you actually did was find an occurrence of "," and replace it with " " and then you searched for "," on your explode(). The character no longer exists by then. Try interchanging the first two arguments of your str_replace(). I think that should do.
|
|
|
|
|
|
How can i develop login and registration system using php???
|
|
|
|
|
Check out this link for some samples and don't multi-post...
Samples[^]
Apart from these links, start from the basics, that will help you a lot...
Cheers,
Karthik
modified on Monday, October 11, 2010 9:13 PM
|
|
|
|
|
Hi i am a very new on this line and i want to stay on this line, I mean to say I want to be a web developer. Okay, Now i want to know how can execute or develop a login and registration system using php code. Any one here who wants to help me????????
|
|
|
|
|
|
First of all where do you want to store your login information? Websites over the internet obviously use a database but you can actually store it in a file if it will be a really simple login. Storing and retrieving information from those storages differ. Also, where are you running your PHP scripts? Do you use XAMPP, WAMPP, etc.? They could be helpful if you're planning to do the "database" approach.
|
|
|
|
|
I am confusing about writing CGI script in .NEt project.
My localhost is configured properly and am able to run web application successfully.
Can any one suggest how can I run script through web?
Is there any IIS settings need to set manually?
Thanks,
|
|
|
|
|
There are three parts.
1. Create a perl script that correctly and safely implements CGI.
2. Configure IIS to run perl
3. Configure IIS to accept 2 as a CGI source.
2/3 should be answered by the following link.
http://support.microsoft.com/kb/245225[^]
The first can be discovered by research.
However there is at least on Perl book devoted solely to CGI from O'Reilly. And it is covered in other Perl O'Reilly books as well.
|
|
|
|
|
Yes it done now...
Very helpfull...
Thanks jschell
|
|
|
|
|
now i got 1 massive script and i hope u can just point to me what it is i should be looking for. i need a form for visitors to upload image (if more than 1, the script can make it in a thumbnail) and also the form also have fields for the user to put a description on it. when they uploaded the images and text, it must and can be viewed openly by other visitors. here is a sample web that im trying to copy
http://www2.mudah.my/ai/form/0?ca=13_s
as u can see, when a person uploaded their ads there, others can search their upload using its search engine (the serch engine i got from youtube and the web dont display images) and when a person click on a certain ads, it will be shown in a single page for example
http://www.mudah.my/2005+Toyota+Wish+2+0L-7295889.htm
and search engine should look like this
http://www.mudah.my/Sarawak/for-sale
those are just a sample what im trying to do.
ofc im not asking for u to write a script or do tutorials on this (tho doin so is apreciated :P )
i just need to know the "terms" of the script tat i should be researching, names' etc.
thx
|
|
|
|
|
Word-for-word identical to Q&A here
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
How i can add template to php page ?
|
|
|
|