|
Well, it's so general.
What's your problem exactly ?
|
|
|
|
|
well i have got a folder of php files which was used to build a website, how can i run this application on my machine. like running in debug mode using .net framework.
everytime i try to run this app it request for athe dreamweaver sites but php doesnt run in dreamweaver.
by running i mean opening a php page eg index.php in dreamweaver and the F12 in dreamweaver.
is this how im supposed to do it.
|
|
|
|
|
Notepad, or Textpad is pretty good. I don't know of any IDE to edit php files like dreamweaver.
|
|
|
|
|
|
You need to set up your computers local server to parse php files you can either install php on iis or install it on apache (try googling "xampp").
With xampp:
- install xampp and make sure apache is running
- put website in htdocs folder (ie. c://xampp/htdocs/[websitefoldername]).
"htdocs" folder is your web doc root (like "wwwroot")
- run dreamweaver
- choose "manage sites" from the file panel
- click "New"
- "advanced" tab
- give site name and enter the path to your website as local root folder (ie. c://xampp/htdocs/[websitefoldername])
- category -> testing server
- sever model = php mysql
- access = local network
- testing server folder = the path to your website as local root folder (ie. c://xampp/htdocs/[websitefoldername])
- url prefix = http://localhost/[websitefoldername]
- open a file and press F12
Hope that helps
|
|
|
|
|
thanks fro the reply
i still cant run the app after installing php on iss.
the sites are working fine in dreamweaver but on f12 or http://localhost/mytest/index.php the pages keeps opening in dreamweaver.
but http://localhost/mytest/index.asp ie an asp page works fine even from dreamweaver
Regards
|
|
|
|
|
Either your site manager isn't configured correctly in DW or your Server setup isnt parsing php files.
If you put a blank php doc in your wwwroot it should load up as a blank webpage if you open your browser and go to localhost/pathtoyourphpfile.php. If it doesn't then you know your server isn't parsing the files.
If your site doesn't have to be tested on IIS then I would suggest trying apache (xampp) as described before.
|
|
|
|
|
thanks
on installing php which iis should i use, there are two of them appearing
regards
|
|
|
|
|
|
if you do use apache. you have to disable all IIS services. (start->run->services.msc)
|
|
|
|
|
i still cant run the app after installing php on iss.
the sites are working fine in dreamweaver but on f12 or http://localhost/mytest/index.php the pages keeps opening in dreamweaver.
but http://localhost/mytest/index.asp ie an asp page works fine even from dreamweaver
Regards
|
|
|
|
|
If you want to run PHP under IIS, IIS-Aid website[^] has a handy installer
I prefer running PHP under IIS if you're developing on a Windows box. You also have to go into the IIS Management Console and turn on scripting for the folders under your wwwroot that you want to run PHP scripts in.
There's a handy getting started tutorial in the PHP documentation [^]as well, also it tells you how to manually install PHP.
|
|
|
|
|
i dont know why it is so difficult to install this PHP or im dumb
I have been trying to setup/install php on an XP pc with IIS but without success.
here are a few questions i have;
on webserver set which IIS should i choose(there is IIS ASApi Module, IIS Fast CGI and IIS CGI)
and in IIS what should i specify as my local path under homedirectory tab.
or if someone has got all the steps i need to do this that will be greetly appreciated
|
|
|
|
|
|
Hello all,
In our IT department two of my coworkers have developed a new web page for our company... in PHP 5 it works like charm but in PHP 4 it seems that it doesn't work...
The main problem they have found is that a variable declared in a file that gets included is not working as in PHP 5...
How would you make a global variable in PHP 4?
It must be capable to work across multiple files and across different PHP snippets.
Thank you in advance...
PS:
I hope the question is clear enough, I'm not doing that PHP work and they are not into CP so I thought to ask it here... I have always received good comments...
|
|
|
|
|
Joan Murt wrote: How would you make a global variable in PHP 4?
As far as I know , there isn't a difference between PHP4 & PHP5 in define a global variable !
Just define them outside of a function or if you use OOP PHP, define them in Public .
|
|
|
|
|
If you want to use a varible thats declared outside of a function, from within the function you will need to declare it in the function. For example, with the following code:
$var = "asdf";
function printVar1(){
echo $var;
}
function printVar2(){
global $var;
echo $var;
}
Joe Ceresini
Network Engineer
jceresini@hostmysite.com
Hostmysite.com
|
|
|
|
|
i am doing
$sth = $dbh->prepare("insert into loginout values ($ref->{'CARD_ID'}, '$name' , now(), NULL");
but keep getting the following error.
DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at ./iothread.pl line 92, <gen1> line 1.
Client 10.168.1.2:3720 says: 11111::1100::login
please help me
|
|
|
|
|
You may want to try printing out the value of
"insert into loginout values ($ref->{'CARD_ID'}, '$name' , now(), NULL"
to see make sure the variables are set properly and that $ref->{'CARD_ID'} is not null, and not a string. Also check that $name does not contain any single quotes in it as that will screw up the query, unless you escaped the variable first. Finally the end of the values does not have a ending parenthesis. It should be:
"insert into loginout values ($ref->{'CARD_ID'}, '$name' , now(), NULL)"
Joe Ceresini
Network Engineer
jceresini@hostmysite.com
Hostmysite.com
|
|
|
|
|
Parinay Bansal wrote: $sth = $dbh->prepare("insert into loginout values ($ref->{'CARD_ID'}, '$name' , now(), NULL");
It is missing a closing paren. Could be something else wrong too.
As a note in my experience it has been considered a best practice to explicitly name fields. The advantage to that is that it allows the database itself to be changed without impacting code.
So rather than
insert into mytable values(x,y)
use
insert into mytable(col1, col2) values(x,y)
|
|
|
|
|
hi
i am getting error as:
Use of uninitialized value in concatenation (.) or string at ./iothread.pl line 86, <gen1> line 1.
during runtime
and
the output looks like this:
Multiplex server running on port 4444...
Created thread 1 for new client 10.168.1.2:3233
Use of uninitialized value $_ in scalar chomp at ./iothread.pl line 66, <gen1> line 1.
1005874632400418
1234
login
Use of uninitialized value in concatenation (.) or string at ./iothread.pl line 86, <gen1> line 1.
10895
Thread 1 terminated abnormally: Not a CODE reference at ./iothread.pl line 87, <gen1> line 1.
#!/usr/bin/perl
# iothreadserv.pl
use warnings;
use strict;
use integer;
BEGIN
{
use Config;
die "No thread support!\n" unless $Config{'usethreads'};
}
use Thread;
use IO::Socket;
use DBI;
use DBD::mysql;
# Autoflushing on
$| = 1;
my $port = 4444;
my $server = IO::Socket->new(
Domain => PF_INET,
Proto => 'tcp',
LocalPort => $port,
Listen => SOMAXCONN,
Reuse => 1,
);
die "Bind failed: $!\n" unless $server;
print "Multiplex server running on port $port...\n";
while (my $connection = $server->accept)
{
my $name = $connection->peerhost;
my $port = $connection->peerport;
my $thread = new Thread(\&connection, $connection, $name, $port);
print "Created thread ",$thread->tid," for new client $name:$port\n";
$thread->detach;
}
exit;
# child thread - handle connection
sub connection
{
my ($connection, $name, $port) = @_;
$connection->autoflush(1);
#############################my sql connect###############################
my $platform = "mysql";
my $database = "project";
#my $host = "localhost";
#my $port = "3306";
my $user = "root";
my $pw = "";
# DATA SOURCE NAME
my $dsn = "dbi:mysql:$database";
# PERL DBI CONNECT
my $dbh = DBI->connect($dsn, $user, $pw) or die "cannot connect to database";
#######################################################################33
print $connection "You're connected to the server!\n";
my $client = <$connection>;
chomp; # ($client);
#while (<$connection>) {
if ($client =~ /::login/)
{
print $connection "Login Initiated\n";
my $rand = int(rand(100000));
print $connection "Your rand number : $rand";
#$client =~ s/([\$\@\\])/\\$1/mg; ##escape all $, @ and \
#$client = quotemeta $client;
my @recv_string = split /::/ , $client;
foreach (@recv_string)
{
print "$_ \n";
}
#next line injection possible !! REMOVE IT!!
my $sth = $dbh->prepare("select * from Temp_ID where TEMP_NO = $recv_string[0]");
$sth->execute();
#take only one output row
my $ref = $sth->fetchrow_hashref();
# $sth->finish();
print "$ref->{'Temp_ID'} $ref->{'CARD_ID'}\n";
$sth = $dbh->("select PIN from Cards where Card_ID = $ref->{CARD_ID}");
$sth->execute();
# $sth->finish();
my $ref2 = $sth->fetchrow_hashref();
if ($recv_string[1] eq $ref2->{PIN})
{
print $connection "PIN verified OK";
}
}
if ($client =~ /:logout/)
{
print $connection "You are being Logged OUT\n";
}
print "Client $name:$port says: $client \n";
print $connection "Message received OK\n";
# }
$dbh->disconnect;
$connection->shutdown(SHUT_RDWR);
}
|
|
|
|
|
|
Is this still open? It was posted a while ago.
If so, to get started, what are some of the other data points?
1. does "You're connected ...\n"; print?
2. have you tried to insert a print statement before the chomp to see what is in $_;
3. have you tried to put something in $_ to see if the error is suppressed.
4. is there anything in $ref before the print of its fields?
5. does a visual inspection of the MySQL database with your database admin tools show that row should exist?
6. what about some logic to catch this before it croaks?
5. have you tried the Perl debugger with -d on the script. As you know it has watch and break features. If it is web app you may still get enough from running it in console mode.
dpminusa
"Coding for fun and profit ... mostly fun"
|
|
|
|
|
Hi Friends,
I just saw a company from India, www.shrishtionline.com They can offer complete web solution to all.
Shrishti Informatics is a Professional Outsource Website Design & Development company based in
Cochin, India. They are experts in website design, dynamic web solutions, Multimedia and
Graphics Design, Search Engine Optimization ,offshore staffing and offshore outsourcing .
Also does customization of open source technologies such as osCommerce, Joomla, phpBB,CRE Loaded,
phpFoX, WordPress etc.make use of this great time and create your personal and business site now.
Will post more valuable news latter. Really would like to know your thoughts regarding this company.
Regards,
Mechele peters.
|
|
|
|
|
Fuck off, No one cares about your shit site.
|
|
|
|