martin5211 37 Posting Whiz in Training

I haven't found a bit tiny thing of democracy yet... For all it is worth, issues like double-posting shouldn't be existing for good visibility/functionality. But, one good reason isn't enough.

Also, comments in reputation should allow a feedback to be fair. That's very rustic.

I think user feedback should be taken into account.

martin5211 37 Posting Whiz in Training

>California's unemployment number just jumped to 11.2%.
California could be a country in is own right, comparable to some nations in Europe; capital and population wise. California is one of the most socialist state in USA, perhaps only second to New York. See the results.

California is communist, isn't it? For that reason, such numbers.

martin5211 37 Posting Whiz in Training

The same marketing text found at:

http://www.tekla.com/international/solutions/building-construction/construction-companies/site-management/Pages/Default.aspx

This is a construction company. Websites are managed differently. To maintain a site, first of all, programming tasks differs substantially from design tasks. Programming tools could be mainly editors, IDEs and debuggers. Design tools: image editors like Gimp, Photoshop; multimedia authoring packages like Flash; vector drawing tools like Illustrator. Word for copywriting (or OmegaT for multilingual). Finally, browsers to review and test websites.

Project management and CRM software can make the process 'staged' and organized. ProjectPier (based on activeCollab) is an example of a good website management tool.

peter_budo commented: Thank you for notification on copy rights +17
martin5211 37 Posting Whiz in Training

Window at 1024x768. This is evidence:

[img]http://novo.ath.cx/misc/Imagen%201.png[/img]

martin5211 37 Posting Whiz in Training

Paste the code at end, outside from the last conditional that checks $progyear variable.

Test the MySQL query directly from phpMyAdmin 'SQL' sheet if returns any result from your tables... I'm using yearid and exampapers fields with coincidental values, that's crucial to make a query on multiple tables. Maybe your field is courseyeartable.courseid. Modify it according to your requirements.

martin5211 37 Posting Whiz in Training

I think you cannot use Javascript to access local files by default, that would be the law of the jungle, a giant security hole... easy to spoof or block client domains, phishing and browser hijacking would be everyday issue for many users.

Today, Internet Explorer have security levels and some topics like ActiveX execution is into a more controlled ambient, disabled by default or prompting to user some confirmation.

For that reason, ActiveX from Javascript less used today.

martin5211 37 Posting Whiz in Training

Use a SELECT...JOIN query to get results from related tables e.g.

SELECT * FROM courseyeartable JOIN elements ON (yearid = exampapers) WHERE courseid = $programme

I have seen an error in your code, $subjectname is a string, so checking for numeric value will always get FALSE. (look at the top of your source code where are assigned the $_GET array to simple variables).

This is the final code, try to customize it for your needs:

echo "<br /><br />";
if($subjectname != null && is_string($_GET["subjectname"]) && $programme != null)
{
	$sql = "SELECT * FROM courseyeartable  JOIN elements ON (courseyeartable.yearid = elements.exampapers) WHERE elements.subject = '".$subjectname."'";

	$result = mysql_query($sql,$conn);

	while($row = mysql_fetch_array($result))
	{
		echo $row['course_year'].' '.$row['subject']."<br />";
	}
}

This example shows course_year column from courseyeartable and subject from elements, you can use more fields.

martin5211 37 Posting Whiz in Training

That's weird... maybe, your computer got infected with spyware and for that reason is blocked the access to windows firewall panel. Try to scan & clean with any anti-spyware tool (like Spybot or Anti-Malware, both software are free to use). Don't forget to perform a database update before use it.

martin5211 37 Posting Whiz in Training

Misticles, please try to make a more precision or give more details what do you want to perform. I mean, the code is working right, I can't see what is your real issue.

You're performing only two queries in the code, one for the second drop-down and the other for the last one. Maybe, you want to perform a query with the data selected from both tables joined, is that what you want to do?

martin5211 37 Posting Whiz in Training

It will work with minimal changes, if your table comply with the structure mentioned previously. Modify 'customers' table name using your own. Make a DB connection too if doesn't exist. If you do echo fieldnames[2]; after the loop you can see if that is the suitable field. strtotime() should be '+7 days'.

Some conditionals will be almost mandatory for more control. This code will always add a field using only the third column as reference. You want only two fields, use this

while ($row = mysql_fetch_array($result)) {
	$fieldnames[] = $row[0];

        if(strpos($row[0], '-')){
             $date_fields[] = $row[0];
        }
}

We create another array or use a variable incremented ($a++) to count the instances found and if that number is > 2, perform an update instead of create.

If you want to use the last date field as reference, you will need to apply this code and make an addition on fieldnames[] index.

martin5211 37 Posting Whiz in Training

