Search found 28 matches

by Tony121076
Fri Aug 15, 2003 4:49 pm
Forum: PHP & MySQL Security
Topic: Convert PHP/mySQL to MsSQL ? HELP
Replies: 1
Views: 3080

Convert PHP/mySQL to MsSQL ? HELP

I have a fairly basic PHP/mySQL database. Actually I'm just talking about the scripts (there are 3), there's no data in the database, so I don't care about that. I need to convert my PHP scripts to work with MsSQL instead of mySQL. I can't find any references for this. Does someone know where I can ...
by Tony121076
Sat Apr 19, 2003 6:07 am
Forum: mySQL & php coding
Topic: Should a hexadecimal number be stored as INT or VARCHAR ?
Replies: 2
Views: 1175

Should a hexadecimal number be stored as INT or VARCHAR ?

I need to use md5 to create a unique hexadecimal number for each user, but I don't know what type of column to store the result in. Is hexadecimal considered an integer?

Should a hexadecimal number be stored as INT or VARCHAR ?

Thanks in advance.
by Tony121076
Tue Apr 01, 2003 5:58 am
Forum: PHP coding => General
Topic: Is it ok to send an unset variable to a function?
Replies: 1
Views: 969

Is it ok to send an unset variable to a function?

I know this is easy to test, but I can't test anything right now (long story, please humor me). Will I get an error if I pass, say 3 variables to a function, if one of those variables is unset? NOTE: The function doesn't ever refer to the unset variable, except when it's called, ie... function myfun...
by Tony121076
Fri Mar 07, 2003 11:03 am
Forum: PHP General
Topic: Folder Permission on Linux: only allow my PHP script access?
Replies: 2
Views: 1135

Folder Permission on Linux: only allow my PHP script access?

I made a simple (unsecure, I know), php script to handle a few password protected pages on my site. All of the links to the secure pages pass a variable to the script that then gets the requested file's content from a sub folder and shows it (if they enter the correct password). My question is this....
by Tony121076
Tue Mar 04, 2003 10:46 am
Forum: PHP coding => General
Topic: How to arrange associative array elements? a function?
Replies: 1
Views: 767

How to arrange associative array elements? a function?

I have an associative array where the $keys = a name, and the $values = a number. I need to arrange the elements based on the $value (which is a number), from greatest to least. Is there a function for this? If not, what is the best way to handle this? (NOTE: some elements have the same number value...
by Tony121076
Fri Feb 21, 2003 11:21 am
Forum: PHP coding => General
Topic: Why won't PHP do a simple addition problem? (2+1=21)?
Replies: 4
Views: 1688

oops :)

oops. Thank you. I thought j was the month. :) I can't believe something so simple cost me so much time.
by Tony121076
Thu Feb 20, 2003 1:28 pm
Forum: mySQL & php coding
Topic: insert problem!
Replies: 5
Views: 2016

Remove the quotes from the table name

Remove the quotes from the table name...

$query="INSERT INTO adamgb (`id`, `name`, `date`, `mail`, `site`, `post`) VALUES ('', '$name', '', '$mail', '$site', '$post'); ";
by Tony121076
Thu Feb 20, 2003 12:39 pm
Forum: PHP coding => General
Topic: Why won't PHP do a simple addition problem? (2+1=21)?
Replies: 4
Views: 1688

Why won't PHP do a simple addition problem? (2+1=21)?

The following lines of code all produce 21 instead of 3, why? I understand whats it's doing, but how can you do addition problems? ------------------------- $mo = intval(date("j")); $mo = ++$mo; returns 21 ------------------------- $mo = date("j") + 1; returns 21 ------------------------- $mo = intv...
by Tony121076
Tue Feb 18, 2003 9:46 am
Forum: PHP General
Topic: How do I get rid of url encoding (all the % things)?
Replies: 1
Views: 1027

How do I get rid of url encoding (all the % things)?

I am passing variables from one script to another. PHP isn't cleaning the url encoding. My variables have all those %this and %that substitutions. Is there an easy way to change all the %thingies to the correct format, you know what I mean? Thanks in advance.
by Tony121076
Mon Feb 17, 2003 3:42 pm
Forum: PHP General
Topic: Troobleshooting a problem with $HTTP_REFERRER
Replies: 0
Views: 905

Troobleshooting a problem with $HTTP_REFERRER

I'm trying to troobleshoot a problem, but I can't tell if the problem is with my script or the way I'm trying to call it. I need to know... If you are at an address like m , and then you go to your php script by typing the path into the location bar, will $HTTP_REFERRER return the google address? Or...
by Tony121076
Wed Feb 12, 2003 3:31 pm
Forum: PHP General
Topic: php script address in image tag messes up the $HTTP_REFERER
Replies: 3
Views: 1508

php script address in image tag messes up the $HTTP_REFERER

I made a hit counter in php. I added an image tag to my home page with the path to my php script in it. It executes the script, but the $HTTP_REFERER variable give the current address instead of the last address. Please help! How can I call my php script from an html page in a way that the $HTTP_REF...
by Tony121076
Mon Feb 10, 2003 1:34 pm
Forum: PHP coding => General
Topic: splitting variables??
Replies: 8
Views: 2369

