php-general Digest 21 Apr 2001 21:31:54 -0000 Issue 641 Topics (messages 49652 through 49703): Re: Drag and drop 49652 by: Kevin A Williams Re: Can Variables be in functions? 49653 by: Kevin A Williams imap 49654 by: Martin Oust mime 49655 by: Martin Oust Re: I don't get it ... suddenly my script doesn't work ... 49656 by: Johannes Janson 49689 by: Plutarck compiling PHP 4.04pl1 as dymanic module with Apache 1.3.19 49657 by: David Bouw Re: Site Sesions: Online/off... 49658 by: Richard Re: PERL vs. PHP 49659 by: Dean Hall 49660 by: PHPBeginner.com Developy a Management tree in Php 49661 by: 453110.gmx.de xml-rcp problem 49662 by: Peter Van Dijck 49663 by: Peter Van Dijck Searching arrayed file... Suggestions? 49664 by: Richard 49665 by: Jason Lotito 49666 by: PHPBeginner.com pumping database dump in mysql 49667 by: Peter Van Dijck 49668 by: David Bouw 49670 by: Data Driven Design redirection 49669 by: Kishore 49671 by: Jason Brooke 49672 by: KPortsmout.aol.com 49686 by: Sigitas Paulavicius [Apache] Win32 Virtual Host - Sub Domain 49673 by: Jon Shoberg ? interbase ? 49674 by: Bart A. Verbeek include file using .htaccess 49675 by: Keyur Kalaria 49677 by: Rasmus Lerdorf 49678 by: PHPBeginner.com problem with storing & displaying image in db 49676 by: Keyur Kalaria unserialize returns nothing. 49679 by: Taylor, Stewart 49681 by: Alexander Wagner user active 49680 by: FredrikAT Where can I get php_msql.dll? 49682 by: Shan GAO Re: Site Searchable function 49683 by: ~~~i LeoNid ~~ Buttons and such... 49684 by: Jason Caldwell 49687 by: PHPBeginner.com 49700 by: CC Zona 49701 by: PHPBeginner.com imap_fetch_overview vs. imap_header 49685 by: Sigitas Paulavicius connection problème! 49688 by: Francois Boucher 49693 by: Sigitas Paulavicius 49694 by: Plutarck Re: [PHP-DB] super simple....... but! 49690 by: andreas \(.work\) 49691 by: andreas \(.work\) Re: I'm a moron. So? 49692 by: Plutarck Re: Output graphic or other download file to client's browser 49695 by: Plutarck 49702 by: Sigitas Paulavicius bug, querk, or mistake? 49696 by: Adam Charnock 49697 by: Rasmus Lerdorf 49698 by: CC Zona Buggy Java GUI? (just a tad OT) 49699 by: Plutarck Re: mysql_free_result 49703 by: Steve Lawson Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
Hi, Whilst you cant use PHP to implement Drag and Drop (PHP is server side, hence once compiled, its done its job), you can implement DHTML (Javascript, CSS & DOM) to attain this effect. So called DHTML handles all client-side (browser) manipulation, and through DOM allows you to manipulate pretty much everything on the page as individual objects. There are a number of script repositories with appropriate scripts and tutorials, including http://webreference.com/dhtml/column7/crossCode.html One crude and early implementation (best bets in IE, but is possible to implement in Netscape), is at http://co-project.lboro.ac.uk/users/cokaw/menu/mover2.html although that implementation is a bit bitty (ignore broken link on right, click on image gallery image once, then move around) Hope this points you in the right direction Kevin Williams ----- Original Message ----- From: "Brandon Orther" <[EMAIL PROTECTED]> To: "PHP User Group" <[EMAIL PROTECTED]> Sent: Wednesday, December 22, 1999 11:49 PM Subject: [PHP] Drag and drop > Is there a way to get the drag and drop effect using php? > > Thank you, > > -------------------------------------------- > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.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] > >
Classic Global function definition problem inside the function, insert the line global $footercontent; Also technically, the exit command can be quite messy, a 'cleaner' method would be to use something like function generate_footer() { ?> <!-- footer --> </BODY> </HTML> <? } and then call it at the end of your script, or if using case statements for many functions, then call it once at the bottom <? // Could consider using a common header function here switch($something) { case "First_Option": first_code(); break; case "Second_Option": second_thing(); break default: content($loginID); } generate_footer(); ?> Hope this helps Kevin Williams ----- Original Message ----- From: "Brandon Orther" <[EMAIL PROTECTED]> To: "PHP User Group" <[EMAIL PROTECTED]> Sent: Sunday, December 26, 1999 6:33 PM Subject: [PHP] Can Variables be in functions? > I have a function as follows: > > function myExit(){ > print("</table>$footercontent"); > exit; > } > > $footercontent does have the footer information in it because I echo it > right before I make the function. > > when I use the function all it echoes is: </table> > > Anyone want to tell me what I'm doing wrong this time? > > Thanks > > Thank you, > > -------------------------------------------- > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.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] > >
is there any function to convert the body of a e-mail-massege from mime like you do with the imap_mime_header_decode() ???
is there any function to convert the body of a e-mail-massege from mime like you do with the imap_mime_header_decode() ???
Hi, a general thought at first. When posting a rahter long sxrpit it would be helpful to mark the lines which produce the errors. But now straight to the point. change the inside of your if/elseif parethesis from just the variable to (isset($variable)) respectively to (! isset($variable)). hope it helps Johannes
Check your error report settings. When you refer to something like $id as: if ($id)... PHP will throw a warning that $id isn't set. It's a nice debugging feature, but a pain in the arse otherwise. The problem is PHP now has a higher error level for some reason, so just nock it down to normal. -- Plutarck Should be working on something... ...but forgot what it was. "Tim Thorburn" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > I have a PHP script that I wrote several months ago which allows a user to > enter information into a MySQL database through a basic web form - it > worked very well. However, since then I had a system crash - luckily I > made a backup of the script days before the crash. > > My problem is, that now the script generates errors which were not present > before. I've gone over it twice, even re-coded it just now, and still I > get the same errors. > > Currently, I am using Win2k Pro, MySQL 3.23.33 and PHP4.0.4pl1 installed as > CGI. > > Interestingly, when I try to run this script on my RH7.0 Linux box with > MySQL 3.22.32 and PHP3.0.18 it does not generate these errors. I have this > system setup with older versions of MySQL and PHP as those are the versions > that my hosting service uses. > > Could someone please look over my code and tell me where I'm going wrong?? > > Thank you > > -Tim > > The errors I get are as follows: > Warning: Undefined variable: submit in index.php3 on line 17 > > Warning: Undefined variable: delete in index.php3 on line 37 > > Warning: Undefined variable: id in index.php3 on line 51 > > Warning: Undefined variable: id in > E:\WebPages\2001\AtikokanInfo\Web\www.atikokaninfo.com\htdocs\aedc\comcal\mc x\webmonkey.php3 > on line 83 > > Here is the script which I am attempting to use: > > <html> > > <body> > > > > <?php > > > > $db = mysql_connect("localhost", "user", "passwd"); > > mysql_select_db("edoinfo",$db); > > > > if ($submit) { > > // here if no ID then adding else we're editing > > if ($id) { > > $sql = "UPDATE comcal001 SET > eventCategory='$eventCategory',eventName='$eventName',eventLocation='$eventL ocation',eventCity='$eventCity',eventState='$eventState',eventCountry='$even tCountry',eventTime='$eventTime',eventAMPM='$eventAMPM',eventDuration='$even tDuration',eventMonth='$eventMonth',eventDay='$eventDay',eventDate='$eventDa te',eventYear='$eventYear',eventC1Fname='$eventC1Fname',eventC1Lname='$event C1Lname',eventC2Fname='$eventC2Fname',eventC2Lname='$eventC2Lname',eventACph one='$eventACphone',eventPhone='$eventPhone',eventACfax='$eventACfax',eventF ax='$eventFax',eventACcell='$eventACcell',eventCell='$eventCell',eventEmail= '$eventEmail',eventWeb='$eventWeb',eventDetails='$eventDetails',entryDate='$ entryDate' > WHERE id=$id"; > > } else { > > $sql = "INSERT INTO comcal001 > (eventCategory,eventName,eventLocation,eventCity,eventState,eventCountry,eve ntTime,eventAMPM,eventDuration,eventMonth,eventDay,eventDate,eventYear,event C1Fname,eventC1Lname,eventC2Fname,eventC2Lname,eventACphone,eventPhone,event ACfax,eventFax,eventACcell,eventCell,eventEmail,eventWeb,eventDetails,entryD ate) > VALUES > ('$eventCategory','$eventName','$eventLocation','$eventCity''$eventState','$ eventCountry','$eventTime','$eventAMPM','$eventDuration','$eventMonth','$eve ntDay','$eventDate','$eventYear','$eventC1Fname','$eventC1Lname','$eventC2Fn ame','$eventC2Lname','$eventACphone','$eventPhone','$eventACfax','$eventFax' ,'$eventACcell','$eventCell','$eventEmail','$eventWeb','$eventDetails','$ent ryDate')"; > > } > > // run SQL against the DB > > $result = mysql_query($sql); > > echo "Record updated/edited!<p>"; > > } elseif ($delete) { > > // delete a record > > $sql = "DELETE FROM comcal001 WHERE id=$id"; > > $result = mysql_query($sql); > > echo "$sql Record deleted!<p>"; > > } else { > > // this part happens if we don't press submit > > if (!$id) { > > // print the list if there is not editing > > $result = mysql_query("SELECT * FROM comcal001",$db); > > while ($myrow = mysql_fetch_array($result)) { > > printf("<a href=\"%s?id=%s\">%s %s</a> \n", $PHP_SELF, $myrow["id"], > $myrow["eventCategory"], $myrow["eventName"]); > > printf("<a href=\"%s?id=%s&delete=yes\">(DELETE)</a><br>", > $PHP_SELF, $myrow["id"]); > > } > > } > > > > ?> > > <P> > > <a href="<?php echo $PHP_SELF?>">ADD A RECORD</a> > > <P> > > <form method="post" action="<?php echo $PHP_SELF?>"> > > <?php > > > > if ($id) { > > // editing so select a record > > $sql = "SELECT * FROM comcal001 WHERE id=$id"; > > $result = mysql_query($sql); > > $myrow = mysql_fetch_array($result); > > $id = $myrow["id"]; > > $eventCategory = $myrow["eventCategory"]; > > $eventName = $myrow["eventName"]; > > $eventLocation = $myrow["eventLocation"]; > > $eventCity = $myrow["eventCity"]; > > $eventState = $myrow["eventState"]; > > $eventCountry = $myrow["eventCountry"]; > > $eventTime = $myrow["eventTime"]; > > $eventAMPM = $myrow["eventAMPM"]; > > $eventDuration = $myrow["eventDuration"]; > > $eventMonth = $myrow["eventMonth"]; > > $eventDay = $myrow["eventDay"]; > > $eventDate = $myrow["eventDate"]; > > $eventYear = $myrow["eventYear"]; > > $eventC1Fname = $myrow["eventC1Fname"]; > > $eventC1Lname = $myrow["eventC1Lname"]; > > $eventC2Fname = $myrow["eventC2Fname"]; > > $eventACphone = $myrow["eventACphone"]; > > $eventPhone = $myrow["eventPhone"]; > > $eventACfax = $myrow["eventACfax"]; > > $eventFax = $myrow["eventFax"]; > > $eventACcell = $myrow["eventACcell"]; > > $eventCell = $myrow["eventCell"]; > > $eventEmail = $myrow["eventEmail"]; > > $eventWeb = $myrow["eventWeb"]; > > $eventDetails = $myrow["eventDetails"]; > > $entryDate = $myrow["entryDate"]; > > // print the id for editing > > > > ?> > > <input type=hidden name="id" value="<?php echo $id ?>"> > > <?php > > } > > > > ?> > > Category: <input type="Text" name="eventCategory" value="<?php echo > $eventCategory ?>"><br> > > Event Name: <input type="Text" name="eventName" value="<?php echo > $eventName ?>"><br> > > Location: <input type="Text" name="eventLocation" value="<?php echo > $eventLocation ?>"><br> > > City: <input type="Text" name="eventCity" value="<?php echo $eventCity > ?>"><br> > > State: <input type="Text" name="eventState" value="<?php echo > $eventState ?>"><br> > > Country: <input type="Text" name="eventCountry" value="<?php echo > $eventCountry ?>"><br> > > Time: <input type="Text" name="eventTime" value="<?php echo $eventTime > ?>"><br> > > AM/PM: <input type="Text" name="eventAMPM" value="<?php echo $eventAMPM > ?>"><br> > > Duration: <input type="Text" name="eventDuration" value="<?php echo > $eventDuration ?>"><br> > > Month: <input type="Text" name="eventMonth" value="<?php echo > $eventMonth ?>"><br> > > Day: <input type="Text" name="eventDay" value="<?php echo $eventDay ?>"><br> > > Date: <input type="Text" name="eventDate" value="<?php echo $eventDate > ?>"><br> > > Year: <input type="Text" name="eventYear" value="<?php echo $eventYear > ?>"><br> > > Contact 1 First Name: <input type="Text" name="eventC1Fname" > value="<?php echo $eventC1Fname ?>"><br> > > Contact 1 Last Name: <input type="Text" name="eventC1Lname" value="<?php > echo $eventC1Lname ?>"><br> > > Contact 2 First Name: <input type="Text" name="eventC2Fname" > value="<?php echo $eventC2Fname ?>"><br> > > Contact 2 Last Name: <input type="Text" name="eventC2Lname" value="<?php > echo $eventC2Lname ?>"><br> > > Phone: (<input type="Text" name="eventACphone" value="<?php echo > $eventACphone ?>">) <input type="Text" name="eventPhone" value="<?php echo > $eventPhone ?>"><br> > > Fax: (<input type="Text" name="eventACfax" value="<?php echo $eventACfax > ?>">) <input type="Text" name="eventFax" value="<?php echo $eventFax ?>"><br> > > Cell: (<input type="Text" name="eventACcell" value="<?php echo > $eventACcell ?>">) <input type="Text" name="eventCell" value="<?php echo > $eventCell ?>"><br> > > Email: <input type="Text" name="eventEmail" value="<?php echo > $eventEmail ?>"><br> > > Web: <input type="Text" name="eventWeb" value="<?php echo $eventWeb ?>"><br> > > Details: <input type="Text" name="eventDetails" value="<?php echo > $eventDetails ?>"><br> > > Entry Date: <input type="Text" name="entryDate" value="<?php echo > $entryDate ?>"><br> > > <input type="Submit" name="submit" value="Enter information"> > > </form> > > > > <?php > > > > } > > > > ?> > > > > </body> > > </html> > > > > -- > 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] >
Hi there, Till now I have always compiled and used PHP as an static module with Apache.. For the experience and to make it a little easier to compile different PHP packages I want to use PHP as an dynamic module.. Reading the documentation this seems easy... First I got apache 1.3.19 and ran: ./configure --target=/var/apache --enable-module=so Compiled and did a make install Did a ./httpd -l in the /var/apache/bin directory and got: Compiled-in modules: -- Cut out other listed modules -- mod_so.c suexec: disabled; invalid wrapper /var/apache/bin/suexec Looks great ... Then I got PHP-4.04pl and ran: ./configure --with-mysql --with-apxs --with-pdflib After starting I get the error: checking for AOLserver support... no checking for Apache module support via DSO through APXS... ./configure: apxs: command not found Sorry, I was not able to successfully run APXS. Possible reasons: 1. Perl is not installed; 2. Apache was not compiled with DSO support (--enable-module=so); 3. 'apxs' is not in your path. configure: error: ; Well, O.K, /var/apache/bin isn't a place PHP will probably look, so I run it again with: ./configure --with-mysql --with-apxs=/var/apache/bin/apxs --with-pdflib And then I got the error: checking for Apache module support via DSO through APXS... Usage: apxs -g [-S <var>=<val>] -n <modname> apxs -q [-S <var>=<val>] <query> ... apxs -c [-S <var>=<val>] [-o <dsofile>] [-D <name>[=<value>]] [-I <incdir>] [-L <libdir>] [-l <libname>] [-Wc,<flags>] [-Wl,<flags>] <files> ... apxs -i [-S <var>=<val>] [-a] [-A] [-n <modname>] <dsofile> ... apxs -e [-S <var>=<val>] [-a] [-A] [-n <modname>] <dsofile> ... Sorry, I was not able to successfully run APXS. Possible reasons: 1. Perl is not installed; 2. Apache was not compiled with DSO support (--enable-module=so); 3. 'apxs' is not in your path. configure: error: ; What is my problem: It looks as if apxs is found and that PHP configure tries to invoke it.. Looks like PHP configure needs to add a flag.. ?? Am I doing something wrong, or is this some king of 'changed' feature in Apache 1.3.19?? I have Perl installed... Also I am running everything on a Redhat 6.2 machien.. Thanks for all help.. Bye Bye David
Hehehe.. Yeah. Thanks alot, this will do perfectly good. - Richard ""Plutarck"" <[EMAIL PROTECTED]> wrote in message 9bqhpe$f3d$[EMAIL PROTECTED]">news:9bqhpe$f3d$[EMAIL PROTECTED]... > If you want to make it easy on yourself, convert it into a timestamp (unix > preferably). Then all you have to do is: > > $dif = time() - $last_access_time; > > if ($dif > 3600) > { > echo "The user has been inactive for more than an hour."; > } > > That's if you want to make it easy on yourself. If you're a masochist I > suppose you could play around with mktime() :) > > > -- > Plutarck > Should be working on something... > ...but forgot what it was. > > > ""Richard"" <[EMAIL PROTECTED]> wrote in message > 9bpbf3$fc$[EMAIL PROTECTED]">news:9bpbf3$fc$[EMAIL PROTECTED]... > > Greetings. (the thread was too far down to be read by anyone) > > > > I am having some problems with the code itself! I have done like so, > > that whenever peopel wishes to see the "onliners", I start a function > called > > DelOld(). This will not decrease server speed, nor create conflicts when > > writing to temporary files and so forth. > > Now, I tried to gather the following into an exploded array: > > > > // the date output > > $date_output = date("Y-m-d-H-i-A"); > > > > As you see, I've seperated all with a "-" so I can simply call [0], > [1], > > [2],... if I want something. Now, How can I compare if a user is away for > > like 10 minutes, or 30 minutes? I have a function called > > GetLoggDateofUser($Username) which will retreive the $date_output, but > with > > colons and spaces, like so: > > date("Y-m-d H:i A"). > > > > Do you or anyone else have any suggestions? > > > > - Richard > > > > > > > > > > > > -- > > 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 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] >
"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > but since you replied, can i ask what influenced you most > > when developing PHP? > > Whenever I couldn't decide what sort of syntax to use I copied C > > -Rasmus This makes me think that any similarities to Perl are merely an accident. Perl was written so that programmers of C (and several other languages) could easily learn Perl and write in a comfortable subset of Perl syntax. I've seen a lot of Perl that looks like C and a lot that doesn't. I had a friend remark how similar PHP is to Basic. I think PHP's similarities to Perl end after the "$" symbol, associative arrays, and object syntax (borrowed from C++?). As someone already mentioned, Perl is a much more mature language. Dean.
Funny! You, Rasmus, must be getting it every week at least. btw Jason, we had some very interesting discussions on how Rasmus has started PHP, look the archives - you would find it very curious. Maxim Maletsky -----Original Message----- From: Jason Caldwell [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 21, 2001 3:04 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] PERL vs. PHP Ramus Lerdof, Are you the Ramus that created PHP? If so, just want to say -- THANKS! -- PHP is the coolest thing since Delphi !!! Really Love it! Jason "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > PHP was started as a suite of perl programs... it is heavily > > influenced by perl. if you understand PHP and are comfortable > > with it, you should not have any problems learning Perl. > > Not quite. I prototyped the initial parser with a Perl program (pre > version 1), but the "suite" as you call it was all written in C. > > -Rasmus > > > -- > 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 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]
Hi, I have a huge problem !!! I try develop a managementtree (like W2K Management) for my Network management Tool. My 1. Problem: This Tree should be changeable about a web interface. -> thats no the real problem. My 1. Problem: How I can develop this tree - I haven't any Idea. How I can do that: if the user click on a directory the subdirectory or the files are show. I thought I can do this with parametes but if my tree have 100 entries its to mutch. My secound think I use a developed Java-Script Tree -> but I cann't manage this well. Any Ideas. Thonix -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net
Hi, I was playing with the xml-rcp example given at o'reilly http://www.oreillynet.com/pub/a/rss/2000/11/14/meerkat_xmlrpc.html which uses Edd Dumbill's PHP XML-RPC modules But when I run the example mentioned in the oreilly article (on Apache on win NT), I get a popup saying error in php.exe: access violation. Does this have to do with me running on win NT? If I turn debugging $client->setDebug(1); on I get ---GOT--- HTTP/1.1 200 OK Date: Sat, 21 Apr 2001 12:39:14 GMT Server: Apache/1.3.12 (Unix) PHP/4.0.2 mod_perl/1.24 X-Powered-By: PHP/4.0.2 Connection: close Content-Type: text/xml Content-length: 13805 <?xml version="1.0"?> <methodResponse> <params> <param> <value><array> <data> <value><struct> <member><name>id</name> <value><int>80</int></value> </member> <member><name>title</name> <value><string>Data</string></value> </member> </struct></value> ....... So it looks like getting the info of the server is working fine... Any ideas? Peter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://liga1.com building multiple language/culture websites http://poorbuthappy.editthispage.com online ethnology, up&down
Also, when I uncomment stuff, the line that seems to be giving the problems is: $response = $client->send($msg); When I comment that no more errors. (but nothing else either ofcourse) Peter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://liga1.com building multiple language/culture websites http://poorbuthappy.editthispage.com online ethnology, up&down
Greetings. I have made a try to write a search engine for a site I run. This search iterates through all links which are made up like so: "|BY|EMAIL|CATEGORY|FOLDER/BAND|LINKNAME|LINKURL|". Now, I use the code: if ($txtLinkname=="") return; $logfile="entries.txt"; $file_line = file($logfile); $total_lines = count($file_line); // Start printing the header of the table. The rest is completed, nested // course.. in the incrementation-loop. echo"<table width=60% cellpadding=0 border=0 cellspacing=0 align=center>"; echo"<tr><td width=100% valign=top align=left>"; for($i=($total_lines-1); 0 <= $i; $i--) { $line[] = $file_line[$i]; } echo "<p><b>Searching for links containing $txtLinkname...<br>"; echo "<hr noshade>"; echo "</b>"; for ($i=0; $i < $total_lines; $i++){ $line_array = explode("|",$line[$i]); $swhere=strtolower($line_array[5]); $swhat=strtolower($txtLinkname); $pos = strpos ($swhere, $swhat); if ($pos<0) { // not found }else if (($pos>1) && (!empty($pos))) { $found++; echo"<b>Name:</b> $line_array[1]<br>\n"; echo"<b>Email:</b> <a href=\"mailto:$line_array[2]\">$line_array[2]</a><br>\n"; echo"<b>Category:</b> $line_array[3]<br>\n"; echo"<b>Band/Folder:</b> $line_array[4]<br>\n"; echo"<b>Link Name:</b> $line_array[5]<br>\n"; echo"<b>Link URL:</b> <a href=\"$line_array[6]\" target=\"_blank\">$line_array[6]</a><br>\n"; echo "<hr noshade>"; } } echo "<h3>"; if ($found==0) { echo "No links found containing '$txtLinkname'!<br>"; }else{ echo "<br>Found: $found links containing $txtLinkname<br>"; } echo "</h3><h4>"; echo "[ <a href=\"post3.htm\">POST LINK</a> | <a href=\"index.php?action=view\">VIEW LINKS</a> ]"; $found=0; echo "</h4>"; ?> And that is all the code I use. Where have I done wrong? You see, the problem is that I found only some links, but not all. And if I have a link called "Necrolust - Tribute to MayheM", it cannot find the "Necro" nor "necRO". And as you can see, I HAVE used uppercase methods to find portions and so forth. Any help is suggested!! - Richard
> And that is all the code I use. Where have I done wrong? You see, the > problem is that I found only some links, but not all. And if I have a link > called "Necrolust - Tribute to MayheM", it cannot find the "Necro" nor > "necRO". And as you can see, I HAVE used uppercase methods to > find portions > and so forth. Any help is suggested!! Seriously consider using MySQL or PosgreSQL, or some other form of DBMS. They will make your life so much easier. Jason Lotito www.NewbieNetwork.net
Have you evrer heard of in_array() ? could help though... :-) Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -----Original Message----- From: Richard [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 21, 2001 9:50 PM To: [EMAIL PROTECTED] Subject: [PHP] Searching arrayed file... Suggestions? Greetings. I have made a try to write a search engine for a site I run. This search iterates through all links which are made up like so: "|BY|EMAIL|CATEGORY|FOLDER/BAND|LINKNAME|LINKURL|". Now, I use the code: if ($txtLinkname=="") return; $logfile="entries.txt"; $file_line = file($logfile); $total_lines = count($file_line); // Start printing the header of the table. The rest is completed, nested // course.. in the incrementation-loop. echo"<table width=60% cellpadding=0 border=0 cellspacing=0 align=center>"; echo"<tr><td width=100% valign=top align=left>"; for($i=($total_lines-1); 0 <= $i; $i--) { $line[] = $file_line[$i]; } echo "<p><b>Searching for links containing $txtLinkname...<br>"; echo "<hr noshade>"; echo "</b>"; for ($i=0; $i < $total_lines; $i++){ $line_array = explode("|",$line[$i]); $swhere=strtolower($line_array[5]); $swhat=strtolower($txtLinkname); $pos = strpos ($swhere, $swhat); if ($pos<0) { // not found }else if (($pos>1) && (!empty($pos))) { $found++; echo"<b>Name:</b> $line_array[1]<br>\n"; echo"<b>Email:</b> <a href=\"mailto:$line_array[2]\">$line_array[2]</a><br>\n"; echo"<b>Category:</b> $line_array[3]<br>\n"; echo"<b>Band/Folder:</b> $line_array[4]<br>\n"; echo"<b>Link Name:</b> $line_array[5]<br>\n"; echo"<b>Link URL:</b> <a href=\"$line_array[6]\" target=\"_blank\">$line_array[6]</a><br>\n"; echo "<hr noshade>"; } } echo "<h3>"; if ($found==0) { echo "No links found containing '$txtLinkname'!<br>"; }else{ echo "<br>Found: $found links containing $txtLinkname<br>"; } echo "</h3><h4>"; echo "[ <a href=\"post3.htm\">POST LINK</a> | <a href=\"index.php?action=view\">VIEW LINKS</a> ]"; $found=0; echo "</h4>"; ?> And that is all the code I use. Where have I done wrong? You see, the problem is that I found only some links, but not all. And if I have a link called "Necrolust - Tribute to MayheM", it cannot find the "Necro" nor "necRO". And as you can see, I HAVE used uppercase methods to find portions and so forth. Any help is suggested!! - Richard -- 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]
Hi, I want to write a script that takes a mysql dump file and pumps it into the database. I got the dump in a variable and then did $res = mysql_query($dumpvariable); but that doesn't work? I know how to do it on the command line, I just want to do it in a php script... thanks for any hints! Peter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://liga1.com building multiple language/culture websites http://poorbuthappy.editthispage.com online ethnology, up&down
If you can do it on the command line why not just use the system function and use the command you would use on the command line..? What you try to do now is to feed the whole dump file to mysql_query.. This will never work because mysql_query will only accept one query at a time and the mysqldump utility which you probably used also adds some comments in the dump file which can't be handled by mysql_query.. If you DO want to do it through PHP try to break the dump file into some array so that all the queries in the dump file are seperated and then make sure that you strip all not SQL data.. It's probably not worth the work... Problem gets easier when you create the dump yourself with PHP... My suggestion is to not work with dump files but to get an second mysql database on another machine and backup your database to that machine.. Makes everything easier, when you have a problem the other database can directly be used to restore the backup and you don't have to search for the dump file.. Sucess.. Bye Bye David > I want to write a script that takes a mysql dump file and pumps it into the > database. > I got the dump in a variable and then did > $res = mysql_query($dumpvariable); > but that doesn't work? I know how to do it on the command line, I just want > to do it in a php script... > thanks for any hints! > Peter > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > http://liga1.com building multiple language/culture websites > http://poorbuthappy.editthispage.com online ethnology, up&down > > > -- > 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] > >
Isn't that what load data infile does? http://www.mysql.com/doc/L/O/LOAD_DATA.html Data Driven Design P.O. Box 1084 Holly Hill, Florida 32125-1084 http://www.datadrivendesign.com http://www.rossidesigns.net ----- Original Message ----- From: Peter Van Dijck <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, April 21, 2001 9:39 AM Subject: [PHP] pumping database dump in mysql > Hi, > I want to write a script that takes a mysql dump file and pumps it into the > database. > I got the dump in a variable and then did > $res = mysql_query($dumpvariable); > but that doesn't work? I know how to do it on the command line, I just want > to do it in a php script... > thanks for any hints! > Peter > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > http://liga1.com building multiple language/culture websites > http://poorbuthappy.editthispage.com online ethnology, up&down > > > -- > 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] > >
How to redirect to another page in php. Is there any inbuilt function available for redirection. If possible send with example. Thanks kishor
header("Location: http://your.dom/file"); ----- Original Message ----- From: "Kishore" <[EMAIL PROTECTED]> To: "phpgeneral" <[EMAIL PROTECTED]> Sent: Saturday, April 21, 2001 11:28 PM Subject: [PHP] redirection > How to redirect to another page in php. Is there any inbuilt function > available for redirection. > If possible send with example. > > > Thanks > > kishor
In a message dated 21/04/2001 15:31:36 GMT Daylight Time, [EMAIL PROTECTED] writes: << How to redirect to another page in php. Is there any inbuilt function available for redirection. If possible send with example. Thanks kishor >> Use the Header call,for more info see www.php.net and search for Header() Example header ("Location: Http://www.domain.com/owner/index.php"); HTH Ade
header("Location: http://any.URL/you/need") NOTE: header must be sent prior to any output. Otherwise this won't work and a warning will be issued.
Sorry for the OT post but this has me stumped and Google is not giving me any good leads. I am trying to setup Apache with PHP on Win32 (don't ask why). Anyhow, PHP is working great but virtual hosting is not going so well. When the browser brings up http://localhost/ it reads from [Apache Root]/apache/htdocs as defined by: #*** Good Virtual ********************************** <VirtualHost *> ServerAdmin webmaster@localhost DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/" ServerName localhost ErrorLog logs/error_log CustomLog logs/access_log common </VirtualHost> #*************************************************** What are are tring to do is setup http://test.localhost/ and it is not working here is the virtual host and apache restart ... #*** Bad Virtual *********************************** [Sat Apr 21 09:55:33 2001] [error] Cannot resolve host name est.localhost --- ignoring! The Apache service is restarting. The Apache service has restarted. <VirtualHost test.localhost> ServerAdmin webmaster@localhost DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/test/" ServerName test.localhost ErrorLog logs/test.localhost-error_log CustomLog logs/test.localhost-access_log common </VirtualHost> #*************************************************** Any thoughts on getting Win32 to resolve that test.localhost name ? Thanks
Hello, I'm internet-databasing for over a year now and only used MySQL up untill now. Last week I spoke with a guy that was interested in running Interbase on a Unix-webserver, so I've got a couple of questions... 1.> Can interbase be installed and run on every Unix-type (BSD)? I've taken a look on the borland site but they only speak of Linux and windows. 2.> How stable is it comparing to MySQL when running on Unix (bsd)? 3.> Is it possible to run MySQL and Interbase on the same server? 4.> What are the differences between Interbase and MySQL? 5.> Does PHP have the same capabilities for Interbase as for MySQL? 6.> How difficult is it to install a binary (not found on Borland site) or to compile it from source for a BSD-server? 7.> What's the difference between managing Interbase and managing MySQL on a Internetserver? 8.> Does anyone know hostingproviders that support Interbase? 9.> Why would anyone choose Interbase when they can use MySQL on the same server? I hope anyone can help me! Thanks in advance... Regards, Bart Verbeek
Hello, How can I include any html or php file via .htaccess ? I want to include an html file in a site contaning around 1000 pages. I want to add header & footer dynamically on these pages . Is there any way to include header & footer on these pages using .htaccess file. thanks in advance keyur $$$$$$$
Make sure AllowOverride includes Options and put these lines in your .htaccess: php_value auto_prepend_file header.html php_value auto_append_file footer.html -Rasmus On Sat, 21 Apr 2001, Keyur Kalaria wrote: > Hello, > > How can I include any html or php file via .htaccess ? > > I want to include an html file in a site contaning around 1000 pages. I want > to add header & footer dynamically on these pages . > Is there any way to include header & footer on these pages using .htaccess > file. > > > thanks in advance > > keyur > $$$$$$$ > > > > > -- > 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] >
the syntax for it is: php_value auto_prepend_file /full/path/to/the/prepend.inc php_value auto_append_file /full/path/to/the/append.inc or you could also do this: php_value include_path /full/path/to/the/includes php_value auto_prepend_file prepend.inc php_value auto_append_file append.inc this would allow you to include anything else you wish inside prepend.inc as well as having some more files included from pages without any full pathes unless they are not found in 'includes' Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -----Original Message----- From: Keyur Kalaria [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 22, 2001 12:51 AM To: php Subject: [PHP] include file using .htaccess Hello, How can I include any html or php file via .htaccess ? I want to include an html file in a site contaning around 1000 pages. I want to add header & footer dynamically on these pages . Is there any way to include header & footer on these pages using .htaccess file. thanks in advance keyur $$$$$$$ -- 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]
Hello everybody, I am facing a strange problem while uploading and displaying images in a database table. I have taken blob field to store the images. Images which are less then around 100kb are stored & displayed properly but images which are greater than 100kb are giving problems while displaying although no errors were generated while inserting them in database. what could be the problem ? is it due to the blob type ? i am using the following statements to insert the file to database. insert.php *********************************** $imgsize=GetImageSize($photofile); $photo=addslashes(fread(fopen($photofile, "r"), filesize($photofile))); $query="insert into photo(photoformat,photo,photowidth,photoheight) values ('$photoformat','$photo',$imgsize[0],$imgsize[1])"; $photoformat, $photofile are the input fields of the form which is submitted. *********************************** in my html pages i use the following <img> : <img src=display.php?id=1> and my display.php is as follows: display.php *********************************** $query="select * from photo where id='$id'"; $result=mysql_query($query); $photo_rec=mysql_fetch_array($result); Header( "Content-type: image/$photo_rec[photoformat]; name=".microtime()); echo $photo_rec["photo"]; *********************************** Thanks in advance Keyur $$$$$$$
I'm fetching a serialized array from a database but when I call unserialize() the function returns false. Any suggestions as to why unserialize is returning false? Regards, -Stewart
Taylor, Stewart wrote: > I'm fetching a serialized array from a database but when I call > unserialize() the function returns false. > > Any suggestions as to why unserialize is returning false? I once had this problem when I serialized an array which contained a variable from global namespace which was empty, but only when switching from HTTP to HTTPS. The serialized array had one entry with value "N" (no type or length), which couldn't be unserialized. Checking if the variable had a value and assigning 0 if not before putting it into the array solved the problem. regards Wagner -- 'When the computer industry is at a low, beer drinking is at a high.' Jon 'maddog' Hall said. By combining both industries into a single course you can make sure you always have a job.
Hi! I have users logging in on my site (they write news).. What is the best way to show how's online? Write to MySQL (last logged in) ? Somehow use the sessions to this ? --------------------------------- Fredrik A. Takle [EMAIL PROTECTED]
Can anybody tell me where I can get extension for MINI sql -- php_msql.dll for NT4.0? Cheers Shan GAO
On 20 Apr 2001 10:00:32 -0700 impersonator of [EMAIL PROTECTED] ("Matthew Luchak") planted &I saw in php.general: > >check php.ini file for "allow fopen" I think..... >____________________________=20 >Matthew Luchak=20 >Webmaster >Kaydara Inc.=20 >[EMAIL PROTECTED] Thanks, I don't know if you are right here, or not. (I personaly, don't think it is PHP configuration related, but rather something to do with me already running php script on this server, which wants to open extra on the same location.. and server settings.. and me not experienced enough with this specific http:// fopen use:) Anyway, I have no control over configuration files there. (I heard, they don't allow external sockets connections. But this one is for the same, supposedly, domain, although with http://) Any other suggestions or ways to go around? > > Warning: fopen("http://my.domain/file_name.htm","r") - A socket must >be >already connected. in ...etc.... on line 304=20 > >where it worked ok with 'filesystem open' (On my home window localhost, >it >worked though). Suggestions, how to go around this problem? Leon id.
I know this is off-topic -- please forgive me. But I figure someone here would know. I'm looking for some really nice *professional* looking (submit, logon, buy, help, etc....) buttons for my website... I've done all kinds of searches on MSN and Yahoo -- found a ton of sites that offer all kinds of .gifs and .jpegs -- but I must say 99% of them are garbage. Any suggestions would be greatly appreciated. Thanks. Jason
See, that's for the website. You often don't want to look same as others, do you? Then you should be making the buttons yourself, perhaps on a sexy Mac OS X with some PhotoShop or Fireworks. OK, nor even I make myself the buttons when I design a software interface for internal use. I go to sourseforge.net, look thought the software demos and use cut&paste technology. Applications, generally, have some very interesting and usable graphics, my advise to you is : search there. Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -----Original Message----- From: Jason Caldwell [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 22, 2001 3:16 AM To: [EMAIL PROTECTED] Subject: [PHP] Buttons and such... I know this is off-topic -- please forgive me. But I figure someone here would know. I'm looking for some really nice *professional* looking (submit, logon, buy, help, etc....) buttons for my website... I've done all kinds of searches on MSN and Yahoo -- found a ton of sites that offer all kinds of .gifs and .jpegs -- but I must say 99% of them are garbage. Any suggestions would be greatly appreciated. Thanks. Jason -- 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]
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("PHPBeginner.com") wrote: > See, that's for the website. You often don't want to look same as others, do > you? Then you should be making the buttons yourself, perhaps on a sexy Mac > OS X with some PhotoShop or Fireworks. > > OK, nor even I make myself the buttons when I design a software interface > for internal use. I go to sourseforge.net, look thought the software demos > and use cut&paste technology. > > Applications, generally, have some very interesting and usable graphics, my > advise to you is : search there. There's some very cool, cutting edge design to be seen on some of those sites. However, it should be noted that since graphics are copywrite-protected materials, unless a site is explicitely offering up its graphics for free public use, you should also be getting permission before using the "borrowed" graphics within your own works. (OTOH, downloading others' graphics in order to study them, master the techniques used to create them, etc. is a common and very helpful practice that AFAIK does not require permission. So take advantage!) -- CC
that is why I go to sourceforge to do that, We have a whole team of designers, they can make the graphics for publick view. What I was talking about is for internal admin areas like things, you don't want to spend you time on making the well designed things for yourself... would ya? m -----Original Message----- From: CC Zona [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 22, 2001 4:43 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Buttons and such... In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("PHPBeginner.com") wrote: > See, that's for the website. You often don't want to look same as others, do > you? Then you should be making the buttons yourself, perhaps on a sexy Mac > OS X with some PhotoShop or Fireworks. > > OK, nor even I make myself the buttons when I design a software interface > for internal use. I go to sourseforge.net, look thought the software demos > and use cut&paste technology. > > Applications, generally, have some very interesting and usable graphics, my > advise to you is : search there. There's some very cool, cutting edge design to be seen on some of those sites. However, it should be noted that since graphics are copywrite-protected materials, unless a site is explicitely offering up its graphics for free public use, you should also be getting permission before using the "borrowed" graphics within your own works. (OTOH, downloading others' graphics in order to study them, master the techniques used to create them, etc. is a common and very helpful practice that AFAIK does not require permission. So take advantage!) -- CC -- 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]
I'm wondering why IMAP_FETCH_OVERVIEW does not return the "to" value of the message and why IMAP_HEADER does not return the UID of the message. I need both of those values, but the idea of calling two functions which are 80% the same does not sound good to me... I suppose this will at least produce a double load on mail server, since the headers will be fetched twice. Does anyone have any comments on this?
I wrote this code but nothing append. If i look de code in the browser it's stopping to starting! What is the problème? <HTML><BODY> <?php echo "starting..."; if ( mysql_connect("localhost","php","php") ) { echo "ok"; } else echo "error!"; ?> </BODY></HTML> -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -= François Boucher =- -= [EMAIL PROTECTED] =- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -= François Boucher =- -= [EMAIL PROTECTED] =- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
I suggest you should check if the mysql server is running. And also you should check if there is a user "php" with password "php" and with access from "localhost" granted on your mysql server.
Not enough "}". Change it to: <?php echo "starting..."; if ( mysql_connect("localhost","php","php") ) { echo "ok"; } else { echo "error!"; } ?> -- Plutarck Should be working on something... ...but forgot what it was. ""Francois Boucher"" <[EMAIL PROTECTED]> wrote in message 9bsk0h$r2e$[EMAIL PROTECTED]">news:9bsk0h$r2e$[EMAIL PROTECTED]... > I wrote this code but nothing append. If i look de code in the browser it's > stopping to starting! > > What is the problème? > > > <HTML><BODY> > <?php > echo "starting..."; > if ( mysql_connect("localhost","php","php") ) > { echo "ok"; } > else > echo "error!"; > > ?> > </BODY></HTML> > > -- > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > -= François Boucher =- > -= [EMAIL PROTECTED] =- > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > -= François Boucher =- > -= [EMAIL PROTECTED] =- > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > > > > -- > 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] >
try <HTML><BODY> <?php echo "starting..."; if ( mysql_connect("localhost","php","php") ) { echo "ok"; } else { echo "error!"; } ?> </BODY></HTML> ----- Original Message ----- From: "Francois Boucher" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, April 21, 2001 10:34 PM Subject: [PHP-DB] super simple....... but! I wrote this code but nothing append. If i look de code in the browser it's stopping to starting! What is the problème? <HTML><BODY> <?php echo "starting..."; if ( mysql_connect("localhost","php","php") ) { echo "ok"; } else echo "error!"; ?> </BODY></HTML> -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -= François Boucher =- -= [EMAIL PROTECTED] =- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- PHP Database 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]
try <HTML><BODY> <?php echo "starting..."; if ( mysql_connect("localhost","php","php") ) { echo "ok"; } else { echo "error!"; } ?> </BODY></HTML> ----- Original Message ----- From: "Francois Boucher" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, April 21, 2001 10:34 PM Subject: [PHP-DB] super simple....... but! I wrote this code but nothing append. If i look de code in the browser it's stopping to starting! What is the problème? <HTML><BODY> <?php echo "starting..."; if ( mysql_connect("localhost","php","php") ) { echo "ok"; } else echo "error!"; ?> </BODY></HTML> -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -= François Boucher =- -= [EMAIL PROTECTED] =- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- PHP Database 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]
Personally I like to use mt_rand() rather than rand() as it's billed to be faster and more random than plain old rand(). Kind of makes me wonder why they haven't just replaced rand() with mt_rand()... "seed" requires srand() for rand() and mt_srand() for mt_rand(). -- Plutarck Should be working on something... ...but forgot what it was. ""Dddogbruce (@home.com)"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Alrighty. I'm baack! Anyways, I seem to be having stupid little > problems, al of which are driving me insane. I'll feel really > stupid when you tell me the problem. A friend told me something about > "seeding" for random() but I didn't find anything on that. > > This is the HTML section... > > <HTML> > <HEAD> > <TITLE>Horse Race v.1</TITLE> > </HEAD> > <BODY> > Welcome to horse racing v.1. This is a simple PHP game where you can > train, race and win money for your animals. Eventually I'll make it a > whole barn with feeding and horses, and costs, age, breeding. So on. > But for now, this is just a simple game.<br><br> > > Enter six names of horses. > <FORM ACTION="horse.php" METHOD="post"> > Name1 : <INPUT TYPE="text" NAME="name1" size="24"><BR> > Name2 : <INPUT TYPE="text" NAME="name2" size="24"><BR> > Name3 : <INPUT TYPE="text" NAME="name3" size="24"><BR> > Name4 : <INPUT TYPE="text" NAME="name4" size="24"><BR> > Name5 : <INPUT TYPE="text" NAME="name5" size="24"><BR> > Name6 : <INPUT TYPE="text" NAME="name6" size="24"><BR> > <input type="submit" name="submitNms" value="race them!"> > </FORM> > <center>Good luck! > </BODY> > </HTML> > > ---------------- > > This is the PHP... > > <? > $name1 = "$n1"; > $name1 = "$n2"; > $name3 = "$n3"; > $name4 = "$n4"; > $name5 = "$n5"; > $name6 = "$n6"; > $randomHorse = rand($name1, $name6); > $randomStrides = rand(1, 10); > echo "$randomHorse won the race by $randomStrides ! Congratulations."; > ?> > > > ------------------- > > And I feel stupid. <g> > > -Owen > > > -- > 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] >
No real completely effective way of keeping someone from downloading an image. If they _really_ want the image they can take a screenshot then slice the image out. You could always use a *shudder* java applet, but if they're very familiar with a decompiler they can probably rip such a small applet to pieces in no time. In other words, it's next to impossible to keep someone from downloading one of your pictures. The only way to restrict it is to just use the images on pages that only authorized users can see. -- Plutarck Should be working on something... ...but forgot what it was. ""Jason Lam"" <[EMAIL PROTECTED]> wrote in message 001901c0ca17$a7aa5370$05d496cd@jasonwvvec46nl">news:001901c0ca17$a7aa5370$05d496cd@jasonwvvec46nl... Hello! I am trying to develop a web site where some files and images are private, I am using session to auth. user. I would like to know how I can send some local files to the client so that others without the access to the web site will not be able to download. How would I stream the local image (jpg) files over to client? I know how to stream it the normal way, just don't know how I can stream it to some and not others. Anyone have suggestions on this one? Jason Lam
Hi It is possible though quite complicated. You must write some kind of a "proxy" with PHP. The process looks something like this: The php script checks if the user is ok, reads the image file and then echoes it out to the client. - simple as it may sound. But there is a couple of points. Point #1. Since PHP is HTML embeded langauge, the default mime type of it's output is "text/html". So you will need to form the head of the http responce manually. This would look something like this: header("Content-Type: ".$mime_type); header("Content-Length: ".$image_size_in_bytes); $mime_type="image/pjpeg"; -this would be for JPG's $mime_type="image/gif"; -this would be for GIF's (not sure though) anyway, each file type "has" it's own mime_type - it's for you to determine which has which. then you may do: echo $binary_data_read_from_image_file; Point #2. How to preserve the original name of the image file. The problem is that the name of requested resource (or file name in this case) cannot be changed. In other words, if you try to save the image, that was downloaded via URL "retrieve_image.php?file=someimage.jpg&user=jack&pass=kcaj", the cleint (web browser) would sugest to save it as "retrieve_image.php" and not as "someimage.jpg". I might be wrong but the only way to trick the client is this: echo "<img src=\"path/retrieve_image.php\\someimage.jpg?file=someimage.jpg&user=jack&pa ss=kcaj\">"; this way the client thinks it's requesting "someimage.jpg", but the server is serving "retrieve_image.php" ;) I hope this will help you P.S. this all has worked for me, when i needed to serve the mail attachments from webmail
Hi all. I have just been writing some fairly simple PHP code when I cam across a problem. The following if statement always claims to be false. However, I print out the variables in the if (which are strings) and they are identical. Here it is: if($reqcat["indexname"] == $row["maincat"]){ I get the values through 2 while loops (based on mySQL results) that look something like this: while($reqcat = mysql_fetch_array($reqcat_results)){ It may be an error in my code but I thought it may also be a bug or a querk. If anyone else has come across this could you please tell me how you solved it? Thank you Adam Charnock
> if($reqcat["indexname"] == $row["maincat"]){ Well, something is different about them. Are you sure there are no leading or trailing spaces? Do a strlen() on each and make sure they are the same lengths or trim() each one before the compare. -Rasmus
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("Adam Charnock") wrote: > The following if statement always claims to be false. > However, I print out the variables in the if (which are strings) and they > are identical. Here it is: > > if($reqcat["indexname"] == $row["maincat"]) It would help to know what the values of those variables are when the comparison seemingly fails. With PHP's loose typing, it's possible for variables that a human reader would consider clearly same/different to get "unexpected" (though technically quite correct) results with a == comparison. You might try testing with the === operator (meaning, "values *and* types equal") to eliminate a type casting issue as the culprit. -- CC
I've been toying around with Java to possibly interface with PHP, but I have a question about it. Is it just me, or is the GUI in most standalone java applications remarkably (and annoyingly) buggy? I downloaded Forte for Java by Sun, and after the 45 second loading time I noticed that if you click around the menus or move your cursor too fast, a menu will become temporarily "burned" into the frame of the page. Same if you hover on one button till a message comes up, then switch over to another button, a portion of the original message will still be shown. Same goes for Limewire and other 100% java apps I've tried. I was just wondering if it's just my machine, or because I use the windows98 VM, or if everyone experiences the same thing. I'm guessing the horrendous starting load time is native to java, but at least it runs ok once you get the thing to start. -- Plutarck Should be working on something... ...but forgot what it was.
Sup, PHP will automatically free results after the script finishes. But, PHP has a memory cap, I think the default is 8megs -- check php.ini. Anyway, so lets say you wanted to pull 2 large results sets. You may get a memory error. So you could pull 1 result, do the necessary calculations, free the result, fetch the next set, etc. I doubt it would slow the script, but if you actually *needed* to use it...the script would probably be pretty slow anyway. SL. ----- Original Message ----- From: "Randy Johnson" <[EMAIL PROTECTED]> To: "Rasmus Lerdorf" <[EMAIL PROTECTED]>; "Randy Johnson" <[EMAIL PROTECTED]> Cc: "Php-General" <[EMAIL PROTECTED]> Sent: Friday, April 20, 2001 1:02 AM Subject: RE: [PHP] mysql_free_result > Does the Mysql_free_result slow down the script at all? > > Randy > > -----Original Message----- > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 20, 2001 8:49 PM > To: Randy Johnson > Cc: Php-General > Subject: Re: [PHP] mysql_free_result > > > > Does php release the memory used by the result set when it is done > > executing? > > Correct > > > if so why should I use mysql_free_result() > > In case you are making multiple queries within the same script and want to > keep your runtime memory usage low. > > -Rasmus > > > > -- > 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] >