Dear Sir, I find your capability to handle the situation to be entirely insufficient and I have therefore taken proactive measures to rectify matters to my personal tastes, exercised posthaste and with extreme prejudice. Best Regards.

Is that a HR letter or a simple memo? Each first letter on each line hides a (inimical) subliminal message :)

martin5211 37 Posting Whiz in Training

Basically, you can do:

$query = "SHOW COLUMNS FROM customer"; 
	 
$result = mysql_query($query) or die(mysql_error());

while ($row = mysql_fetch_array($result)) {
	$fieldnames[] = $row[0];
}

list($d, $m, $y) = explode('-', $fieldnames[2]);

$timestamp = mktime(0,0,0,$m,$d,$y);

$newts = strtotime("-7 days", $timestamp);

$newdate = strftime("%d-%m-%y", $newts);

$query = "ALTER TABLE customer ADD `".$newdate."` VARCHAR(60) AFTER `".$fieldnames[2]."`";

$result = mysql_query($query) or die(mysql_error());

MySQL SHOW COLUMNS will display the table structure. After that, we populate an array with field names and we use the third field to create a new timestamp. strtotime() is our best simple chance to discount days, we format the timestamp to present a new date. Finally, MySQL ALTER TABLE will add the field after the other one.

Well, I subtracted days instead add... you can change this on strtotime() as well.

martin5211 37 Posting Whiz in Training

What does fulfil <b></b> tags into <a href="..." code ?

$Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '<a href="javascript<b></b>:go(\'${1}\')">${1}</a>', $Text);

$Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '<a href="javascript<b></b>:go(\'${1}\',\'new\')">${2}</a>', $Text);

Those tags only displayed when I change to plain text.

martin5211 37 Posting Whiz in Training

Look at your apache httpd.conf if the line that includes your vhosts file isn't commented.

Try to use:

NameVirtualHost *
<VirtualHost *>
	DocumentRoot /cmsdata/cms/sites/home
	ServerName www.ocms.com
	ErrorLog /usr/local/apache/logs/o-error_log
	CustomLog /usr/local/apache/logs/o-access_log combined
</VirtualHost>

<VirtualHost *>
	DocumentRoot /cmsdata/cms/sites/us
	ServerName www.uscms.com
	ErrorLog /usr/local/apache/logs/ous-error_log
	CustomLog /usr/local/apache/logs/ous-access_log combined
</VirtualHost>

also add in your /etc/hosts:

127.0.0.1    www.ocms.com
127.0.0.1    www.uscms.com

With these settings should be ok, at least working from the same machine.

martin5211 37 Posting Whiz in Training

Some computers have issues if you do a test from external IP using the same computer due to a NAT conflict. If you want to test simply if your program works, 127.0.0.1 or localhost interface. To do a test between "machines" on a local area network, you can setup a virtual machine (e.g. VirtualBox) and configure the interface as bridged network. A test through internet would be good to do it between two different physical connections.

martin5211 37 Posting Whiz in Training

Could be from MSN Messenger, uPnP, try to close all programs and watch if the traffic changes. Hack attempts in proximity with neighbors happens usually with wireless communications. Also, try to scan your computer for spyware/malware (Spybot or Anti-Malware does).

martin5211 37 Posting Whiz in Training

I didn't found your modem model at www.portforward.com. That site includes some guidelines to open/forward ports to your computer. I think this modem is working as bridge modem only, so your computer connects directly to your ISP. Try to look at your computer if the firewall blocks WoW.

martin5211 37 Posting Whiz in Training

dont underestimate the others. may be ahmadjhoney is new in this field.
hello ahmadjhoney you can learn about mail server from this link
http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci876011,00.html

Who is underestimating? I agree with ShawnCplus. There is no way that we can understand him if he wants to formulate a question in such imprecise way. My concern, this is not a question related to PHP. Giving that tutorial and you delivering another simplest, what easy is to send an email in PHP and what is a mail server... that may be already known by him.

You could take this with a little sense of humour or not, almost all of us we are programmers in real life, if you want to be get angry or feel depressed is your choice, but listening is an art, as well as respecting diversity of opinions and different points of view.

martin5211 37 Posting Whiz in Training

Use always the 'optimal resolution', that is the max available res. Activate Cleartype font smoothing from Display Properties.

martin5211 37 Posting Whiz in Training

No if you were to add the UNIX timestamp to the database as a UNIX timestamp then you could use the array from the database like this:

echo date( "M. j, Y" , $databaseArray );

This would work if you used the PHP time function when putting the date in the database. Although there is a format you can use that PHP can convert to a timestamp then you can use the date function like I just did.

I will look at it some more. :-)

I was talking about MySQL DATETIME and DATE field, there is a MySQL function to convert directly to UNIX timestamp:

http://dev.mysql.com/doc/refman/4.1/en/date-and-time-functions.html#function_unix-timestamp

