Re: [PHP] Store PHP Code in MySQL?
Try looking at the eval() function. It's pretty similar to the eval keyword in perl. http://www.php.net/manual/en/function.eval.php J Smith code, dba and linux guy Tutorbuddy Inc. The Magic Lantern Group mailto:[EMAIL PROTECTED] Joseph Koenig [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I've been playing a little bit trying to store some PHP code in MySQL and get it to execute. However, it behaves just like expected in that it just displays the code, and doesn't execute it. Essentially, i want to do this: ? while($data = mysql_fetch_array($result)) { echo $data[text]; } ? With $data[text] containing: ? echo $var; ? Anybody know a way to actually make this work? Thanks, Joe
[PHP] An idea
Humor me, how useful would a Regex switch statement be? Like: ereg_switch($filename) { case "/\.jpg$/": echo "JPEG Image"; break; case "/\.gif$/"; echo "GIF Image"; break; case "/\.zip$/": echo "Compressed File"; break; default: echo "Unkown File Type"; break; } That is just an example of an application of such, I have other applications that I would like to use it for, but that serves the best example. I would love to get started on a module project for something like this, as using IF blocks with PREG_MATCH become tedious and inefficient. If you know of such a module or would know how to get started, please repsond with your ideas/input. Chris "TunkeyMicket" Watford TunkeyMicket Productions www.tunkeymicket.com
[PHP] automatic page view
Hello all! I am working on a admin page where companies log in to there own company admin page. Can anyone help out with a script to have the username and password directly linked to there own company admin page.
RE: [PHP] Multipe Tables, Single Query Problem
Simon Kimber pressed the little lettered thingies in this order... Christopher Wrote... You need to be able to tie at least one field from each table to one other field in another table, and then you can have a query like: SELECT videos.*, links.*, actors.* FROM videos, links, actors WHERE videos.VideoID = '$VideoID' AND links.VideoID = videos.VideoID actors.ActorID = links.ActorID Thanks Christopher, but wouldn't this return a separate row for each actor? I'm pretty sure i need something more than a simple join :o( Here's my original question again: what i need to do is return a particular video and all it's staring actors with just one query returning just one row, ie. with all the actor names in one field Hello, I had your thought backwards in my mind. I haven't ever seen a query that needed a sub-select that couldn't be written using joins. It's true that in many cases sub-selects would be much simpler, but it's usually possible to rewrite sub-select queries using joins. You can do this query with a simple join, but need to start with the table that will give multiple results first and load those results into an array. For example: $result=mysql(DBName,SELECT actors.*, links.*, videos.* WHERE actors.VideoID = '$VideoID' AND links.VideoID = actors.VideoID AND videos.VideoID = actors.VideoID ORDER BY whatever); $i=0; while ($row = mysql_fetch_row($result)) { $actorsField1[$i] = $row[0]; $actorsField1[$i] = $row[1]; ... $linksField1 = $row[10]; $linksField1 = $row[11]; ... $videosField1 = $row[20]; $videosField1 = $row[21]; ... $i++; } If the results of the links and videos tables are going to be the same for each query, then there's no need to save those values in an array. If there are going to be multiple results for any other table, you will also want those to be saved as an array. What you are attempting could also be done a little differently by using a LEFT JOIN, but I think that the above statement will do what you want (If I am in fact understanding what you want). You may also want to change the above SELECT to have links.ActorID = actors.ActorID if your links table is tied to the actors and not the videos. You can then show your results like: echo $videosField1br $videosField2p $linksField1br $linksField2p; for ($i = 0; $actorsField1[$i]; $i++) { echo $actorsField1[$i]br $actorsField2[$i]p; } Or however you want it to be formatted. The end result is that you have a single SQL query. Have fun... Christopher Ostmo a.k.a. [EMAIL PROTECTED] AppIdeas.com Meeting cutting edge dynamic web site needs For a good time, http://www.AppIdeas.com/
[PHP] php and flash 5 books?
Anyone know of any good books that actually deal with php interfacing with flash 5? I've found one book but just curious if there are others out there... thanks, jay
[PHP] list of included file names
Hi, I searched the archives for this. For debugging purposes, I want to see a list of the included files on a page in HTML comments. PHP_SELF and HTTP_SERVER_VARS[SCRIPT FILENAME] only returns the name + path of the file calling the included files. I want each included file to contribute its name to the page. Is there any way to do that so that the source looks like this: !-- These files contribute to this page - - !-- species_inc.php - - !-- db_connect_inc.php - - !-- constants_inc.php - - Thanks Tim
RE: [PHP] email forms
On Tue, 19 Jun 2001, Jason Murray wrote: Hi tim, Change this: mail($toaddress, $subject, $mailcontent, $fromaddress); mail ($toaddress, $subject, $mailcontent, From: Real Name $fromaddress\nReply-to: $fromaddress\n); Yeah, notice where you'll be adding various mail headers in there. The fourth argument in mail() is termed : additional_headers As you now know, 'From' is such a header. As are 'Reply-to' 'cc' and 'bcc' ... From: [EMAIL PROTECTED]\ncc: [EMAIL PROTECTED]\nbcc: [EMAIL PROTECTED] More examples in manual and rfc : http://www.php.net/manual/function.mail.php http://www.faqs.org/rfcs/rfc822.html http://www.faqs.org/rfcs/rfc2076.html I've spoken to the hosting company, they say they will not provide any assistance to PHP script related problems. They are running on Solaris servers with PHP 3.0.16. 1) Get a new hosting service, since they seem uninterested in your continued business. I mostly agree with the web host, they can't be *expected* to answer php syntax questions, that's why php-general exists :-) 2) Tell them to use a PHP that was built *after* the fall of the Roman Empire. 3.0.16 is old. It's not even the last PHP3 build. (And if they say its hard, well gee, we have PHP4.0.5 running on Solaris). Yeah, you'll find many more functions and stuff available within the newer releases of PHP4, may as well make a request and discuss it with them. And see their reasonings. Then tell them yours :-) Regards, Philip
[PHP] Problem with MySQL String limits?
In a script I have an update query adding on to a LONGTEXT field in my database. Strangely it will no longer work after seemingly random string lengths. So far, one row stopped adding at 440 bytes and another at 1049 bytes. mysql_query("UPDATE dod_news SET Comments='$comments', NumComments=NumComments+1 WHERE Num = $Num"); Num is correct, but strangely it doesn't do ANY of the query when this occurs. I have no idea why it started doing this but any help would be appreciated.
[PHP] PHP Support (was: Re: SV: [PHP] Re: Lists are back up)
At 19.06.2001 11:20, Mattias Segerdahl wrote: For all those that's seeking support for php, there are two options, zend.com sells SOS, you could also join #php on efnet for help.. I doubt #php would attract the big bad corporations using php, I've seen people give rm -rf / millions of times on IRC, and who would you sue if you happen to get that advice... no money involved, usually no responsibilities... Further you have to be reasonably lucky to find somebody with the required knowledge, time and willigness to solve a problem over IRC, and for a complex and possible business-critical web-solution you'd probably require the developers to sign a NDA... Zend and _many_ other companies offer this to those who can pay for it, just check with your local webhotel and ask them about creating a web-solution for you and tell more than happily take your money ;-). (No I haven't given the rm -rf /, but witnessed it and actually seen people come back and say.. 'uh what happened?', 'ls doesn't work anymore...') -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then.
[PHP] PHP Discussion Forums ?
Can someone here tell me who is responsible for the set up and maintenance of the PHP forums? I've yet to find anyone who does it better and I'd like to do something similar for the site I am responsible for. That is, the way the NNTP, mailing list and digest all works together so nicely. Ideally, I'd also like to include a web gateway to the NNTP server but it would be pretty amazing if I could get it as far as what the PHP site does. So anyway, I'd like to know what software is used, what part is scripted, basically what takes care of what in this great machine that is the PHP support network. Also I'd like to know of any and all PHP scripted NNTP gateways there might be out there that I do not know about. thanks, rob
[PHP] PHP with JAVA support
Hello, I'm trying to run PHP with Java support and don't get it to work. First I compiled PHP '--with-java=/usr/local/jdk1.2.2/'. Then I added this to the PHP.ini file: [Java] java.home=/usr/local/jdk1.2.2 java.class.path=/usr/local/lib/php/extensions/php_java.jar:/usr/local/jdk1.2.2/src.jar java.library.path=/usr/local/lib:/usr/local/jdk1.2.2/jre/lib/i386:/usr/local/jdk1.2.2/jre/lib/i386/classic:/usr/local /jdk1.2.2/jre/lib/i386/native_threads java.library=/usr/local/jdk1.2.2/jre/lib/i386/libjava.so java.extension=/usr/local/lib/php/extensions/libphp_java.so Now, when I try to instantiate a JAVA class I get this error: Fatal error: Cannot instantiate non-existent class: java in /usr/local/apache/htdocs/index.php on line 3. Does anybody have expirience with running JAVA with PHP? I don't know why it doesn't work. I use PHP 4.05 on a Debian Linux machine. Thanks. Robert
Re: [PHP] Starting session
Just make it so that a successful login process involves setting a session variable. In all pages that require a login, check that the session variable exists. In any other pages, just ignore it. Simple as that! Now just read the php documentation on how to do it ... (ie using the session_* commands). AndrewH Rosen [EMAIL PROTECTED] wrote in message 9gnhvd$8qh$[EMAIL PROTECTED]">news:9gnhvd$8qh$[EMAIL PROTECTED]... Hi, I'm creating a WEB portal with PHP. I want to give possibility the users to register on my site and to use some features on it. I want to use sessions and to start session only if user login. How can I understand ot my other pages on site, thath the user has logged in my site. i.e. to startsession only if user has logged in ? Thanks, Rosen Marinov
[PHP] Want To Know about Databse Connection
Hi, We are developing web application. The client wants it to get connected to their central database server in USA. Web server is in Singapore. Web server configuration - Situated in Singapore, unix / php / mysql - this database is only for some special cases where application does not require central database. Main central database server - Situated in USA, HP UX / sybase On web site we will be providing product listing and order form. After the order is confirmed and payment is made, client wants to update some fields on central database. Can anybody give me the details, how to do it? If I am using php, how to connect to remote server's database? What are the components require on both servers? How will be the network configuration? Any information source? etc etc... Thanks in advance manisha
RE: [PHP] PHP Interact with DreamWaver
Jack, Check out www.interakt.ro Best regards, Andrew -Original Message- From: Jack [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 6:45 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP Interact with DreamWaver Dear All I'm fresh on the php, but i just want to ask what should i do to let my existing Dreamwaver Made homepage to interact with Php, which means i had used dreamwave to draw the layout, using firework for the image, then i want to provide some function for the user like forms input, which i knew php can handle these things well, so i want to let the php to interact with the Dreamwaver! Is there anything i got to set on the Dreamwaver or the php side? Thx -- Jack [EMAIL PROTECTED]
RE: [PHP] [php]using sendmail with php
the problem is that you get an email saying unauthorized user or something like that, as the from field of the email, or you get the email in the regular way, and then ANOTHER email with the unauthorized user crap -Original Message- From: Jamie Thompson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 7:31 AM To: PHP General List (E-mail) Subject: RE: [PHP] [php]using sendmail with php What is this problem you speak of? I have never come across any problems with mail().maybe i'm not trying hard enough ;) -Original Message- From: Chris Cocuzzo [mailto:[EMAIL PROTECTED]] Sent: 19 June 2001 05:04 To: PHP General List (E-mail) Subject: [PHP] [php]using sendmail with php hey- i noticed a recent post about the weird email that someone was getting from a script that emails form data. I was curious on whether or not I could use sendmail with php, to possibly get around this problem(I've run into it myself). How might i do this?... chris