Sorry, I don't know why it's not working.

Sorry, I don't know. The split should work. You can do it like this to turn "myimage.gif" into ".gif"...

$split_image = preg_split(".", $image_name);
$image_name = "." . "$split_image[1]";
by Tony121076
Mon Feb 10, 2003 10:54 am
Forum: PHP coding => General
Topic: splitting variables??
Replies: 8
Views: 2369

Oops, Sorry, here is correction...

Sorry, that line will produce an error. This is the correct line...

$image_name = preg_replace("/.*.\./", "", $image_name);
by Tony121076
Mon Feb 10, 2003 10:34 am
Forum: PHP coding => General
Topic: splitting variables??
Replies: 8
Views: 2369

You can still use preg_replace

split will work. You can also do this...

$image_name = preg_replace("/*.\./", "", $image_name);
by Tony121076
Mon Feb 10, 2003 8:17 am
Forum: PHP coding => General
Topic: Sending a variable with a url
Replies: 1
Views: 1243

echo "<TR bgcolor=\"#f0f0f0\">\n"; } echo " <TD><a href=update.php?id=".$row['ID'].">".$row['ID']."</a></TD> <TD>".$row['Unit']."</TD><TD>".$row['POC']."</TD> <TD>".$row['Date']."</TD><TD>".$row['Start']."</TD>\n"; echo "</TR>\n";
by Tony121076
Sun Feb 09, 2003 7:40 am
Forum: PHP General
Topic: Strange Error when using mail() PLEASE HELP
Replies: 1
Views: 1015

Strange Error when using mail() PLEASE HELP

When trying to use mail() in my php script, I get the following error... /etc/aliases: line 21: herseyt@fab-com.com... cannot alias non-local names: Error -30991 /dead.letter... Saved message in /dead.letter HTTP/1.1 200 OK Date: Sun, 09 Feb 2003 15:35:29 GMT Server: Apache/1.3.27 (Unix) PHP/4.2.3 X...
by Tony121076
Fri Feb 07, 2003 4:10 pm
Forum: PHP General
Topic: Can a php page edit itself?
Replies: 1
Views: 1055

YES IT CAN

I did it. It works great, if anyone was wondering.
by Tony121076
Fri Feb 07, 2003 3:59 pm
Forum: PHP coding => General
Topic: splitting variables??
Replies: 8
Views: 2369

Use preg_replace

Use this line to clip the .gif off the variable...

$image_name = preg_replace("/\..*/", "", $image_name);
by Tony121076
Fri Feb 07, 2003 3:32 pm
Forum: mySQL & php coding
Topic: Update multiple rows with one query?
Replies: 2
Views: 1255

Update multiple rows with one query?

I need to update the date columb in every row to the reflect the current date. I know how to do the date but how do I update every row at once? Can I just leave out the WHERE ? I know I should try this before posting a question here, but I'm new to this, and it will take me forever to set up another...
by Tony121076
Fri Feb 07, 2003 3:18 pm
Forum: PHP General
Topic: Can a php page edit itself?
Replies: 1
Views: 1055

Can a php page edit itself?

I have a simple php page that stores and returns a few static variables... <? #!/usr/local/bin/php echo "$variable1, $variable2, $variable3"; ?> I need to update those variables from time to time, but I don't want two files to handle this one thing (one to store variables and one to update the stora...
by Tony121076
Mon Feb 03, 2003 4:22 pm
Forum: mySQL & php coding
Topic: Warning
Replies: 2
Views: 1355

Supress the warning

Try adding a @ in front of your line like this...

@if(mysql_result($result,0,"id"))
by Tony121076
Mon Feb 03, 2003 9:02 am
Forum: mySQL & php coding
Topic: How to write $table contains, instead of equals?
Replies: 1
Views: 968

I found the answer...

the answer is,

$query = "SELECT * FROM comp WHERE c_addr LIKE '%$kword%'";
by Tony121076
Mon Feb 03, 2003 7:38 am
Forum: mySQL & php coding
Topic: How to write $table contains, instead of equals?
Replies: 1
Views: 968

How to write $table contains, instead of equals?

I want mySQL to return rows in table "comp", where c_addr contains (but may not equal) $kword. I know how to write... $query = "SELECT * FROM comp WHERE c_addr = '$kword'"; but I don't know how to ask for rows that just contain, but may not equal my $kword. Is this even possible? Please help. Thank ...
by Tony121076
Sat Feb 01, 2003 3:11 pm
Forum: mySQL & php coding
Topic: Won't connect to second db?
Replies: 1
Views: 1002

Won't connect to second db?

I connect to database "one", and my queries work great. Then I close the connection and connect to database "two", but now all of my queries are producing errors because they are asking for one.table instead of two.table NOTE: I have changed the database names, and cut out irrelevant code: /* Connec...
by Tony121076
Sat Feb 01, 2003 9:48 am
Forum: PHP coding => General
Topic: Parse error declaring a variable in a function?
Replies: 3
Views: 954

My error - Missing quote 3 lines up

Thank you for taking the time to respond. I'm sorry to report that the error was being cause due to a missing quotation mark 3 lines up. I must had looked at it at least 10 times, and never noticed it.