So, you can use my example mentioned above, the mysql result would be a timestamp compatible with PHP date()

Also, you can format the MySQL UNIX timestamp with FROM_UNIXTIME(), this way SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(`date`), '%b. %e, %Y') FROM `my_table` MySQL FROM_UNIXTIME():

http://dev.mysql.com/doc/refman/4.1/en/date-and-time-functions.html#function_from-unixtime

MySQL Date Format:

http://dev.mysql.com/doc/refman/4.1/en/date-and-time-functions.html#function_date-format

martin5211 37 Posting Whiz in Training

I can't replicate your issue without the structure of your tables.

I'm testing your code here, seems to be working right with these tables

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

DROP TABLE IF EXISTS `elements`;

CREATE TABLE `elements` (
  `exampapers` text NOT NULL,
  `subject` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

insert into `elements` values('1','tom'),
 ('2','tom'),
 ('1','svenson'),
 ('1','taylor');

SET FOREIGN_KEY_CHECKS = 1;

and

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

DROP TABLE IF EXISTS `courseyeartable`;

CREATE TABLE `courseyeartable` (
  `yearid` int(11) NOT NULL AUTO_INCREMENT,
  `courseid` int(11) NOT NULL,
  `course_year` int(11) NOT NULL,
  PRIMARY KEY (`yearid`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

insert into `courseyeartable` values('1','1','2008'),
 ('2','2','2009');

SET FOREIGN_KEY_CHECKS = 1;

Testing server:

http://novo.ath.cx/d.php

martin5211 37 Posting Whiz in Training

amazing :)

I dreamed a dream ;-)

martin5211 37 Posting Whiz in Training

If that is a DATETIME field type, you can use UNIX_TIMESTAMP() like this SELECT UNIX_TIMESTAMP(`date`) FROM `my_table` then use date() to show it correctly

martin5211 37 Posting Whiz in Training
//$Text = "[url]http://www.google.com/";
$Text = "fdsfd_shttp://";

$Text = preg_replace("/\[url\]([a-z\:\/\.]*)\[\/url\]/",
					 '<a href="javascript:go(\'${1}\',\'new\')">${1}</a>',
					  $Text);
		

$Text = preg_replace("/\[url\=([a-z\:\/\.]*)\]([a-zA-Z0-9_\:\/]*)\[\/url\]/",
					 '<a href="javascript:go(\'${1}\',\'new\')">${2}</a>',
					 $Text);
			
echo $Text;

Missing braces...

martin5211 37 Posting Whiz in Training
martin5211 37 Posting Whiz in Training

Is that a question ? :)

Most simple mail() tutorial

http://email.about.com/cs/phpemailtips/qt/et031202.htm

martin5211 37 Posting Whiz in Training

When a blank page happens, you can do simply on the action page

echo '<pre>'; print_r($_POST);

to see what variables are being passed

martin5211 37 Posting Whiz in Training

