Search found 66 matches

by superwormy
Mon Mar 24, 2003 7:32 am
Forum: Miscellaneous
Topic: Queued or Delayed Email, is it possible with PHP?
Replies: 7
Views: 4474

srry was away during weekend, keithp@logosoftwear.com


What you could do is write a PHP script to pull what to email out of MySQL and email it.

Then use cron to execute a task like this:

wget http://www.yourdomainname.com/schedulescript.php
by superwormy
Mon Mar 24, 2003 7:30 am
Forum: PHP - Code
Topic: delete everything after last /
Replies: 5
Views: 991

or:

$before = "/home/Administrator/file";

$temp = strrev ($before);
$temp = strstr ($temp, "/");
$temp = substr ($temp, 1);

$after = strrev ($temp);
by superwormy
Wed Mar 19, 2003 7:21 am
Forum: Databases
Topic: Images In MySQL
Replies: 9
Views: 2083

The MySQL manual actually reccomends NOT storing images in MySQL... so you know...

It's better to store the filename, and get it later.
by superwormy
Wed Mar 19, 2003 7:20 am
Forum: Miscellaneous
Topic: Queued or Delayed Email, is it possible with PHP?
Replies: 7
Views: 4474

Why not everytime someone wants to send an email, stick it into MySQL with a date / time field.

Then use a cron job:
http://www.unixgeeks.org/security/newbi ... ron-1.html


To run a script once an hour or whatever that pulls all the stuff thats not sent from MySQL and sends it...?
by superwormy
Wed Mar 12, 2003 7:46 am
Forum: PHP - Code
Topic: Regular expressions:Extracting<a href="blah.com"
Replies: 10
Views: 2708

Just as an added tip, you don't need Regex at all to do this, you can USUALLY do this much more efficiently with basic string matching. Unfortunately I don't have my script here that I wrote or I'd post it for you, but the basic idea is this: while (strstr ("<a ", $contents)) { $contents =...
by superwormy
Sun Mar 09, 2003 4:23 pm
Forum: Databases
Topic: MySQL Heap Tables / Making MySQL Faster :-)
Replies: 0
Views: 653

MySQL Heap Tables / Making MySQL Faster :-)

Just gonna link over here, you can respond in this thread though:


http://forums.anandtech.com/messageview ... did=996367

And this one too:

http://forums.anandtech.com/messageview ... did=996323



Thanks!
by superwormy
Wed Mar 05, 2003 8:14 am
Forum: Databases
Topic: SELECT field FROM table ORDER BY RAND() LIMIT 1 !!!!
Replies: 4
Views: 1381

Try running the query twice, and use the result from teh second query. Another thought would be to run a query like this: SHOW TABLE STATUS LIKE 'temp_cloak' And get the number of rows, then, use PHP to get a random number: $randomnum = rand (1, $array['Rows']); Then do your query: SELECT * FROM tab...
by superwormy
Wed Mar 05, 2003 7:20 am
Forum: Databases
Topic: SELECT field FROM table ORDER BY RAND() LIMIT 1 !!!!
Replies: 4
Views: 1381

What doesn't work about it on Linux?

I know there was actually a bug in the Windows version of MySQL where the first time you did an ORDER BY RAND() it wouldn't give you a random number...
by superwormy
Mon Feb 24, 2003 7:01 am
Forum: PHP - Code
Topic: Changing URL's
Replies: 9
Views: 2698

$newlink = str_replace ("", "<a href=\"", $oldlink);
$newlink = str_replace ("
", "\">mylinkname</a>", $newlink);
by superwormy
Mon Feb 24, 2003 6:59 am
Forum: Miscellaneous
Topic: folder/485 not folder/?id=485
Replies: 13
Views: 9373

<FilesMatch "^scriptnamewhichlookslikeafolder$">
ForceType application/x-httpd-php
</FilesMatch>
by superwormy
Thu Feb 20, 2003 7:56 am
Forum: PHP - Code
Topic: Query Strings - detecting and accessing
Replies: 3
Views: 976

All of the varialbes passed by the query string are set in the $_GET array. So if you access this page: http://www.domainname.com/index.php?myvariable=mynewvalue&anothervar=mysecondvalue Then $_GET['myvariable'] will equal 'mynewvalue' Also $_GET['anothervar'] will equal 'mysecondvalue' If you w...
by superwormy
Thu Feb 20, 2003 7:52 am
Forum: PHP - Code
Topic: $_POST forgets value when script recalled with <a href
Replies: 6
Views: 1203

Use $_REQUEST instead of $_POST / $_GET.

$_REQUEST will use either the GET or POST variables, depending on which on eis set.
by superwormy
Thu Feb 13, 2003 2:00 pm
Forum: PHP - Code
Topic: Two header("Location: ")... in one page...
Replies: 5
Views: 1210

Daven is wrong, you can have multiple calls to header() in teh same page. BUT, if you try and set the same HTTP-HEADER twice, the first just gets overwritten. Think about it, how are you going to tell a browser that your file is at both http://www.domainname1.com/index.htm AND http://www.domainname2...
by superwormy
Thu Feb 13, 2003 9:51 am
Forum: PHP - Code
Topic: isset() Problem
Replies: 5
Views: 1062

YOu need to have a way of identifying the client and setting the SID for that client, then having the client passign the SID to each page they visit. You can only do this by setting a session cookie or generic cookie, or passing it through the URL. If you don't do one of those things, then no, there...
by superwormy
Thu Feb 13, 2003 9:48 am
Forum: PHP - Code
Topic: post the variables to two pages?????
Replies: 5
Views: 1351

You can't using strait X/HTML, but you could use fsockopen or that PostToHost function I keep seeing around to make the second post to the second page.

http://www.php.net/fsockopen
http://www.faqts.com/knowledge_base/vie ... 039/fid/51