Search found 15 matches

by phuts
Tue Mar 16, 2004 5:31 pm
Forum: PHP - Code
Topic: regex help
Replies: 13
Views: 1104

although I was just thinking, what if someone ends a sentence in a smilie followed by some punctuation in that case, perhaps you should search for the string ":)" and in your foreach statement, set it up so that it replaces $code[] with $replace[] unless the following character is also a &...
by phuts
Tue Mar 16, 2004 5:17 pm
Forum: Databases
Topic: Help!!
Replies: 9
Views: 765

1 question to tim and phuts: how could he insert new data into an existing band_id?? He is obviously trying to edit existing data, or else there would be no need for the WHERE clause who knows.. but I do things like that all the time, usually because I forget the syntax / feel lazy and copy some co...
by phuts
Tue Mar 16, 2004 4:54 pm
Forum: PHP - Code
Topic: regex help
Replies: 13
Views: 1104

can you just insert a space in the searched-for string, like so:

Code: Select all

$code[] = ":) ";
by phuts
Tue Mar 16, 2004 4:43 pm
Forum: Databases
Topic: Help!!
Replies: 9
Views: 765

tim wrote:seems like you should use INSERT instead of UPDATE
tim makes a good point. Are you trying to enter new data or change already existing data?
by phuts
Tue Mar 16, 2004 4:30 pm
Forum: Databases
Topic: Help!!
Replies: 9
Views: 765

Try it without the quotes around $bandid
by phuts
Sun Feb 29, 2004 7:34 pm
Forum: PHP - Code
Topic: Stop overwriting of user uploaded files if file name exists
Replies: 24
Views: 2403

mikegotnaild wrote::) Well there are some very smart people here.
i'd wait for one of them.. heh
by phuts
Sun Feb 29, 2004 7:29 pm
Forum: PHP - Code
Topic: Stop overwriting of user uploaded files if file name exists
Replies: 24
Views: 2403

sorry mikegotnaild, I'm not exactly what you'd call an expert when it comes to things outside of my own site. Hopefully some php god will come along and help us figure this out.
by phuts
Sun Feb 29, 2004 7:24 pm
Forum: PHP - Code
Topic: Stop overwriting of user uploaded files if file name exists
Replies: 24
Views: 2403

hmmm.. like I said, i'm not sure if that code with the if( file_exists... line is correct.. anyone? oh and typo in my previous post. $SERVER['PHP_SELF'] should be $_SERVER['PHP_SELF'] also, if you do an include (as opposed to simply inserting the code into the original file) replace the "$_SERV...
by phuts
Sun Feb 29, 2004 7:11 pm
Forum: PHP - Code
Topic: Stop overwriting of user uploaded files if file name exists
Replies: 24
Views: 2403

I'm thinking you may want to just do hidden fields.. <html><FORM enctype="multipart/form-data" ACTION="http://naild.com/localmm/modules.php?name=Band_Submit&file=upload" METHOD="POST"> <input name="band_name" type="hidden" id="band_name"...
by phuts
Sun Feb 29, 2004 6:48 pm
Forum: PHP - Code
Topic: Stop overwriting of user uploaded files if file name exists
Replies: 24
Views: 2403

mikegotnaild wrote:phuts.. If you dont mind could u give me an example of doing that form thing like you said?
Sure, but it might be easier if you post your code for the original form first, in order to base it off of the original.
by phuts
Sun Feb 29, 2004 6:19 pm
Forum: PHP - Code
Topic: Stop overwriting of user uploaded files if file name exists
Replies: 24
Views: 2403

If I understand correctly, Illusionist is saying to make sure you are checking for the existing file in the correct directory.. I'm not sure if this is the correct syntax, but something like: <?php if (file_exists($_SERVER['DOCUMENT_ROOT'].'/localmm/upload/'.$imagefile)) ?> to replace: <?php if (fil...
by phuts
Sun Feb 29, 2004 5:33 pm
Forum: PHP - Code
Topic: Stop overwriting of user uploaded files if file name exists
Replies: 24
Views: 2403

Im newb what can i say :) Check out how many posts I've made.. heh. Anywho, you can also easily include an upload form before the "exit()" function in each case so that the user can choose a different file without having to hit the back button (and possibly fill in the entire form again)....
by phuts
Sun Feb 29, 2004 5:21 pm
Forum: PHP - Code
Topic: Stop overwriting of user uploaded files if file name exists
Replies: 24
Views: 2403

Re: Stop overwriting of user uploaded files if file name exi

Well, as far as the filename overwriting problem, you need to tell the script to stop if you encounter an existing file with the same name. With the code you have, all you do is tell the user that the filename already exists, but the script keeps executing anyways. Perhaps try: <?php //Check to see ...
by phuts
Sat Feb 21, 2004 2:17 pm
Forum: PHP - Code
Topic: Impossible Parse Error
Replies: 15
Views: 2389

llanitedave wrote:Line 123, where the parse error is occuring, is the "<?php" tag itself!
It sounds to me like the syntax error is above line 123, just as you get a parse error on the next line if you forget a ";"
by phuts
Thu Feb 19, 2004 12:29 am
Forum: PHP - Code
Topic: how to run cron jobs every 3 mins
Replies: 2
Views: 397

You may want to check out http://www.phpfreaks.com/print.php?cmd= ... &tut_id=28

0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/local/bin/php /home/user/crons/cronjob.php

I believe this is the format for three-minute intervals every day.