The site passes validation test (http://validator.w3.org/) ?

Common situations with blank pages is due to a syntax error, and error reporting isn't enabled, cache fault... Try to use print_r or var_dump($_POST) if does make a difference.

martin5211 37 Posting Whiz in Training

US for americans wouldn't be the slogan?

I was thinking on Hawaii...

martin5211 37 Posting Whiz in Training

I saw a lot of new members... that's great if they are not joining from the same IP address, I mean, the same person :-O

martin5211 37 Posting Whiz in Training

The loop is before the mysql query... try to put backward

<?php
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
      mysql_data_seek($Recordset1, 0);
      $row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
do {  
?>
				      <option value="<?php echo $row_Recordset1['channel_name']?>"><?php echo $row_Recordset1['channel_name']?></option>
				      <?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
?>
martin5211 37 Posting Whiz in Training

If you were a beginner programmer, you will prefer to learn PHP or how to use Eclipse/Aptana with quasi-uncountable functionalities?

Netbean has a lot of controls and issues, preferable for Java and you want to use for PHP, that isn't problem at all. A software that runs over a java virtual machine, you will need also a good computer.

That's why I suggest to learn with the tools at your reach, if notepad seems to be like "the flintstones", use notepad++ with syntax coloring and auto indenting.

martin5211 37 Posting Whiz in Training

This is a popular subject, ask Google, you will see hundred of thousand threads like this, and that isn't a issue at all like fashion does. I am not trying fall low on such topic, only exposing why not notepad is a bad tool. You want quality, well that's in your mind.
Obviously, notepad isn't my tool now, Espresso does, but notepad and vi played and continuously play an important role and I don't feel embarrassment to tell this.
Look at Michelangelo works, you don't need a titanium with diamond peak chisels.

martin5211 37 Posting Whiz in Training

Ask to work from a Mac at EDS or Microsoft :) Fortunately, I haven't passed for that yet. Microsoft have very well discriminated their 'Apple' team. But similar cases succeed often on small companies, where you don't have administrator privileges.

martin5211 37 Posting Whiz in Training

Some companies will let you use your platform or IDE of your choice, other doesn't. Some software factories in Argentina aren't well equipped or better than India or Pakistan ones. Old computers running a buggy and sluggish outdated version of Eclipse, with spyware, keyloggers, testing code over old and overloaded instances of Tomcat on servers with a nice trade mark (and some spider web dissimulated), you don't want to know what are happening outsourcing to third-world :)
Work environment doesn't make you justice but you can be good indeed, using any IDE.

martin5211 37 Posting Whiz in Training

The thing is... the choice of an IDE is a very personal subject, maybe you like some features that other IDE doesn't have, there isn't anyone perfect and preferences will vary for example if you work at home, or a company. I have seen several developers disposing hours at some function that shouldn't take much only because they don't remember everyday functions or API. If you use notepad or editor like vi, you will not pass frequently for things like this. Status or not... 'the best IDE tool' will not you to convert in an expert, advanced programmer, rather lazy or comfortable one. In PHP, command-line compilers simply doesn't exist, so extras tool beyond syntax coloring or remembering doesn't make any great difference. If you have trouble with some code, DaniWeb or php.net for that.

martin5211 37 Posting Whiz in Training

A hammer is a hammer, maybe you want one lightweight, ergonomic, rubber handle with micropore, it's the same.

martin5211 37 Posting Whiz in Training

I visited some clients on-site and the only resource was only notepad. Notepad is installed on every computer, works every time, some quick changes on the code and done! Notepad is faithful.

martin5211 37 Posting Whiz in Training

If it is only an image URL, you can simply concatenate into an <img> tag after using the mysql query e.g. echo "<img src=\"". $row['image_url'] ."\" alt=\"\" />";

<?php
$query = "SELECT image_url FROM gallery WHERE id = ". mysql_real_escape_string($id); 
	 
$result = mysql_query($query) or die(mysql_error());

$row = mysql_fetch_array($result) or die(mysql_error());

echo "<img src=\"". $row['image_url'] ."\" alt=\"\" />";
?>
martin5211 37 Posting Whiz in Training

No problem, I could have continued the development anyway... regex for scrapping data and manipulating arrays can be a pain sometimes...

martin5211 37 Posting Whiz in Training

Anyway, would we good to know why you want to access a host file. If you want to block some domains you can do it directly from .htaccess files.

martin5211 37 Posting Whiz in Training

Hosts configuration file have global scope -address translation for any user- and it is stored on one location e.g. /etc/hosts, for that reason you cannot create individual configuration files. For example, it is possible to build a script to delete that file and copy the file suitable for that user, that change will affect every user on that server. By the way, hosts file only contain IP numbers and host names, there isn't a way to put user names there.

martin5211 37 Posting Whiz in Training

Could you show me the error displayed? I can't find a syntax error in your code... the error seems to be located on the course year selection, subjects drop down appears to be filtered ok.

martin5211 37 Posting Whiz in Training

made me remember Doom III and Paul Verhoeven's Starship Troopers.

Fonts are too big, that could make me move away from display, the background movie is pixelated. Use much Action as you can, like dynamic loading.

The site have a resemblance with glass and/or spatial images - holograms, perfect match for a gaming community... I think the sounds and music doesn't fit together well, unless a metal GUI (like some grunge, metallic or B&W textures, screws, rivets, dirt, engineering drawings, industrial photos, etc).

martin5211 37 Posting Whiz in Training

What could make a difference a microbe to avoid being crushed on the floor. We should be more realistic?

martin5211 37 Posting Whiz in Training

Leave MySQL user scope restricted only to localhost and/or 127.0.0.1, always create and use a different mysql user per database/site to avoid using root (if your mysql account is compromised e.g. through the configuration file stored in your web server, the user will not be able to drop all databases).

martin5211 37 Posting Whiz in Training

I know, but the modal window is only to catch up new members.

Anyway, login stuff is well remembered by cookies, really doesn't matter.

martin5211 37 Posting Whiz in Training

I noticed that after three months 'far' from DaniWeb. A little obtrusive or maybe different, I ignored it without giving much attention in less than one second. Pop-up blockers are very common nowadays.

I was thinking, would be great to implement with jQuery an accordion or another stuff to perform login on the same modal window, like a very 2.0 website :)

But, I know, I do bad suggestions... Member Login wouldn't be vital on the same approach Donation-Logout links.

martin5211 37 Posting Whiz in Training

'Spy' functionality is good, thanks!

martin5211 37 Posting Whiz in Training

bad network cable