[PHP] Re: Please Help with simple Noob problem (Problem Solved)
Scott Bounds wrote: Hello all. I seem to be having a terrible tim ewith something that is so simple it makes me sick. I have a server running FC2. it has Apache 2.x.x on it and it came installed with php-4.x.x. Sorry I don't have the exact versions but fatigue and frustration has taken over. I can get them if you really need them. Here's the major problem. When I try and view a simple php page in the browser, it doesn't display anything that has to do with the php tags. By that I mean it won't recognize the php directives (I guess). I made a simple page (the infamous phpinfo () page) right out of the books. Saved it as test.php just like it said. Made sure that apache is running and browsed to the page. Nothing, no errors, no nothing. I have made up some other pages (mostly from some php books - real simple ones) to view and they all display the same action. Now when these machines (I actually have a couple of these servers and they all act the same) were installed, it was from FC2 CD's with the webserver full package. There were all kinds of php files installed, etc. In my httpd.conf file it calls the php.ini file, etc. So it seems to be all there. Can anyone out there help me figure out how to make this work? I would be truly indebted to you, put you on my Christmas card list, etc. Thanks in advance to all of you kind and wonderful people. Scott Thanks everyone for your help. I got a reply from Janet who informed me that I couldn't access the page from File/Open/test.php. I actually had to do the http://localhost/test.php for the browser to present the php. it presented correctly then. I am sorry, but I am a noob here. Thanks for all of your wonderful help. I apologize for not being more experienced. I should have known this. But there is a bright spot: I won't ever forget this point! Thanks again! Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: please help me I try to post my question to Php.net 2-3 times
[EMAIL PROTECTED] wrote: text file problem read text file to array string. I use function File(). but when I display data in text file it compress space in each lines such as first record contain "1_2__3__4__" ( _ = blank ) when store in array string is "1 2 3 4" . I want you tell me howto do? + // data in text file is "1_2_3_4" < _ = blank> // output is "1 2 3 4" // I want fixed possition . please help me ? from Wvolks is it just "whitespace" or are there also commands in it like \t or \r ? Otherwise just replace the whitespace with "" like $filename = "c:data.txt"; str_replace(" ", "", $contents); echo $contents; Something like that? -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PLEASE HELP ON MAIL FUNCTION
* Thus wrote Manuel Lemos: > Hello, > > On 11/01/2004 03:58 AM, Kunal Aggarwal wrote: > >I am using PHP 4.3.4 version. > >Please tell how to unpload a mail function. > >Error comes on executing mail function is > > > >"mail(): SMTP server response: 550 5.7.1 Unable to relay for > >[EMAIL PROTECTED] in C:\Program Files\Apache > >Group\Apache2\htdocs\testprodigious\MAIL\mail_enquiry.php on line 30 > >" > > This means that your SMTP server is requiring authentication to relay > messages. or - the server your connecting to requires you to be on the same network. - have the envelope address set properly - configure the exhange server properly: http://support.microsoft.com/default.aspx?kbid=289553&product=exch2k > [clip] > Curt -- Quoth the Raven, "Nevermore." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PLEASE HELP ON MAIL FUNCTION
http://www.phpclasses.org/mimemessage Or you can try is, which is one of the best mailer class: http://phpmailer.sourceforge.net/ Felho -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PLEASE HELP ON MAIL FUNCTION
Hello, On 11/01/2004 03:58 AM, Kunal Aggarwal wrote: I am using PHP 4.3.4 version. Please tell how to unpload a mail function. Error comes on executing mail function is "mail(): SMTP server response: 550 5.7.1 Unable to relay for [EMAIL PROTECTED] in C:\Program Files\Apache Group\Apache2\htdocs\testprodigious\MAIL\mail_enquiry.php on line 30 " This means that your SMTP server is requiring authentication to relay messages. The mail function does not support authentication. You may want to try this class that comes with wrapper function named smtp_mail(). It emulates the mail() function except that it lets you relay messages on a server authenticating with a user name and password that you can provide: http://www.phpclasses.org/mimemessage You also need these two classes: http://www.phpclasses.org/smtpclass http://www.phpclasses.org/sasl -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Please Help, returning path
On Fri, 18 Jun 2004 05:46:12 -0300, Manuel Lemos <[EMAIL PROTECTED]> wrote: > > On 06/18/2004 05:40 AM, Me2resh wrote: > > is there a function to detect the path of the directory > > i need my file to detect the path it is on it, not the http path but the > > path on server > > please help me with that > > getcwd() or dirname($_SELF); or to get the path of the actual file rather than the script: dirname(__FILE__); -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please Help, returning path
Hello, On 06/18/2004 05:40 AM, Me2resh wrote: is there a function to detect the path of the directory i need my file to detect the path it is on it, not the http path but the path on server please help me with that getcwd() or dirname($_SELF); -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please help me retrieving data from a PHP file!!???
> How to retrieve data from a PHP file? (The value that will > be retrieved of course it is echoed in the PHP file, and it > will be shown in a TextBox in my VB program.. so I want to > retrieve it to my EXE VB program that will put it inside a > TextBox or something like that..) From within a PHP file, you may use exec() or passthru() to execute an external program and return the results to the PHP script. Seems to me like VB should have something similar to execute a PHP script (perhaps through HTTP or something). At any rate, I think you would probably need to ask this question on a VB mailing list, since they may be able to help you better. If your PHP script just echos something, then you'll need to find out what VB function there is to execute the PHP script and grab the value that is echoed. -Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please help me with these questions..
An excellent resource for all these questions is the documentation found at http://www.php.net/docs.php. Below, I've provided some links to the specfic docs for each question. 1- MD5 with PHP values. http://www.php.net/md5 2- Random values in PHP. http://www.php.net/manual/en/function.rand.php 3- Inserting values to mySQL DB by PHP and importing from them also to send echo. (For example : after MD 5some strings in PHP I want to insert them into the database also then to echo these MD5 strings). http://www.php.net/manual/en/ref.mysql.php 4- How to echo something. http://www.php.net/manual/en/function.echo.php 5- How to make some GET values like : http://www.mysitename.com/test.php?username=abc then insert them to the database. http://www.php.net/manual/en/language.variables.predefined.php http://www.php.net/manual/en/reserved.variables.php#reserved.variables.get http://www.php.net/manual/en/language.variables.external.php Hope that helps! -Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please help with mail function
Hello Rolf, On 9 Jan 2004 at 0:51, Rolf Berkenbosch wrote: > I have a big problem with the mail function in a php script. > If I run this script with root access, the mail function is working. > If I try to run it like http://www.i-s-u.nl/test.php it won't work. > What is happening, what can I do??? The link you supplied is useless, because of course all PHP code is processed at the server and nothing reachers the browser. It's difficult to say what could be going wrong without knowing more about your server setup. My suggestion is that you try using a good socket-based mailing script to circumvent your web server's sendmail shortcomings. You'll find an excellent (free) socket-based mailing script at http://www.phpguru.org/mime.mail.html . Good luck, Erik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Please help!!! thx a lot~~~
Do you mean you cannot access the filesystem on your own server? You can find out if /something is a directory by connecting to the web server and request the file/directory without a trailing slash. If it is a directory server will respond with "301 Moved Permanently" response. $is_dir=false; $sock=fsockopen('server', 80); fputs($sock,"GET /something\r\n\r\n"); while (!feof($fp)) { if(strpos(fgets($fp,128),"301 Moved Permanently")) $is_dir=true; } fclose ($fp); Joe wrote: HTTP my department disable the function of listing file "Marek Kilimajer" <[EMAIL PROTECTED]> ???:[EMAIL PROTECTED] What is remote in your circumstances? FTP, HTTP, ... ? Joe wrote: any alternative method is also welcome "Joe" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D :[EMAIL PROTECTED] I have written a php to show file in directories. The problem is due to is_dir() can't opearate on remote files. What should I do in order to fix it. thx a lot~~~ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Please help!!! thx a lot~~~
HTTP my department disable the function of listing file "Marek Kilimajer" <[EMAIL PROTECTED]> ???:[EMAIL PROTECTED] What is remote in your circumstances? FTP, HTTP, ... ? Joe wrote: > any alternative method is also welcome > > "Joe" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D > :[EMAIL PROTECTED] > >>I have written a php to show file in directories. >>The problem is due to is_dir() can't opearate on remote files. What should > > I > >>do in order to fix it. >>thx a lot~~~ >> >> >> > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please help!!! thx a lot~~~
I see the point but I just want to list the subfolder under my directory. Could you please tell me how to distinguish a directory from a file in Unix thx a lot "Sven" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D :[EMAIL PROTECTED] > hi joe, > you want a server-script, that lists a dir on a client? > i think that's impossible. think of if you visit a website written in php > and in background your hdd is scanned? that's simply a security reason. > ciao SVEN > > Joe wrote: > > any alternative method is also welcome > > > > "Joe" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D > >> [EMAIL PROTECTED] > >> I have written a php to show file in directories. > >> The problem is due to is_dir() can't opearate on remote files. What > >> should I do in order to fix it. > >> thx a lot~~~ > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Please help!!! thx a lot~~~
What is remote in your circumstances? FTP, HTTP, ... ? Joe wrote: any alternative method is also welcome "Joe" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D :[EMAIL PROTECTED] I have written a php to show file in directories. The problem is due to is_dir() can't opearate on remote files. What should I do in order to fix it. thx a lot~~~ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please help!!! thx a lot~~~
hi joe, you want a server-script, that lists a dir on a client? i think that's impossible. think of if you visit a website written in php and in background your hdd is scanned? that's simply a security reason. ciao SVEN Joe wrote: > any alternative method is also welcome > > "Joe" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D >> [EMAIL PROTECTED] >> I have written a php to show file in directories. >> The problem is due to is_dir() can't opearate on remote files. What >> should I do in order to fix it. >> thx a lot~~~ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please help!!! thx a lot~~~
any alternative method is also welcome "Joe" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D :[EMAIL PROTECTED] > I have written a php to show file in directories. > The problem is due to is_dir() can't opearate on remote files. What should I > do in order to fix it. > thx a lot~~~ > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please Help !
look up two functions in the online manual. strtotime() and date() strtotime will give you a unix timestamp for just about any date possable, date will format it the way you need. to get it into a mySQL date field, basicaly, you do this: date("y-m-d", strtotime($_POST['date'])) where $_POST['date'] is whatever variable you used. - Anthony "Sean O'Reilly" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I know this is really basic but i have a form for users to enter the > date of an event that i would like to store in a mysql database how do i > get the users input into the database in the right format. > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please Help.. cgi.force_redirect does not work
what is the cgi error message ? Scott Fletcher wrote: Hi! To make the long story short, we use IIS 5.0 with PHP 4.0.6 for a while. Then we builted a new database server, SQL-2000 and point the website to the new server. Then we notice the problem with the CGI error. So, we last week downloaded the PHP 4.3.3 and update the IIS with the newer PHP version and set the cgi.force_redirect to zero in php.ini. See example below --snip-- ; cgi.force_redirect is necessary to provide security running PHP as a CGI under ; most web servers. Left undefined, PHP turns this on by default. You can ; turn it off here AT YOUR OWN RISK ; **You CAN safely turn this off for IIS, in fact, you MUST.** cgi.force_redirect = 0 --snip-- We still have problem with CGI error. The use of php function, header() is what cause the error. Yes, the IIS and the website are reading the php.ini correctly. I checked that out and it is verified. So, what is the workaround to the CGI error?? Thanks, Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please Help.. cgi.force_redirect does not work
Oddly, the CGI Error message is intermitted. It come on some of the time and some of the other time doesn't. What is the problem here.? "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi! > > To make the long story short, we use IIS 5.0 with PHP 4.0.6 for a while. > Then we builted a new database server, SQL-2000 and point the website to the > new server. Then we notice the problem with the CGI error. So, we last > week downloaded the PHP 4.3.3 and update the IIS with the newer PHP version > and set the cgi.force_redirect to zero in php.ini. See example below > --snip-- > ; cgi.force_redirect is necessary to provide security running PHP as a CGI > under > ; most web servers. Left undefined, PHP turns this on by default. You can > ; turn it off here AT YOUR OWN RISK > ; **You CAN safely turn this off for IIS, in fact, you MUST.** > cgi.force_redirect = 0 > --snip-- > > We still have problem with CGI error. The use of php function, header() is > what cause the error. Yes, the IIS and the website are reading the php.ini > correctly. I checked that out and it is verified. > > So, what is the workaround to the CGI error?? > > Thanks, > Scott > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: please help
> is the culprit. instead use what u missed were the double quotes around the value. u HAVE TO do that for values with space in between . regards, -shiva "Nabil" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a form like: > > > . > . > while($row = mysql_fetch_array($result)) > { > ?> > > > . > . > > 1- if the fetched is only one word, i have no problem BUT > 2- When i have $row=['area'] ecual to "happy day" that came form MySQL (as > two word with a space). > 3- I have a problem when submit the form , if i echo $_POST['area'] in the > action file .. i got only "happy" without "day" > > Please help me , because i m going to pull my hair off... > > Nabil > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please help.
That doesn't tell much. The way you'r using should work. What happens if it doesn't work? Thomas On Sun, 15 Jun 2003 21:46:54 +1000 [EMAIL PROTECTED] (Ben Houlton) wrote: > How do I get a DB table open easily? > So far, I've been using a metod that sometimes works and some times doesn't, > I just want to know the easy way to do it. > My code of what I'm doing now is below: > > $db = mysql_connect("localhost","root"); > > mysql_select_db("misc",$db); > > $result = mysql_query("SELECT * FROM replace"); > > $row = mysql_fetch_array($result); > > Thank you for your time. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PLEASE HELP
"Dale" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I was able to successfully install the php on my win2k server. I am, > however, getting an error any time I try to initialize a variable. This is > the error I am getting: > > Notice: Undefined index: adv_auth in ...\mysql\lib.inc.php on line 132 > > I am not sure as to whether I forgot to do something when I installed php or > whether I need to somehow modify IIS so that variable initialization will > work. > > Thank you. > > Sincerely, > Dale > Are u getting this, everytime you declare a variable ? Or only in this one case, then you should post the relevant code. gamin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please, help with Sourceforge's PHP command-line not working at all
>I think that it has started recently, when SF upgraded all their system. >There is an error code that says that it cannot load module 'mm' at line >0, or something like that. 'mm' is a memory-mapping library that needs to be compiled into a module for the OS and/or PHP to use... I'm not smart enough to tell you if it's a Un*x module missing or a PHP module missing, though. If it was a Un*x module, you would need to have SourceForge: Download mm source. Compile and install it. Do 'ldconfig' to make the OS re-load its modules (or whatever their OS uses) Re-start Apache (I think.) If it's a PHP Module, they'd need to: Do all of the above, *and*: Re-do the ./configure for PHP, using --with-mm or whatever the --with/--enable bit is as well as all the other stuff they used last time (see config.nice). Re-install PHP Re-start Apache (for sure.) *OR* if they are smarter than I am (okay, it's SourceForge, so we *know* they are smarter than I am...) they *might* be able to: Do a ./configure of PHP using *just*: ./configure --with-mm=shared Take the resulting mm.so from the PHP /lib directory and put it in the extensions directory set in php.ini and then add mm.so in the extensions section and re-start Apache without re-compiling all of PHP. If you get the idea that I only vaguely understand all this crap, you are correct :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Please help with fresh fish.
Hi Dan, Thank you so much for your advice. Anh "Dan Ostrowski" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I truely recommend "Beginning PHP4" by Wrox Press (www.wrox.com or p2p.wrox.com) if you have no experience in programming or PHP. It is, by far, the best $40 you will ever ever spend. I promise. > > regards, > dan > > On Tue, 3 Sep 2002 16:46:03 -0700 (PDT) > Philip Hallstrom <[EMAIL PROTECTED]> wrote: > > > Read everything at the following sites :-) > > > > www.php.net > > www.zend.com > > www.phpbuilder.com > > > > In particular read the manuals, tips, tricks, examples, and links to other > > sites sections. > > > > Lots of good info there and will point to more sites. > > > > On Tue, 3 Sep 2002, Anh wrote: > > > > > Hello everyone, > > > > > > I would like to study PHP but do not have any experience about PHP or > > > programming. Could you please give me some advice to begin such as books, > > > news, forum... > > > > > > Many thanks in advance, > > > Anh > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Please help with fresh fish.
I truely recommend "Beginning PHP4" by Wrox Press (www.wrox.com or p2p.wrox.com) if you have no experience in programming or PHP. It is, by far, the best $40 you will ever ever spend. I promise. regards, dan On Tue, 3 Sep 2002 16:46:03 -0700 (PDT) Philip Hallstrom <[EMAIL PROTECTED]> wrote: > Read everything at the following sites :-) > > www.php.net > www.zend.com > www.phpbuilder.com > > In particular read the manuals, tips, tricks, examples, and links to other > sites sections. > > Lots of good info there and will point to more sites. > > On Tue, 3 Sep 2002, Anh wrote: > > > Hello everyone, > > > > I would like to study PHP but do not have any experience about PHP or > > programming. Could you please give me some advice to begin such as books, > > news, forum... > > > > Many thanks in advance, > > Anh > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please help with fresh fish.
Read everything at the following sites :-) www.php.net www.zend.com www.phpbuilder.com In particular read the manuals, tips, tricks, examples, and links to other sites sections. Lots of good info there and will point to more sites. On Tue, 3 Sep 2002, Anh wrote: > Hello everyone, > > I would like to study PHP but do not have any experience about PHP or > programming. Could you please give me some advice to begin such as books, > news, forum... > > Many thanks in advance, > Anh > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: ###PLEASE HELP### - delete a line from a text file
Hi Nick! First off, *please* read a netiquette guide before posting -- I hate seeing a conational of mine posting a message like yours ("###PLEASE HELP###" and "I am waiting for an answer" are extremely rude - you're not paying for support on this mailing list, so you can't demand anything). Other than that, I'd point out cleaning up your code before posting because we don't have to read through your "slickiness" -- but that may be a matter of personal opinion. Your problem resides exactly in your code's slickiness - which incidentally doesn't make it any faster. Try this conventional code instead: function delete_user($sterge_user, $path) { [1] $fisierul=$orig=file($path); for($i=0;$i i have a text file with some of this elements: > > name:adress:telephone:email:password > > i want to delete this line using for identifier the 'name' only. > > // $sterge_user="name"; this is the value sent by form witch will be the identifier > // $path="some_of_my_files"; the file used here allready set with 777 chmod > > function delete_user($sterge_user, $path){ > $i = 0; > $fisierul = file($path); > $fp = fopen($path, "w"); > while (!sizeof($fisierul)) > { > $data = fgetcsv ($fisierul, 4096, ":"); > if ($data[0]==$sterge_user) > { >for ($i=0; $i<=sizeof($data);){$data[i]="";++$i;} > } > fwrite($fp, $data); > } > fclose($fp); > } > > I am waiting for an answer, please > > Nick > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please Help me
Djurovski Dejan wrote: > What's wron in my script? > I receive message: > *Warning*: Supplied argument is not a valid MySQL result resource in > *c:\inetpub\wwwroot\login.php* on line *12* > I input validate username ˛password! > > > include("config.php"); > if(!empty($username)) > { > print("$username, $password"); > > $aDBLink=@mysql_connect("$host", "$user", "$password"); Your problem might be that you use $user here, where everywhere else you seem to think it is called $username. > mysql_select_db("$db", $aDBLink); > $aSQL="select * from administracija where > administracija_username=$username"; > $aQResult=mysql_query($aSQL, $aDBLink); You can also make a call to mysql_error() here, because MySQL is probably ready to tell you why your query did not execute correctly. > > $broj= mysql_num_rows($aQResult); > P.S. I tried to send this message to General mailing list, but i could > not. I am subscribed! You should really try to figure out why you can't post to php-general. I receive nearly 1000 messages a day and cannot be relied upon to reply to every one. Also, others may benefit from your question and the fact that it is archived on the list, and it is always better to get a few different perspectives on a particular problem. Happy hacking. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: please help! ./common_db.inc'
It couldnt open ./common_db.inc which you referenced in an include() function on line 2 of /var/www/html/myphp/ex.php Its a bit like the PHP version of the 404 not found message. Check the path for typing mistakes etc. You might like to try using ../../dir1/dir2 instead of ./ "Caleb Carvalho" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all, > > this is my first real php program -can any one explain to > me what this error message means? > > Warning: Failed opening './common_db.inc' for inclusion (include_path='') in > /var/www/html/myphp/ex.php on line 2 > > > > thanks a lot, > > Caleb > > _ > Send and receive Hotmail on your mobile device: http://mobile.msn.com > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Please help - debug.log
>I've attached the debug.log which was created while I was installing PHP >onto my 400MHz Pentium PC, running Linux (and DOS on another partition) with >a MySQL database and an Apache web server. >Please can you help. >When testing to view a PHP file requesting phpinfo( ) on the Netsacpe >browser, nothing comes up as it should. Attachemnts are stripped. Try opening up a DOS prompt and doing cd to the PHP directory, and then: ./php -q c:\\whatever\\dir\\phpinfo.php Then you know at least the your PHP.exe works... Next, try configuring PHP as a CGI using Alias and Action in httpd.conf -- It's less problematic than the Module version. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Please Help - getting a hightlight depending on selected page
Sorry Hugh - didn't mean to send it just to you!! Hi! Thanks for the help! It works great, but I've now made the array 2 dimensional: Les Misérables" => array ("About Les Misérables"), "Introduction" => array ("About Les Misérables"), "Changes & Cuts" => array ("About Les Misérables"), "Scores" => array ("About Les Misérables"), "Orchestra" => array ("About Les Misérables"), "Synthesizers" => array ("About Les Misérables"), "Sound System" => array ("About Les Misérables"), "Articles" => array ("About Les Misérables"), "21st CenturyLes Misérables" => array ("About Les Misérables"), "Information" => array ("About Les Misérables"), "Discussion Forums" => array ("About Les Misérables") ); ?> (they're not all the same - it's just for quick tesing purposes!) Now in the nav menu I get: Warning: Undefined offset: 0 in E:\inetpub\wwwroot\index.php on line 103 > Warning: Undefined offset: 1 in E:\inetpub\wwwroot\index.php on line 103 > Warning: Undefined offset: 2 in E:\inetpub\wwwroot\index.php on line 103 > Warning: Undefined offset: 3 in E:\inetpub\wwwroot\index.php on line 103 > etc... down to "10" the rest of the script is: ".$index[$i].""; < LINE 103 echo ""; } ?> is it something to do with the "count($index)"? Thanks for all the help! Martin-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Please Help - getting a hightlight depending on selected page
Thanks everyone for the help!!! Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Please Help - getting a hightlight depending on selected page
"Martin Hughes" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > OK here's the code in the page: > > > > > > > Welcome > > Home > Introduction > Changes & Cuts > Scores > Orchestra > Synthesizers > Sound System > Articles > 21st Century Les > Misérables > Information > Discussion Forums > > > > > > > I am using this 1 page as the php 'template' with content added depending on > the url. For example, to go to the synthesizers page the url is: > index.php?sect=5&id=0&page=31 > > where sect=5 is the part that sets the menu highlight (the menu is alway the > same, hard-coded into the page - all I want to do is change the css id="sel" > from Home to Synthesizers. Welcome ".$index[$i].""; echo ""; } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Please Help - getting a hightlight depending on selected page
Okay, well you could either put code like this into each td cell like this: > That is kind of ugly, however. A more elegant solution would be to make an array containing the links then do a loop kind of like this (I'm just typing the code off the top of my head, so there is likely to be some errors): $menuItems = array('Home', 'Introduction', 'Changes & Cuts', 'Scores', 'Orchestra', 'Synthesizers', 'Sound System', 'Articles'); $i = 0; foreach ($menuItems as $item) { if($sect == $i) { print "$item\n"; } else { print "$item\n"; } $i++; } The obvious problem with my solution is the links will also presumably have to be entered into an array, and I don't think the foreach construct can work on two arrays simultaneously, but you can use the $i variable as the index to your second array. In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Martin Hughes) wrote: > OK here's the code in the page: > > > > > > > Welcome > > Home > Introduction > Changes & Cuts > Scores > Orchestra > Synthesizers > Sound System > Articles > 21st Century Les > Misérables > Information > Discussion Forums > > > > > > > I am using this 1 page as the php 'template' with content added depending on > the url. For example, to go to the synthesizers page the url is: > index.php?sect=5&id=0&page=31 > > where sect=5 is the part that sets the menu highlight (the menu is alway the > same, hard-coded into the page - all I want to do is change the css id="sel" > from Home to Synthesizers. > > Cheers > > Martin > > -- __ Gabe da Silveira, Web Designer Twin Cities Student Unions University of Minnesota http://www.coffman.umn.edu wFone: (612)624-7270 eMail: [EMAIL PROTECTED] hPage: http://www.visi.com/~jiblet -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Please Help - getting a hightlight depending on selected page
OK here's the code in the page: Welcome Home Introduction Changes & Cuts Scores Orchestra Synthesizers Sound System Articles 21st Century Les Misérables Information Discussion Forums I am using this 1 page as the php 'template' with content added depending on the url. For example, to go to the synthesizers page the url is: index.php?sect=5&id=0&page=31 where sect=5 is the part that sets the menu highlight (the menu is alway the same, hard-coded into the page - all I want to do is change the css id="sel" from Home to Synthesizers. Cheers Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Please Help - getting a hightlight depending on selected page
Is the menu part of each page? Or is it a separate file/script that gets included in each page? Or is the navigation in a separate frame? If the menu is hard-coded into each page, then there's no reason to use PHP, because you have to modify each page ANYWAY, so you might as well just set each page to what it needs to be. The only way you are going to be able to accomplish this with significantly less work than that is if you store your image URLs and menu links in a database. In that case as you printed out the links, you would check each one to see if $PHP_SELF was equal to the link. Ultimately there are so many ways that you could be doing this that there is no simple answer. Post your menu code, and tell us how it gets included in your page and then we can help... In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Martin Hughes) wrote: > Hi can anyone help me please!? > > I have a page that has a navigation table on the left with various links: > > Information > Software > Cars > Dishwashers > Paper > Contact > etc... > > (not the real links ;)) > > and I want the cell of the section I am in to be highlighted (ie if I am in > "Cars" I want the "Cars" link to have a red background). I have set it up so > that in CSS the id "sel" is a red b/g. > > How do I set the id of a certain cell to "sel" taking it from the url > (index.php?menu=cars as a very bad example of php coding :)). > > Cheers > > Martin > > -- __ Gabe da Silveira, Web Designer Twin Cities Student Unions University of Minnesota http://www.coffman.umn.edu wFone: (612)624-7270 eMail: [EMAIL PROTECTED] hPage: http://www.visi.com/~jiblet -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: please help.
Look at a folder named 'Benchmark' that comes with php's PEAR. It has a file named Time.php, and it has nice instructions about how to use it. -- Julio Nobrega. Because happiness is a warm gun Bang-bang shoot-shoot "McShen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > hi > > I wanna see how long my scripts load. So, i copied this script from > phpbuilder > --- >$timeparts = explode(" ",microtime()); > $starttime = $timeparts[1].substr($timeparts[0],1); > $timeparts = explode(" ",microtime()); > $endtime = $timeparts[1].substr($timeparts[0],1); > echo bcsub($endtime,$starttime,6) > ?> > -- > > But i am not sure where to put that part. Can i put it anywhere within my > script? And bcsub() is not install on my server. What other fuctions can i > use? can i just use $endtime-$starttime? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PLEASE HELP!! STRANGE ERROR!! IS THERE ANY PHP DEVELOPER?
Hi ! Don't bother with it, anybody! I recompiled all under php-4.0.4pl1 version and it works just fine! It seems it was the php version's fault.. thank u all! Daniel BI > Did anybody have the same error? > > I have this simple script: > === > the output on the second computer, in the 'select' line, is this: > > but... the second computer is Pentium III on linux RH 7.0, same > configuration, but with php-4.0.1pl2, (purchased!!!...) and it does > yeld that error. > I tried with the php-4.0.1pl1 (as with the first computer) but curiously... > it does act the same wrong way.. > it seems to be something about sessions, but independently of the > php version... > I compiled the apache server with the 'public' UID, 'guest' GUID, and > they are present in my linux user and group list. the session does > actually write any info correctly. (i tried a session_register('blabla') > and > it works)... > the error only disappears when I remove the " session_start " statement! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]