Search found 44 matches

by derchris
Sun Jun 11, 2006 8:27 am
Forum: PHP - Code
Topic: Read a text file?
Replies: 29
Views: 6881

I don't know if there is any advantage or disadvantage in doing it this way,
but I will look better.
And you can have access to all the serials later in the Script if you need them.
by derchris
Sun Jun 11, 2006 8:23 am
Forum: PHP - Code
Topic: include module, catching directory as file
Replies: 12
Views: 3988

Try this: <?php include 'config.php'; $p=$_GET["p"]; if(empty($p)) { include "index.php"; //i made this include a file home.php if you are usign this for a site navigation then u want the url to b: site.com not site.com?p=home } else { if((strlen($p) > 20) or (strlen($p) < 4) or ...
by derchris
Sun Jun 11, 2006 6:13 am
Forum: PHP - Code
Topic: Read a text file?
Replies: 29
Views: 6881

Code: Select all

$serial  = array(serials => '12345', '67890', '09876');
by derchris
Sun Jun 11, 2006 5:34 am
Forum: PHP - Code
Topic: include module, catching directory as file
Replies: 12
Views: 3988

Why don't you just add another elseif, for example something like this - not tested. <?php include 'config.php'; $p=$_GET["p"]; if(empty($p)) { include "index.php"; //i made this include a file home.php if you are usign this for a site navigation then u want the url to b: site.co...
by derchris
Sat Jun 10, 2006 8:43 pm
Forum: PHPGD.com
Topic: online tshirt design
Replies: 7
Views: 9008

Merge the Text and the T-Shirt Image.
That should be pretty easy with GD and some line code.
by derchris
Sat Jun 10, 2006 8:36 pm
Forum: PHP - Code
Topic: Script not working on PHP5 (but did in php4)
Replies: 24
Views: 10622

Try to use CURL to open Webpages instead of fopen or fsockopen
by derchris
Sat Jun 10, 2006 8:24 pm
Forum: Linux
Topic: Which one is the best OS for a Server
Replies: 17
Views: 11558

There is no "Best Server OS".
You should use what you like.
I for example are using SuSE Linxu on my Root, and I'm more than satisfied.
by derchris
Sat Jun 10, 2006 8:16 pm
Forum: Linux
Topic: Oidentd
Replies: 4
Views: 4056

If you don't have one in etc, then you should create one,
There are several howtos which explain how to do a config file for it
by derchris
Sat Jun 10, 2006 8:12 pm
Forum: Databases
Topic: mysqli_sql_exception - 'No index used in query/prepared
Replies: 6
Views: 8431

I think it is because you set

PRIMARY KEY (`ID`),
UNIQUE KEY `ID` (`ID`)

which is somehow possible but should lead to errors, like in your case.
by derchris
Sat Jun 10, 2006 7:52 pm
Forum: Databases
Topic: mysqli_sql_exception - 'No index used in query/prepared
Replies: 6
Views: 8431

Looks like an error with your DB.
How does your table structure looks like ?
by derchris
Sat Jun 10, 2006 7:49 pm
Forum: Databases
Topic: MySQL SUM (what am I doing wrong?)
Replies: 11
Views: 1199

Try this. This should work. $sql = 'SELECT SUM(amount) AS total FROM `table`'; $result = mysql_query($sql) OR die(mysql_error()); if(mysql_num_rows($result)) { while($row = mysql_fetch_assoc($result)) { $total_paid = $row['total']; echo $total_paid; } } else { echo "No Data"; }
by derchris
Sat Jun 10, 2006 7:38 pm
Forum: PHP - Code
Topic: Read a text file?
Replies: 29
Views: 6881

You could put them all in an array and then check the input against it.
by derchris
Sat Jun 10, 2006 6:45 pm
Forum: General Discussion
Topic: Introduce Yourself!
Replies: 1043
Views: 780281

Hi Folks, my name is Christian. I'm from Germany, but living and working in Scotland. I have just started with PHP, but I was always able to get everything done so far with PHP just by using Google and stuff. Now I would like to do it on my own :D The Projects I'm working on are a CMS and a Webporta...
by derchris
Sat Jun 10, 2006 6:29 pm
Forum: PHP - Code
Topic: MySQL Display
Replies: 2
Views: 668

Re: MySQL Display

Here is how I would do it. I also changed your code a little. <? $color1 = "#CCFFCC"; $color2 = "#BFD8BC"; $row_count = 0; $username=""; $password=""; $database=""; mysql_connect("",$username,$password); @mysql_select_db($database) or die( ...