Search found 284 matches

Actual Results

Post Posted: March 3rd, 2015, 10:43 am

I'm surprised you feel like you need a pivot table. It looks like there's a 1:1 or 1:* relationship between an account and a contact. So, you can likely simplify your table structure. What I'd do is combine the things that can only be applied once to the contact into one table: SSN DOB Home Phone Ce...

Post Posted: July 5th, 2014, 5:05 pm

You have complete access to the DOM with:

getElementsByTagName();
getElementsByClassName();
getElementById();

It should be trivial for you to grab a hold of the element you wish to inject the video duration into with one of those functions.

Post Posted: May 13th, 2014, 5:00 pm

Any speed benefits of MySQLi over PDO are likely negligible. And you get the benefit of not having to reinvent the wheel, instead having battle-tested code at your disposal. Keep in mind, you can use a factory to determine the strategy your strategy object uses. You might not even need the wrapper i...

Post Posted: May 12th, 2014, 9:46 am

Your database idea has already been addressed by PDO. ;) For your mailer idea, you may also want to look into the Strategy Pattern. With that, generally speaking (since design patterns are purposely half-baked) you'd have one mailer object that would act as a wrapper API to various implementations t...

Post Posted: May 9th, 2014, 6:25 pm

Like most things, factories have their benefits and drawbacks. Have you read up on them? Are there any particular problems you're facing that you think would benefit from implementing one?

Post Posted: May 9th, 2014, 6:15 pm

Tip: never use the $_REQUEST super global array. It contains everything in GET, POST, and COOKIE. That means if you have something in two or more of those with the same name (which is plausible) you won't know exactly which version you're dealing with. If you have a cookie named 'blah' that contains...

Post Posted: March 14th, 2014, 12:16 pm

Thanks Nightslyr, if I could +1 that post I would. That was really helpful!! Going from what I read in your post I want to learn C++ for desktop applications, but Java is mainly for Android development, right? Also, what books/tutorials that I could use to start learning C++ and possibly Java (for ...

Post Posted: March 14th, 2014, 12:09 pm

@Spork, yeah, Mono is pretty great. The biggest issue is that there's still this perception that traditional open source languages (PHP, Python, Ruby, etc.) = *nix stack, while Microsoft languages = Microsoft stack. So, while it's definitely possible to use C#/.NET on linux, good luck finding a team...

Post Posted: March 11th, 2014, 9:17 am

C++ is newer than C (you know the post-increment operator? $i++? yeah, that's why C++ is named the way it is). It's not 'better' than C, but rather aimed at doing different things. C is really used for code that has to run close to the metal. Think operating systems. The Linux kernel is written and ...

Post Posted: March 11th, 2014, 9:00 am

Singletons are unnecessary in PHP precisely because scripts (generally) have the lifespan of a single request. Add that fact to the fact that objects are passed by reference by default, and all of these singleton repository/database wrapper classes I see floating around in bad code are useless. Ther...

Post Posted: September 2nd, 2011, 9:46 am

It would probably help if you explained what you mean by 'freeze columns/panes'. Also, what part should be frozen? Why aren't they frozen now?

Finally, is this for layout? Tables should only be used to display tabular data. Using tables for layout is the epitome of doing it wrong.

Post Posted: June 22nd, 2011, 4:50 am

I'd do something like this: [php]public function logged() { // Note, no 'global'. Why? Because our user object should // have a reference to the db. 'Global' breaks // encapsulation, one of the main components of OOP // Checking if the user is logged in the session table $sql = $this->db-...

Post Posted: June 20th, 2011, 7:51 am

You need to swap your quotes around:
PHP Code: [ Select ]
"SELECT * FROM users WHERE email='$email' AND pass='$pass'"
Variables are only interpolated if the entire string itself is double-quoted. You'll also need to fetch your results as mysqli_query simply returns a resource. Finally, you can't mix...

Post Posted: June 19th, 2011, 3:59 pm

This: Each field may contain more than one value, in which case they will be seperated by a comma. Makes me think you should read this: http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html Comma-separated values in a column is generally a sign you're doing it wrong. This is espec...

Post Posted: May 22nd, 2011, 1:34 pm

A sheet of paper is fragile yet a telephone directory can stop a bullet. Look beyond the weakness of the language and examine its strengths. It took me a week, couple of nights without sleep and coffee so thick you could slice it before I figured out how to do this :lol: . When I have enough posts ...

Post Posted: May 21st, 2011, 8:39 am

[javascript]//Javascript Document function checkform(form) { var errors = new Array(); if (form.occupation.value == "") { errors.push("Please enter your occupation."); } var gender = form.elements["gender"]; var genderCount = 0; for (var i = ...

Post Posted: May 20th, 2011, 11:40 am

Your mistake is that you keep redefining your checkForm function over and over again. The end result is that only your last definition of the function, which checks the last input, actually exists.

You only need one checkForm function. Combine what you have.

Post Posted: May 17th, 2011, 1:33 pm

*eye twitch at more 'global' parameters*

You may want to look into dependency injection for this kind of thing.

Post Posted: May 17th, 2011, 1:31 pm

Both are used to facilitate polymorphism. Abstract classes and interfaces create is-a relationships. If a class implements a particular interface, or extends an abstract class, then an object of that class is also considered to be an instance of that interface or abstract class. Unfortunately, since...

Post Posted: April 1st, 2011, 5:35 pm

FWIW, using a member's registration timestamp as a salt is pretty common. It's unique, and unique to each user. Even better, if you keep that date hidden to everyone except that user when viewing the profile, it's impossible to guess. No one's going to want to brute force every second from the epoch.

Post Posted: January 20th, 2011, 12:08 pm

That still doesn't stop you from passing your config variables in through a function's argument list. When you have a function like:
Code: [ Select ]
<?php function doSomething($arg1, $arg2) { global $configVar; // code that does something } ?>
You're hiding the fact that the function needs your c...

Post Posted: January 19th, 2011, 1:28 pm

Exactly right. Globals lead to coupling rather than reduce it. They, by definition, break encapsulation. They're a crutch, and in the vast, vast majority of cases, a sign of poor design. See also: http://www.ozzu.com/programming-forum/classes-interfacing-php-t97447.html#p546909 Even though the link ...

Post Posted: January 15th, 2011, 5:54 pm

That doesn't stop you from passing the variable in through the function's argument list.

Post Posted: January 14th, 2011, 3:44 pm

Gah, why are you using a global variable? Pass $sys_url through your argument list.

Post Posted: January 14th, 2011, 12:49 pm

Ack, no, Visual Basic is horrible. If you want to learn a Microsoft language, choose C#.

That said, the description of what you want to do is so general that literally any programming language would suffice.

Post Posted: April 2nd, 2010, 4:33 am

Also, when was the last time you defragmented your HDD?

Post Posted: March 31st, 2010, 10:09 am

Remember to use session_start() on ALL pages you want to use sessions on.

Post Posted: February 23rd, 2010, 10:37 am

Try: [code]<?php if (isset($_POST['submit'])) { if ($_POST['op'] == "volvo") { echo "Volvo"; } else { echo "Saab"; } } ?> <!-- other HTML, including the beginning of your form --> <select name="op"> <option value="volv...

Post Posted: February 23rd, 2010, 10:32 am

I wrote a database access wrapper a while ago and made it public. Someone emailed me and asked me why I didn't use any PHP Optimization Techniques such as making some functions withing a class static (At least that is how I understood what he said... he said "i do not understand why have you n...

Post Posted: November 19th, 2009, 5:54 am

What are you talking about? This:
PHP Code: [ Select ]
class example { var $name; var $last; }
Is PHP 4 syntax. The keyword 'var' exists only to maintain backwards compatibility with legacy apps, and really shouldn't be used in modern apps as it's the same as declaring a data member public, which is a bad th...

Post Posted: November 18th, 2009, 2:33 pm

Introduction: The aim of this tutorial is to introduce people somewhat familiar with PHP to Object Oriented Programming with that language. Why version 5+? OOP in version 4 was more or less a joke. The language just wasn't equipped to do things the right way. Instead, bare-bones OOP functionality w...

Post Posted: November 18th, 2009, 2:17 pm

Hi there - I need some insight from those willing to travel back to the days when they were just considering the idea of programming. Here's the scenario to be considered: As a tech newbie I have been given a task. Someone has been generous enough to donate a website programmed in VB with a .NET st...

Post Posted: November 18th, 2009, 2:03 pm

Why aren't you using PHP 5's superior syntax and capabilities? PHP 4 isn't even supported by Zend any longer, and PHP 5 has been around for, what, 5 or 6 years already?

Post Posted: September 28th, 2009, 3:20 pm

To be honest, I don't see any real benefit to it. It's a wrapper around an argument list. That kind of thing has its place (for instance, perhaps its beneficial to put a wrapper around $_REQUEST to facilitate validation and protect its values from accidental overwriting), but I don't think it's appr...

Post Posted: July 8th, 2009, 1:50 pm

To be fair, since I've talked to the guy who wrote the blog post a few times, with point 10 he's not suggesting that one should use something like Smarty all the time. In fact, he's not high on using a template engine at all . He tends to use straight PHP for output. But, yeah, he didn't articulate ...

Post Posted: July 8th, 2009, 7:26 am

A blog article describing ten common signs of crappy PHP software. Some are straight forward (reinventing the wheel, needlessly playing with the error level). Others are sure to be the cause of controversy (using globals).

http://www.phpfreaks.com/blog/10-signs-of-crappy-php-software

Post Posted: June 30th, 2009, 4:43 am

Ok here I go again :) Having HTML embedded in code is just a really bad idea. Rather look at implementing a templating mechanism and have your code fill in the blanks if you will. For things like grid views what you might want to do is define static Strings inside some sort of 'tag' library. that w...

Post Posted: June 28th, 2009, 2:03 pm

The only PHP you would have in the actual HTML part is like loops to echo and format arrays. If done right, you wouldn't even need that. There's really no reason why you couldn't build these structures in the processing phase, store them in variables, and simply echo them at the right point in the ...

Post Posted: June 27th, 2009, 3:14 pm

1. In general, your PHP structure is a bit off. While you can freely switch between PHP and HTML in your files, it's generally not a good idea. The reason being that as your pages grow in complexity, it becomes harder to maintain when various technologies are strewn throughout. You should instead pr...

Post Posted: May 31st, 2009, 1:01 pm

I've done a lot of work in C# and occasionally a page or two in ASP (both in classic and .Net framework). I don't think you'll be alone. If you run into any issues, it's worth asking the question. Someone will most likely be willing to help you find the solution you need. I'm currently learning ASP...

Post Posted: May 22nd, 2009, 7:01 am

I have a site in which I want to add one of the " pick a font size " buttons to change the css. I was thinking about using inbeaded styles and getting PHP to print the font size (in pt) depending on what was clicked I am just not sure how to do this... Since my site users em for the rest ...

Post Posted: May 22nd, 2009, 6:56 am

Turning register_globals on is a bad idea: http://roshanbh.com.np/2008/02/register ... oblem.html

Post Posted: May 14th, 2009, 11:47 am

Well, first, your code doesn't make much sense from a logical standpoint. You essentially have: If 'advanced' has been checked: when 'advanced' is clicked, show an element. Else: when 'advanced' is clicked, hide an element. It's extraneous as a click on 'advanced' is the same as whether or not it's ...

Post Posted: May 8th, 2009, 8:41 am

If you have to use a raw global, you're doing it wrong. Yeah because having a bathroom in every room of your house is just such a good idea. :roll: :roll: Using the 'global' keyword is the antithesis of OOP. Objects should not need to have intimate knowledge of the code that uses them, and the main...

Post Posted: May 7th, 2009, 2:22 pm

Will that work for multiple db objects? As in:
Code: [ Select ]
$db1 = new Database(); $db2 = new Database();   $db1->connect(/* some db name */); $db2->connect(/* same name */);
From what I can see, unless $mysql_link is set in the constructor, hard coded when the data member is declared, or decl...

Post Posted: May 7th, 2009, 2:08 pm

Okay quick update, Have discovered with testing Javascript is working in IE. Used <body onLoad="speak()"> to test this. The speak function just alerted some text. So it is working. The things that are NOT working are onMouseOver, onMouseOut, onClick etc of <div> and <img>...

Post Posted: May 7th, 2009, 2:05 pm

Code: [ Select ]
class db {...} class utilizes_db {    public function add_exp($exp)    {       global $db;       $db->query(...);    } } $db = new db(); $obj = new utilizes_db(); $obj->add_exp(10);
:o If you have to use a raw global, you're doing it wrong. To the OP, there are a few ways you cou...

Post Posted: March 13th, 2009, 11:12 am

What if I make __construct private? Another question: What is the difference between self::function() or $this->function() ? 'self' is used to reference the class that the static member resides in. 'this' is used to represent the member of an individual object. So, 'self' = class-wide self-refer...

Post Posted: March 6th, 2009, 8:39 am

I am working on sessions now in php and i am totally lost on what i have to do is their anyone that can explain it in easy steps for me because i just do not get it. Thanks That's a bit of a loaded question. Essentially, you simply need to write:
Code: [ Select ]
session_start();
At the beginning of ea...

Post Posted: March 6th, 2009, 8:35 am

bretlee123 wrote:
Code: [ Select ]
$imagefilename = 'new';
$imagefilename = '../userimages/'.$imagefilename.'2.jpg';
  1. $imagefilename = 'new';
  2. $imagefilename = '../userimages/'.$imagefilename.'2.jpg';

im trying to join a variable to a string, is the code above enough to do this?

my current output just excludes the variable in between the two strings?

thanks


That should work.

Post Posted: February 13th, 2009, 11:29 am

I think the part I laughed the most at was his attempts to knock down his straw CSS layout. I mean, yeah, having one long, uninterrupted string of characters will break the layout. But how is that any worse than a table's cell automatically stretching to fill content, thereby squishing the rest of t...

Post Posted: February 13th, 2009, 10:36 am

Do: [code]<html> <head>    <script type="text/javascript">       window.onload = function()       {          var plusButton = document.getElementById('plusButton');          var minusButton = document.getElementById('minusButton');            plusButton.onclick = function...

Post Posted: November 24th, 2008, 3:52 pm

I can see newer languages taking over PHP as dominant technology choices in the near future Once upon a time Yahoo and IE were the most popular search engine and web browser respectively! However, Google and Firefox have overcome all their expectations later! Can the same situation happen with PHP ...

Post Posted: November 15th, 2008, 4:12 pm

Your problem stems from not understanding how requests and server-side languages work. Your value of $_POST['name'] which you use as a hidden field value will always be empty. Why? Because nothing sets it before the form is submitted to the bluemail script. PHP is a server-side language, meaning tha...

Post Posted: October 30th, 2008, 8:35 am

http://us2.php.net/manual/en/mysqli.real-escape-string.php Using prepared statements with mysqli automatically escapes incoming values. The real_escape_string function is there for those who don't want to use prepared statements. EDIT: See this link: http://dev.mysql.com/tech-resources/articles/4.1...

Post Posted: October 29th, 2008, 11:04 am

http://us.php.net/mysql_real_escape_string and scroll down to "Example #3 A "Best Practice" query", it's not really a BEST BEST practice but it's good enough. A tip, to instantly secure half of your input, just intval() all integers. That will solve half your problems. You don't...

Post Posted: October 6th, 2008, 9:17 am

Unless you already know C#, I'd stay away from VB.NET. Its syntax is UGLY, and it does all the same things C# does anyway.

So, for .NET, C# = good, VB = bad.

Post Posted: September 10th, 2008, 7:30 am

hi, i need help with my javascript code and i dont know what is wrong since the if and else condition is not working below is my code [code]<script type="text/javascript"> <!-- var currentTime = new Date();   var year = currentTime.getYear()+1900; var month = currentTime.getMonth...

Post Posted: September 10th, 2008, 7:13 am

Why not use a heredoc? Because that embeds HTML/data in the PHP. Using [s]printf you don't have to keep the HTML in the PHP.
Code: [ Select ]
sprintf(     file_get_contents('./templates/section.xml'),     $ID, $title, $author, $date );
True. However, since the OP was merely echoing the output directly,...

Post Posted: September 10th, 2008, 7:10 am

The only difference that I can think of between Web 2.0 and Web 1.0 is that Web 2.0 is about web application and user-site interactivity while Web 1.0 is based more on the layout/design. Maybe my view of Web 2.0 is a little flawed? I can point to numerous posts that agree with my view ... There's d...

Post Posted: September 9th, 2008, 3:49 pm

Why not use a heredoc? [code]$output = <<<EOT <table><tr><td><strong><a href="edit.php?action=edit&id=$ID">$title</a></strong></td></tr> <tr><td><small>Article written by $author on $date</small><...

Post Posted: September 9th, 2008, 3:44 pm

3. You don’t use too small font sizes. Long passages are harder to read, and to read brief sentences readers need more time. It holds also for links, buttons, forms, search boxes and other elements. Good news — in Web 2.0 the opposite is the case. What the hell is this trying to say? I mean, I unde...

Post Posted: July 29th, 2008, 3:46 pm

It seems to me that with the availability of the Iterator & IteratorAggregate interfaces , there's not much need for Member Visibility . (protected/private) My reasoning is that I would normally use protected/private to control which properties are returned during a foreach loop, with the Itera...

Post Posted: July 28th, 2008, 8:03 am

I'm also in the process of learning Javascript. What I'm trying to do is probably very simple, but for a new comer to Javascript it may be hard... Right now, I'm trying to do something very simple... Here is what I have so far [code]<html> <head> <title>Javascript test</title&g...

Post Posted: July 12th, 2008, 11:53 am

Bogey wrote:
put on it a captcha


Or just some basic data validation. You should never trust user-supplied values. Ever.

EDIT: I'm not suggesting that you don't already know this. It's directed to the OP.

Post Posted: July 7th, 2008, 10:58 am

wow... I'm going to start learning javascript in a few days and this really makes me think... thanks Nightslyr My pleasure. :) Two things to keep in mind while you learn JavaScript: 1. The DOM doesn't load right away. That's why it's best practice to wait for everything to load, using one of t...

Post Posted: July 7th, 2008, 10:31 am

thanks guys. its an IMG element. so, i SHOULD be ok. :( ie is evil, lol I don't think it's necessarily an IE issue. Chances are, the element you're assigning to test1 hasn't been loaded yet, so you can't run a document.getElementById() on it. You can't assign an onload event to an element that does...

Post Posted: June 27th, 2008, 4:59 am

I have a table. the first table document has a welcome text and the last td has a hyperlink. Is there anyway I can prompt an alert with the text thats on the first td? Note: there are no IDs/class for the table td in this case. [code]<table width="100%" border="0" cellspacing...

Post Posted: June 26th, 2008, 4:47 am

Depending on how your hosting is setup, you could always use the document root:
PHP Code: [ Select ]
<?php
 include($_SERVER['DOCUMENT_ROOT'] . 'config.php');
?>
  1. <?php
  2.  include($_SERVER['DOCUMENT_ROOT'] . 'config.php');
  3. ?>

Post Posted: June 25th, 2008, 11:43 am

I have not undermined the OOPs methodology. I tried to clear that just thinking about making your code OOPs based do not make your code modular. I saw many project which are OOPs based and still not modular. For correcting one error in many of those code i have to jump from method to method then to...

Post Posted: June 24th, 2008, 10:07 am

A friend and I are just getting started at our new web design business. We plan on taking every function that we can and making it modular, so we can easily build a website with just the pieces that we need and spend as little time as possible trying to integrate each piece. So what tips can the pr...

Post Posted: June 19th, 2008, 9:53 am

Many thanks for your help. I must now find a good reference book for JavaScript. Sams' JavaScript 1.3 in 24 hours has served its purpose, but I need a lot more! One book that I recommend to everyone is Pro JavaScript Techniques by John Resig. It's not a reference, per se, but it teaches a lot of 'b...

Post Posted: June 17th, 2008, 1:08 pm

I just have a simple question, let's say I have a hall full of seats (100 seats) and in a table in my database I have each seat and cell that is either true or false depending on whether a seat is taken or not ... would it be better to open the connection 100 times and then check for the true or fa...

Post Posted: June 17th, 2008, 1:04 pm

Just one more question: In the code-snippet window.onload=function() , is the word function the name of the function? Or is it a mandatory syntactic device in that particular context? To put the question more concretely: my application's code contains several functions called from the body of the c...

Post Posted: June 17th, 2008, 8:04 am

I am a relative novice in Javascript. So while I think I can see approximately what your code is doing, I cannot see how it does it. My rather elementary questions are: 1. Is line 1 equivalent to defining a named function in the <head> of the HTML document? 2. Does line 6 run through all and ...

Post Posted: June 12th, 2008, 2:53 pm

My HTML has a form with several drop-down selection lists. I need to retrieve the value(s) of the user's selected options. So far, I have only allowed a single option per <SELECT> and use the .selectedIndex to retrieve the value, using the following code: [code]  var signindex = document.form...

Post Posted: June 2nd, 2008, 2:12 pm

bluedragon wrote:
Yeah I am.


Hmm...looks like you're reversing the order of the query function's arguments: http://us.php.net/manual/en/function.mysql-query.php

It's: mysql_query($query_string[, $database_resource])

Post Posted: May 30th, 2008, 12:17 pm

Are you still getting the same error? Regarding SQL injection and XSS: SQL injection is an attack on your system. It is caused by a malicious user entering in something like: ' or 1=1'; Which can have several negative effects, depending on the nature of the SQL query that is being used to launch the...

Post Posted: May 30th, 2008, 7:48 am

Your variable is $add_topic, but you call it $add_topic_sql when you try running the query. Similarly, you should name your first $add_post variable $add_post_sql rather than $add_post_res. Question: why aren't you sanitizing the data before inserting it into your DB? You're wide open for SQL inject...

Post Posted: May 28th, 2008, 2:57 pm

Why not have a hidden input that contains some value that represents the referring page? An ID or perhaps even the URI itself? It can be generated on each page dynamically.

Post Posted: May 16th, 2008, 10:19 am

I'm not familiar with Tomcat. I'm assuming that's the database you're using to store the calendar info. Your problem most likely stems from the two (the database and your JavaScript) not talking to one another. Remember that JavaScript is client-side only. Unless you're using AJAX to send data to th...

Post Posted: May 14th, 2007, 10:52 am

I asked my host www.letshost.ie about help with web forms This is what they said “I suggest you contact a web designer/programmer about web forms as they will be able to provide the programming support you require.” We do not offering coding service as part of our hosting services im afraid. Please...

Post Posted: April 26th, 2007, 9:45 am

sivakumar wrote:
Hi Dave. I tried your code, still i can't able to get the REFERRER URL.


$_SERVER[HTTP_REFERER] isn't guaranteed to work. See the following link for more information: http://us2.php.net/reserved.variables

Post Posted: April 26th, 2007, 9:42 am

Be sure to include time for debugging in your estimate. Honestly, you can't go wrong by giving an estimate that's twice as long as you think it would take. Why? Every project contains unforseeable bugs, especially ones that force the programmer to grow beyond their current abilities or experience. I...

Post Posted: April 11th, 2007, 10:29 am

I'm currently using a down-and-dirty JavaScript calendar to display the training seminars my workplace hosts. It's not a very elegant script, but it does the job, and is simple (if tedious) to update. My issue with it is that it doesn't display every date as the same size. My setup is pretty simple ...

Post Posted: March 14th, 2007, 9:04 am

Try: [code] <?php ob_start(); if(isset($_POST['submit'])) { $to = "office@nzblackcurrants.com"; $subject = "Contact From Website"; $name_field = $_POST['name']; $email_field = $_POST['email']; $country_field = $_POST[...

Post Posted: March 8th, 2007, 10:42 am

Easy answer first: It looks like your MySQL login info is incorrect, or your MySQL isn't configured correctly. I'm not 100% sure, but that's probably the cause of the argument errors...if you can't connect to the database, you probably can't use the resource (your $link variable) as an argument as i...

Post Posted: February 19th, 2007, 10:14 am

Please re-read my original post. I already know how to make rollovers. In fact, I wouldn't do it with JavaScript, but with CSS, but I digress. My problem is that I'm having difficulty cutting/copying those buttons out of my layout in order to create the rollover graphics. Like I said before, by butt...

Post Posted: February 16th, 2007, 11:20 am

I've made a layout for a client, but I'm having trouble getting at the menu buttons I've made. Instead of making each button its own layer, I rushed and have all of the menu text on one layer, with the button backgrounds on two layers (one for the 'Home' button's active state, one for the rest). I'v...

Post Posted: January 25th, 2007, 7:20 am

Hi, I have a string variable in PHP which contains this: "index.php?mode=bla&page=2&name=n00b" I want to strip page=2 from this string but it could also be page=1 or page=1337 etc. Does anybody have an idea? I have tried preg_replace but I couldn't get it to work. Any help is appr...

Post Posted: January 25th, 2007, 7:16 am

flasheclipse25 wrote:
Oh okay, but it will still offer the security feature that i need.

I don't see "$email=safe" to prevent email injections. same for the name part.


I wasn't trying to rewrite your entire script, rather I was just showing you a better way to structure your validation.

Post Posted: January 25th, 2007, 6:40 am

If I'm reading the description of your problem right, your error stems from your validation logic cascade. Since you create your errors array and validate the name values only if the e-mail address is valid, you're skipping over your entire validation process if someone doesn't input an e-mail addre...

Post Posted: November 7th, 2006, 11:00 am

mysql_insert_id is what you need: http://www.php.net/manual/en/function.m ... ert-id.php

Post Posted: November 7th, 2006, 10:59 am

Yeah, multi-dimensional arrays can be a pain. Question: what you're doing is dependent on the hierarchy, correct? In other words (to use playing cards as an example), one cannot have a jack without a queen first, correct? If that's the case, looping through the array(s) is easy. The problem is makin...

Post Posted: November 7th, 2006, 9:34 am

I'm at a bit of a loss with what you're trying to do. Are the checkboxes something the user will access (I'm guessing it is, as your table suggests a store)? When the checkboxes are checked, you want the proper items in that category to be displayed, correct? If so, why not use a mix of PHP and Java...

Post Posted: November 6th, 2006, 9:48 am

Ah, so there are two text nodes in there. That's what I had originally thought, but it's good to see if confirmed. :)

Post Posted: November 6th, 2006, 9:46 am

To use the numbers, the vast majority of enlisted personnel do not have much, if any, college. I did some research into this last week as it was being argued on another board, and here's what I found, using the military's own demographic information (all fiscal year '04): Air Force (http://www.armyg...

Post Posted: November 6th, 2006, 7:42 am

Let's say I have a document with the following structure: [code] <html> <head><title>Blah</title></head> <body> <div>This chicken tastes <span style="font-weight: bold;">really</span> good.</div> </body> </html>...

Post Posted: November 4th, 2006, 3:33 pm

EDIT: never mind...it helped that I used the right filename...damn typo

Post Posted: November 3rd, 2006, 11:26 am

You can't have anything that's supposed to be put to the screen before a header function call. So, removing the <head> but keeping everything else won't work. <head> does not equal header. <head> means document head. The header function in PHP sends a HTTP header. They're not the s...

Post Posted: November 3rd, 2006, 9:09 am

You can't send header information after anything is sent to the browser. This means any HTML, even if it's only in the head. Your structure outputs HTML (header.inc) then tries to use a header to change the page's location (in shopping_cart.inc), which is what causes it to break. You'll need to figu...

Post Posted: November 1st, 2006, 7:07 am

A DOCTYPE, like others have said, is just a set of rules describing the kind of syntax the browser can expect. The reason why this, and validation, is important is because, in theory, if you follow the standards websites will look the same across platforms. The reality is that, while coding to stand...

Post Posted: October 30th, 2006, 11:56 am

The only other thing that I could see being wrong is the second statement:
PHP Code: [ Select ]
 
$querydone = mysql_query($query) or die(mysql_error());
 
 
  1.  
  2. $querydone = mysql_query($query) or die(mysql_error());
  3.  
  4.  

Post Posted: October 30th, 2006, 8:56 am

Elisabeth Castro writes some good books! She's pretty good, but I thought her XML book was a bit disorganized. I'm not a fan of the "I'll show you something now, ignore it for a few pages, then tell you what it is when you've forgotten about it" approach. For the database side of things, ...

Post Posted: October 27th, 2006, 3:43 pm

Unfortunately, I don't have Illustrator, only Photoshop. Should I still make the logo 300 dpi if it's only going to be used on the web?

Post Posted: October 27th, 2006, 7:43 am

I'm trying to create a logo for my fantasy hockey team, but I'm having problems transferring what I see in my head to something that looks non-frightening in Photoshop (CS, if that makes a difference). For my logo, I want an angry looking hawk head, but every time I try making it myself, it looks li...

Post Posted: October 27th, 2006, 5:14 am

I am making a chat program that has JavaScript to send a message onClick="SendIM();" with a <button>, is there anyway to also make it submit when a person hits the "Enter" button of the keyboard? I'm sure there's a way to do it. You'll need to have the handler (onkeypress,...

Post Posted: October 27th, 2006, 5:08 am

PS> The directive "Register_Globals" must equal "On" within your apache httpd.conf file for such sessions to work. This isn't recommended for security reasons but unless this is a commercial website that may attract hackers I wouldn't worry at this stage - good for the learni...

Post Posted: October 26th, 2006, 12:16 pm

What's that old saying about doctors being the worst patients? It's probably the same kind of thing with some artists being the worst customers for a web site. My advice is to have her make her own design. She's obviously picky in what she wants, so have her tweak her design as much as she wants. Si...

Post Posted: October 24th, 2006, 6:50 am

Just a quick question. How does something like the following work?:

Code: [ Select ]
var rows = document.getElementById('row_table').rows;


Specfically, .rows at the end of the statement. It looks like the property of the tables, but I just want to make sure.

Post Posted: October 23rd, 2006, 7:14 am

It's been a while since I used regular expressions, but try:
Code: [ Select ]
result_array.push(parseInt(rows[i].getAttribute('id').match(/^!(deleted_)\d+$/)));
That should (hopefully) tell it to match those rows that don't have "deleted...

Post Posted: October 23rd, 2006, 5:24 am

That appears to make a list. What I need to do is make a navigation bar like is on the site, using the buttons if possible. A navigation bar, logically, IS a list. That's why virtually every CSS menu tutorial uses them. All you need to do is either use your own bullet (like the red triangle you cur...

Post Posted: October 20th, 2006, 11:01 am

tarikdw1 wrote:
I've been searching for local news feeds for houston, texas do any body have any knowledge where i can find feeds? Thanks in advance for your help!


Your local television and radio stations, as well as newspapers, may have RSS feeds.

Post Posted: October 19th, 2006, 9:49 am

Take
Code: [ Select ]
onClick="return clickreturnvalue()"

out of the top-level links you want to be clickable (like your 'Web Design' link), then change the href value of those links to the addresses you want. It should work.

Post Posted: October 19th, 2006, 9:37 am

...Change the href attributes of those links to the correct pages rather than default.htm?

Post Posted: October 19th, 2006, 6:54 am

Is it possible for a function to have an array as its return value? In other words, would something like this work?: [code] function foo(){ var bar; for(var i = 0; i < 100; i++){ var blech = blah(); bar.style.backgroundColor = blech[0]; bar.in...

Post Posted: October 19th, 2006, 6:16 am

Hello i want to know how to get the values from the previous page, then in the next page their is also values, i will merge the values from previous page and the current page... i encounter problems... if i post the values from previous page to the current page... the current page will not display....

Post Posted: October 16th, 2006, 4:10 pm

You need to put "var" in from of your "bod" declaration in "printJanuary". IE automagically creates pseudo variables for all DOM elements with IDs. It gets upset when you try to assign values (in this case "document.getElementById('bod')") to these variables....

Post Posted: October 16th, 2006, 10:20 am

Epidemik wrote:
try css


CSS wouldn't allow the link to 'twist' (whatever that means) like he said he wants. He'd need either JavaScript or Flash.

Post Posted: October 16th, 2006, 9:45 am

Sorry that was short, hectic today For web development I would recommend PHP5 or Java or C#. Don't get me wrong PHP is a fantastic language but I think it's application by juniors is lacking. If you implement PHP then make sure you code your model right. I am dealing with a disaster in PHP dude to ...

Post Posted: October 16th, 2006, 9:06 am

Hi, does anyone have a code or could tell me where i could get one from that I can put on my site to allow people to bookmark my site? I also need one to allow people to make it their homepage aswell. thanks Dude, seriously, try Googling some of this stuff. Virtually everything you want is done thr...

Post Posted: October 16th, 2006, 9:05 am

Greetings, I'm not a web programmer by nature but have been asked to develop a sports card website and was given the following example site : http://www.grizzlysportscards.com how complex can creating a website be using the example site as a point of reference? and how hard would they b...

Post Posted: October 16th, 2006, 8:28 am

Well, I fixed my first issue. I was using "javascript/text" instead of "text/javascript" in my script call. D'oh! I have a couple more problems, though. I can't get my script to work in IE. It keeps telling me that there's a problem on line 14, character 4. I can't see why there'...

Post Posted: October 15th, 2006, 2:42 pm

Try <body onload="init()"> <script languag='javascript'>printJanuary();</script> </body> ? or you could be missing the () at the last line of your code ie window.onload = init(); I'm sure that's not the culprit. I have other scripts that use the same basic setup. B...

Post Posted: October 15th, 2006, 1:06 pm

I'm trying to test a script that will print out a calendar, but for some reason I can't write to the page. My script, which is in an external file, is this: [code] var W3CDOM = (document.createElement && document.getElementsByTagName); var months = ["January", &...

Post Posted: October 15th, 2006, 9:11 am

Setting the paragraph's width to 100% won't allow it to center as it takes up the entire width (100%) of the page. Do this: [code] #thumbnail { width:139px; height: 122px; background:#FFF; border:solid #CCC; border-width:1px 1px 1px 1px; } #thumbnail li{ position&#...

Post Posted: October 14th, 2006, 9:36 am

Hi, How can I center the image on this page http://www.bran.dk/123/test1.html As you can see I've added some code to show some text when you hover over the image. I can't use padding, because the images are not all the same size. - Lars N. Why did you put the image in a list item (<li>), espe...

Post Posted: October 13th, 2006, 4:57 pm

Yeah so anyway, I actually need to use some JS now, and I'm doing something in AJAX, basically I need to get the current value between some HTML tags and decrement it by 1. So... <span id="num" name="num">100</span> I need to be able to do something like num.innerHTM...

Post Posted: October 13th, 2006, 2:12 pm

heres what i did.
Code: [ Select ]
<?php function header($title){ if($title) } { $title="Articles"; } ?>
What you need to do is this: [code] <?php function header($title){ if($title){ $title = "Articles"; }...

Post Posted: October 13th, 2006, 10:55 am

If you're using PHP to read the data, try passing what you want to output through htmlentities().

Post Posted: October 13th, 2006, 4:37 am

I want to make colums with CSS so I can have all the inputs aligned. Anyone know how to do this? Ive looked but the only thing I can find is this http://jeffhowden.com/code/css/forms/ I do the following (and yeah yeah...I know I don't need both a name and ID for my inputs): [code] // My CSS: fo...

Post Posted: October 12th, 2006, 2:42 pm

Much better, thanks Nightsylr. Does the whole page have to be setup with div tags then? Because I already have some of the images/text aligned with div absolute tags and its still overlapping. I'm assuming probably because the border of the webpage is set using a table tag with no div tags. Is that...

Post Posted: October 12th, 2006, 11:25 am

Guess I've never known how to do this, looked at htmlgoodies and searched through other pages and never found a clear answer. I have used div tags to set positions for images and ads that look fine on my screen (1280 X 1024) then go to work and use a different resolution and things are floating on ...

Post Posted: October 12th, 2006, 9:28 am

I can get it to display the months, but only the first appointment is being displayed. I think the problem may lie in the for-loop, but I can't see it. I'm going to post my code below in the hopes that someone can help me see why the other appointments aren't being displayed. [code] <!DOCTYPE htm...

Post Posted: October 12th, 2006, 7:14 am

I decided to make a new post as I worked on your code, and the code block is pretty long. Hopefully the mods won't mind the double post. I haven't tested this as I'm not exactly sure how your HTML is using the JavaScript, but see if the following will work: [code] <style type="text/css"...

Post Posted: October 12th, 2006, 6:36 am

The problem I see is that you're not using the
Code: [ Select ]
switch (expression){ case conditional: do stuff if the conditional = expression; break; }
syntax other than where I explicitly wrote it in my first post. You'll have to do the same kind of thing every place where you...

Post Posted: October 12th, 2006, 5:46 am

I think you could do something like this: In the CSS, make new rules for the watches your department has (I'm going with three watches as you mentioned three different colors in your post): [code] div.watch1 { background-color: green; } div.watch2 { background-color: b...

Post Posted: October 12th, 2006, 5:11 am

Why bother? Even if you disable right-clicking, all anyone has to do is view the source code via the browser's menu to grab your HTML. If they want to print it, they can then save a copy of your source code and, at most, they'd have to change whatever relative paths you have into absolute paths to g...

Post Posted: October 10th, 2006, 11:35 am

well, I mean how can I search it in php or html (using javascript)? Like I said before, regular expressions are your friend in this regard. They allow one to search a string on text against a pattern that you define, and if you want, replace what you found with something else. They can be rather co...

Post Posted: October 9th, 2006, 11:06 am

sorry guys ,m still searching answer ....... as i said earlier i want to know the architecture / logical design of web forum i.e. the way forum work ,variables and functions and interation between them.... i make it more clear....general working of any forum....not any particular forum's documentat...

Post Posted: October 9th, 2006, 10:59 am

I am trying to get 100% tables to sit to the right of a float:left div. It works perfect in Firefox, but in IE the 100% tables get bumped to the bottom of the div. Please look at my example here: http://musicalfans.net/floatleft.html Does anyone know a way to fix this in IE? Ive tried getting it to...

Post Posted: October 9th, 2006, 10:47 am

I've made a revamp of my website thanks to the feedbacks. Will be making it even better when I have the time. Like I said before, remove the music! There's no reason for your site to have embedded music. It's cheezy, distracting, and since you've removed the ability to turn it off , it's more than ...

Post Posted: October 5th, 2006, 10:06 am

Space in text field? If you're using notepad in the find feature just create one space with the spacebar and you can search for an empty space. He might mean searching for a space in a form's input element. If that's the case, regular expressions are the way to go. I think [ ] would be the characte...

Post Posted: October 5th, 2006, 7:16 am

So I thought of creating a function but for some reason I can’t get it working correctly, anyone could point my mistake here? [php] <?php function mysql_fetch_array_safe($result, $fetch_array = false){ if($fetch_array){ $row = array(); $row = mysql_fetch_array($result); foreach($row as $index){ ...

Post Posted: October 4th, 2006, 11:26 am

CSSPlay ( http://www.cssplay.co.uk/ ...thanks grinch!) features a few flyout menus created entirely in CSS. This will eliminate the potential problem of the user not having JavaScript enabled. Check the last link in my previous post ... :wink: <3 LMAO! Well, at least the OP knows...

Post Posted: October 4th, 2006, 11:00 am

CSSPlay (http://www.cssplay.co.uk/...thanks grinch!) features a few flyout menus created entirely in CSS. This will eliminate the potential problem of the user not having JavaScript enabled.

Post Posted: October 4th, 2006, 10:57 am

It's pretty easy to write your own JavaScript validator. I've written one myself. The biggest problems I ran into was making sure my main function grabbed the correct element when the form was submitted (somewhat confusing as I used an external JavaScript file with no JavaScript at all within the fo...

Post Posted: October 4th, 2006, 10:52 am

THE EXTRAORDINARY WEBSITE !!! I currenly have a webpage(the link above) and would like to know of any nice templates which are compatible to be used on that kind of website or anything else that can make this single page more interactive/nicer. Currently, it looks plain and novice. Thanks. My thoug...

Post Posted: October 3rd, 2006, 5:18 am

Try removing the quotes around $title.

Post Posted: October 1st, 2006, 10:03 am

I generally take the opposite approach. Structure and functionality are what I focus on first as the graphical side of things won't matter if the site's foundation isn't solid. Moreover, the visual side of a site tends to change more often than the logic behind it, so as long as the logic is well de...

Post Posted: September 30th, 2006, 8:03 am

His problem is that some of the colors he chose -- most notably with the borders around the table cells -- don't look the same in IE and Firefox. It's obviously a CSS problem, but because he's using Frontpage in click-and-drag mode, the code is practically unreadible, so it's hard to see exactly whe...

Post Posted: September 29th, 2006, 3:12 pm

This is really interesting. Am I right in thinking that statements like:
Code: [ Select ]
Ford.prototype = new Car();
Are what basically handle the inheritance? And that it and the invokation of the call method basically do something equivalent to: [code] function Ford(model, year)...

Post Posted: September 29th, 2006, 7:43 am

The only advice I can give you is to erase Frontpage from your computer. Then, shoot the CD with a firearm, if you have one. Then burn it, and flush the ashes down the toilet.

That code was practically unreadible. The amount of whitespace, inline CSS, and JavaScript...unreal.

Post Posted: September 28th, 2006, 6:01 am

This is some interesting stuff. Two questions:

Could the method getInfo() be placed within Car's constructor?

Is the call method built into JavaScript? If so, what, exactly, does it do?

Post Posted: September 28th, 2006, 5:50 am

Why is it better to learn HTML than use an editor? I've found that sites made entirely by the click-and-drag mode found in WYSIWYG software generally fit at least two criteria: 1. The design isn't rendered properly when the site is published. Maybe it looks okay in IE, but it breaks in FF (or vise ...

Post Posted: September 27th, 2006, 3:22 pm

I've tried Dreamweaver. Hell, I have an older (MX) copy on my computer right now. But I found that I would have to edit the code it created to do what I wanted to do in a cleaner manner -- replace a table layout to a CSS layout, use external CSS instead of the crap it spews in the head of the docume...

Post Posted: September 26th, 2006, 8:55 am

Enigmatic wrote:
PHP = Wuff !


... :?:

Post Posted: September 26th, 2006, 8:11 am

True, true. I use XHTML/CSS for everything myself, but I just didn't want to frighten the OP any more than I had to. Getting into web development is a daunting task (as I'm learning with PHP...simple in the beginning, but man, it can get complicated with the OO stuff).

Post Posted: September 25th, 2006, 7:53 am

CSS can, in a sense, resize a page. Use percentages for width and height rather than pixels or ems. So, if you know your main image (which takes forever to download, BTW...you really should lower its filesize) will take up 60% of the screen, code it as such: [code] <img src="blah.jpg&quo...

Post Posted: September 21st, 2006, 9:25 am

Refresh your browser, because they look different to me. .uk: http://www.nightslyr.com/uk.jpg .za: http://www.nightslyr.com/za.jpg .uk has a 16px font, just like you coded in its CSS. .za has a 14px font, just like you coded in its CSS. In other words, your h1 tags are being displayed correctly in b...

Post Posted: September 21st, 2006, 8:29 am

Your font size in .uk is 16px. In .za, it's 14px. From what I can see, your problem stems from your SubtitleBoldtxtPad class. In both .css files, it makes the text 16px. So, in .za, your h1 text "Discover how to optimise (optimize) your website with professional Web Site Marketing Report secret...

Post Posted: September 21st, 2006, 8:23 am

EDIT: Fixed the link. Looking at it now...

Post Posted: September 21st, 2006, 8:04 am

It looks to be correct to me. You've defined your h1 tag as:
Code: [ Select ]
h1 { font: 14px Verdana, Arial, Helvetica, sans-serif; text-transform: capitalize; color: #000066; background: #F4F4F4; padding: 5px; }
From what I can see, your website displays it as a 14px fo...

Post Posted: September 19th, 2006, 11:44 am

PHP Code: [ Select ]
 $title =$record->ffield("245", "%a"); $isbn =$record->ffield("020", "%a");
PHP Code: [ Select ]
$title=""; $isbn="";
I'm no PHP expert, but it looks like you're writing over the values you initially put into your $title and $isbn...

Post Posted: September 19th, 2006, 9:14 am

I was wondering, are there any freeware database design programs out there? I've always had trouble creating my own normalized databases... I just can't seem to visualize them in their final form.

Thanks. :)

Post Posted: September 14th, 2006, 6:50 am

I can think of two cons right off the bat: The vast majority (I literally mean somewhere around 99%) of sites I've encountered that have used frames have looked very amatuerish, most likely stemming from people who don't know how to hide frame borders. As a user, I feel more likely to purchase a ser...

Post Posted: September 13th, 2006, 11:39 am

This is a theory question. I understand why one would pass variables by reference to a function. I remember doing a lot of that in my C++ days in college. What I don't get is passing a return value back by reference. An example (using PHP) would be something along the lines of: [php]function &ex...

Post Posted: September 13th, 2006, 5:15 am

That did the trick. Thanks a bunch! :D

Post Posted: September 13th, 2006, 4:40 am

Thanks, ATNO. Looks like my communication degree is finally paying off. ;)

Post Posted: September 12th, 2006, 9:28 am

Hate to do this, but this problem is really bugging me, so *bump*.

Post Posted: September 12th, 2006, 9:25 am

So.. now here is another dumb question to you all... whats the difference between CSS, html, javascript? what are they used for? sorry in advance, im so new at this... i take things all in better by "doing" too. Grinch provided some great links, but if you're like me, you might get overwh...

Post Posted: September 11th, 2006, 4:18 pm

It was messy and hard work, but my beloved Pats got off to a winning start yesterday :handsup: Sign of a good team (I hope) winning while not playing well and not having everyone available. BigWeb's Seahawks's won a game purely decided on field goals! Bigweb - how do you like the trade of Deion Bra...

Post Posted: September 11th, 2006, 3:42 pm

The problem with programs like those (WYSIWYG programs...What You See Is What You Get), at least in my experience, is that they create bad HTML when someone does things in design mode (click-and-drag mode). Frontpage, in particular, generates horrible code. Dreamweaver is much better in this regard,...

Post Posted: September 11th, 2006, 8:53 am

I have an issue with a select input. I was trying to help out another poster on here a week or so ago with having a div appear if a certain select option was chosen, and remain hidden if it wasn't. Code is here: [code]/* javascript code */ var W3CDOM = (document.createElement && docu...

Post Posted: September 5th, 2006, 10:01 am

Well, I got it to work in Firefox, but not IE. I'm not sure why IE is rejecting it, though. [code]/* JavaScript stuff */ var W3CDOM = (document.createElement && document.getElementsByTagName); function init(){ if (!W3CDOM) return; var formname = document&...

Post Posted: September 5th, 2006, 8:55 am

I think something along these lines would work: [code]/* This is the JavaScript (I like keeping my JavaScript separate from my XHTML, so this should go in an external file) */ var W3CDOM = (document.createElement && document.getElementsByTagName); function init(&#...

Post Posted: September 4th, 2006, 2:34 pm

Well, this problem was basically a way for me to hone my JavaScript skills. I've been working on various problems/projects to get myself up to speed on the language. I would only use JavaScript validation as the first step, not the last, and I'd definitely use PHP regardless. I got the JavaScript va...

Post Posted: September 1st, 2006, 4:34 pm

Note to self: next time, put your return statements AFTER your alert output, duh!

Post Posted: September 1st, 2006, 3:26 pm

Well, I think I'm about halfway home on being able to get the thing to work. I've confirmed, via alert dialogue boxes, that I'm able to get a hold of the form when it's submitted. Now my problem seems to be the subroutines somehow not getting the form's inputs. In the code I have below, I've taken o...

Post Posted: August 31st, 2006, 10:19 am

I hate to bump this up, but this problem is really bugging me. I've tried two other methods of getting to the form's input values, and neither worked. I know there are ways of doing form validation with JavaScript that's inside the html file that holds the form, but surely there must be a way to do ...

Post Posted: August 31st, 2006, 7:51 am

Aren't Mambo & Joomla the same product ? :scratchhead: I liked Mambo when I tried it. They basically are the same. Joomla is the new form of Mambo, and I believe it's backwards compatable with Mambo. I tried Joomla, but hated it. I felt there was too much run-around when it came to making compo...

Post Posted: August 30th, 2006, 7:21 am

I'm currently trying to test a simple form validator, but it doesn't appear that I'm getting a hold of the form or its inputs. I'm trying to keep the JavaScript code independent from the html, so I'm using an external JavaScript file and no JavaScript code at all in the html file. Here's my code: [c...

Post Posted: August 30th, 2006, 7:10 am

I like PHP-Fusion myself, so be sure to check it out if/when you visit the link ATNO posted.

Post Posted: August 30th, 2006, 5:33 am

It didn't work because he didn't give you correct inline CSS. If you're doing an inline style, do this:
Code: [ Select ]
<body style="background-color: #ffffff; margin-left: 0; margin-top: 0;">
Inline styles and block styles use the same syntax for their property: attribute...

Post Posted: August 28th, 2006, 11:33 am

D'oh! I'm an idiot sometimes. :oops:

Thanks for finding the typo. :D

Post Posted: August 28th, 2006, 8:54 am

Yup, the entire thing. Like I said before, I haven't tweaked the CSS at all. It's exactly the same as what is on the original site.

Post Posted: August 28th, 2006, 7:27 am

I can't seem to get the menus you showed me to work. I've been testing the horizontal one, and nothing happens. I use the following code: [code] <div class="menu"> <ul> <li a href="#">Home</a></li> <li a class="drop" href="#"&g...

Post Posted: August 28th, 2006, 6:22 am

Interesting...how would one go about making the first level vertical rather than horizontal?

Post Posted: August 28th, 2006, 5:11 am

PHP Code: [ Select ]
 $number_of_files = count($_FILES['userfile']); for($i=0;$i<=$number_of_files;$i++) { if (!$_FILES['userfile']['size'][$i] == 0) { if ($_FILES['userfile']['size'][$i] > $MaxSize) {
When will the size of the file ever be greater than the maximum if it's equal to 0? That's basically ...

Post Posted: August 27th, 2006, 4:21 pm

grinch2171 wrote:
Javascript is not the best way to do it.

CSS is the way to go in my opinion.


Wouldn't some JavaScript still be needed, though? I remember something about the son of suckerfish menus still needing a bit of JavaScript to work correctly in all browsers.

Post Posted: August 25th, 2006, 11:11 am

Thanks for the advice, guys. :) My biggest problem is, obviously, confidence. I'm physically disabled, so I've never really had a job before as the income received from temporary, low paying jobs would screw up the benefits I get from the state. Furthermore, as I'm completely wheelchair bound, it's ...

Post Posted: August 25th, 2006, 10:45 am

I'm no PHP coder (yet), but I'd think a simple array would work. Something like: [code]new Array(); begin reading in the file; for (i = 0; i < filelength (number of lines in the file); i++){ if (e-mail address (lowercase) is not in the array){ arr...

Post Posted: August 24th, 2006, 3:50 pm

Whoohoo, it works! Thanks again! :D

Post Posted: August 24th, 2006, 2:41 pm

I've tried that, but I get the following error (from FF's JavaScript console):

Error: questions.getQuestions is not a function
Line: 4

Post Posted: August 24th, 2006, 1:53 pm

It's me again. Unfortunately, I'm getting an error using the code you gave me. I'm currently using this in an external file: [code] var W3CDOM = (document.createElement && document.getElementsByTagName); var questions = new Array(); questions.getQuestions; functio...

Post Posted: August 24th, 2006, 9:57 am

Wow that's a lot of code. :shock: I figured out my main problem: For some reason, I didn't think my first array was growing while it went through the form. I didn't think it was saving everything (except the <legend></legend> tags, for some reason) within the array. So, while I had two q...

Post Posted: August 24th, 2006, 7:36 am

Well, I figured out the answer to my first question: [code] function calculate(){ var count = 0; var quiz = document.getElementById('quiz'); var questions = new Array(); for(var i = 0; i < quiz.length; i++){ questions[i] = document.get...

Post Posted: August 24th, 2006, 7:01 am

Thanks for the code. Making another array to hold the incorrect answers is an interesting addition. I do have some questions, though: 1. Would it be possible for me to make it more dynamic? In a perfect world, I'd like to make a script that didn't require the first array to be hardwired (i.e. to not...

Post Posted: August 23rd, 2006, 11:16 am

Okay, this is just screwed up...The text turns blue like a link, but there's no mouseover cursor effect.

Post Posted: August 23rd, 2006, 11:03 am

Can you post a link to your site? It'll help a lot.

Post Posted: August 23rd, 2006, 11:01 am

The http:// gives errors in IE now. Okay, please re-read what I wrote. You should ONLY use the explicit method of linking for EXTERNAL (that is, pages that aren't a part of your site) pages. So remove all of your
Code: [ Select ]
http://
code from your links that don't connect to external places. N...

Post Posted: August 23rd, 2006, 10:55 am

If you're linking to pages within your own site, you shouldn't use
Code: [ Select ]
http://blahblahblah
...that's only for external links (linking to Google, for example).

Question: are the pages you linking to in different directories?

Post Posted: August 23rd, 2006, 9:30 am

I'm currently doing some simple JavaScript exercises so I can get more familiar with how the language works, specifically how to handle HTML elements. I decided to do a quick little online quiz to see if I could grab a hold of values submitted via the submit button (with an onclick event handler), b...

Post Posted: August 22nd, 2006, 4:56 am

I've been hesitant to enter the workforce as I'm not exactly sure what employers are looking for when their positions advertise a desire to hire someone with qualifications such as "Must know JavaScript" or "Proficiency with PHP." I don't want to set up an interview and waste bot...

Post Posted: August 21st, 2006, 9:27 am

I tried Joomla and hated it. Now I'm using PHP-Fusion, and it works pretty darn well.

Post Posted: August 18th, 2006, 11:29 am

Thanks everyone who helped. I think I will get into the habit of escaping php as was suggested. I can see the code a little easier then. Why would I follow the line with /n as in:
PHP Code: [ Select ]
echo "this\n"
What does this achieve. Cheers Harlequeen The '\n' is a newline character. Think of...

Post Posted: August 17th, 2006, 3:16 pm

ahevans wrote:
hi

I tried adding:

Code: [ Select ]
height:auto;


To the right div and central content div with no joy in IE 6.

I'm not too sure about the other suggestion, it kinda makes me think about going back to tables. I thought CSS made things easier?


Try adding it to your #content div too.

Post Posted: August 17th, 2006, 2:30 pm

Is it possible to assign a color to a margin or padding attribute? I figure doing something like that would help box model/box positioning newbies see what goes on visually with their code.

Post Posted: August 17th, 2006, 4:42 am

PunkPuke wrote:
I'm going to assume you mean SQL JOIN statments, not PHP.

I haven't really quite grasped SQL JOINs either, but perhaps this will help:
http://en.wikipedia.org/wiki/Join_%28SQL%29


D'oh! You're right, I meant SQL joins. Thanks for the link...I'll definitely check it out.

Post Posted: August 16th, 2006, 6:43 am

A newbie question, but one I still haven't grasped yet. What's the difference between joins and left joins? Why/when would I want to use one rather than the other?

Post Posted: June 3rd, 2006, 2:52 pm

I've created a site using PHP-Fusion that has an RSS feed for the forum. Unfortunately, Google keeps displaying old messages from threads, and even forums, that were deleted before the site went live. I've checked the database, and I can't find those old threads anywhere, but the RSS feed didn't sta...

Post Posted: May 9th, 2006, 12:38 pm

Thanks for the ideas, both of you. Are there any links you could share with me regarding PHP classes and their use?

Post Posted: May 9th, 2006, 5:58 am

I'm currently designing my first PHP site, but I am a bit confused on how to make it as modular as I'd like it to be. My basic idea is this: HTML templates that will be included in the scripts as the look and feel of the site should remain the same while the user navigates through it. A 'who's onlin...

Post Posted: April 10th, 2006, 11:50 am

I remember doing something like this years ago for one of my intro C++ classes. It's been a while, so I may be talking out of my behind, but here's the way I'd approach it. Text files typically have a end-of-file character that is used to stop programs currently accessing the file from looping infin...

Post Posted: April 6th, 2006, 7:34 am

Tutorials: http://www.regular-expressions.info/

Post Posted: April 6th, 2006, 7:32 am

Well, I found one mistake...I was using the term tmpname instead of tmp_name. D'oh! I'm currently getting warnings like this: Warning: move_uploaded_file(): open_basedir restriction in effect. File(/prose/550proj.doc) is not within the allowed path(s): (/home/sgoat/:/usr/lib/php:/usr/local/lib/php:/...

Post Posted: April 6th, 2006, 6:41 am

i had a problem like that once, for a start, the uploader file must b chmodded correctly, u didnt say that, and also, im not sure if u can upload to a dir in another dir, it has to b a directly local dir, so the dir where the images go is in the exact same dir as the upload file - so ----uploader's...

Post Posted: April 6th, 2006, 4:46 am

It appears that move_uploaded_file is returning false as I don't get any dialogue telling me the files have successfully moved. I can't see why it wouldn't move the file to the paths provided by my $uploaddir variables, though.

Post Posted: April 5th, 2006, 9:12 am

I'm trying to make a simple uploader. I've gotten it more or less written, but nothing gets saved to the server when I try testing it. I've double-checked that the directories are writeable, so that's not the problem. My code, which is very simple as I'm just trying to see if I can write anything to...

Post Posted: April 4th, 2006, 2:59 pm

Selecting the data back from the DB would give you the raw bytes of the file, not the file itself. You'd then have to write the data to a temporary PDF file in order to display it to a user, then make sure that the temporary file gets deleted after it is no longer required. That's what I was afraid...

Post Posted: April 4th, 2006, 2:27 pm

Hmm...okay, thanks. :) My biggest problem with this, right now, is seeing it in my head. I'm trying to write my own Joomla component that will save .pdf files into its database, and will allow me to retrieve those files, displaying the .pdfs in question in another window, but still as a .pdf (instea...

Post Posted: April 4th, 2006, 6:03 am

Sam Hughes wrote:
That code is still comparing chars with strings.


Ah, that's true. :)

Post Posted: April 4th, 2006, 6:01 am

Can .pdf files be placed within a MySQL database? If so, what syntax would be required to insert/retrieve those files?

Post Posted: April 3rd, 2006, 8:56 am

Here's what I'd do: [code] #include <iostream> using namespace std; int main() { float degreeC; float degreeF; char ConvertToTemp; float FtoC; float CtoF; cout << "To convert to Celcius enter C, and F for Fahrenheit \n"; cin >> ConvertToTemp; if (ConvertT...

Post Posted: February 16th, 2006, 2:48 pm

text-align doesn't align anything but text. Text-align horizontally aligns anything within that block element. Try this: make a <div> 200 x 100. Set text-align: center; Then, put within that <div> a 100 x 100 image. It'll be horizontally centered within the <div>. http://www&#...

Post Posted: February 16th, 2006, 11:57 am

RITZ wrote:
I only changed to a loose doctype because the w3c validator was complaining about attributes in my tags that I can't get rid of, like "align". What's up with that?


It doesn't allow align because CSS text-align does the same thing.

Post Posted: February 16th, 2006, 6:45 am

The first thing I noticed are a couple of spelling and grammar mistakes. At the top, you have 'spefication.' What is this supposed to be? Specification? Also, in your body's first menu, 'Buying a Orchid' should be 'Buying an Orchid.' Second -- for your left-hand navigation menu, why does the top red...

Post Posted: February 13th, 2006, 11:04 am

Hi, im learning pointers and i was wondering what is the difference between: (*p)++ , *(p++) and *p++ . I think that the first statement increments the value pointed to by p and the second increments p but i aint 100% sure. please help :( It's been a while since I've used C++, but I think you're on...

Post Posted: February 11th, 2006, 10:05 am

obj is some object, whose properties you want to list. objName is just a string, for the purpose of producing pretty output. You could write: listProperties(foo, "foo"); and get "foo.bar = khan\nfoo.baaz = khar", if I'm reading this correctly. You could write listProperties(foo,...

Post Posted: February 10th, 2006, 4:05 pm

...properties. I have a JavaScript book which shows how to access every property of a user defined object. The only problem is that the book doesn't show how the function would be invoked. The code in question is: [code] function listProperties(obj, objName){ var result = ""; ...

Post Posted: February 9th, 2006, 3:19 pm

Hello all I am having an issue with an html drop down menu (Nav Bar) I created for one of my sites. In Internet Explorer it kicks over to the Right and is a bit annoying to use. Mozilla andall other browsers are fine. Any help is greatly appreciated Luni SITE: http://www.Line-Man.com It looks like ...

Post Posted: February 9th, 2006, 8:30 am

Well, logically, you really should only have one main <ul>, because it should be something like this: [code]<ul> <li><a>Home</a> <ul> <li><a>test1</a></li> <li><a>test2</a></li> <li><a>test3</a><...

Post Posted: February 9th, 2006, 6:24 am

Ok, scrap all i have posted before. I would like that exact thing but perhaps i could build on what i already have in place... Nav Bar example Is there a way i could get a drop down bar which would cross the screen but maybe with a couple of px of gap. Anyone? Do you want the submenu bar to dynamic...

Post Posted: January 31st, 2006, 10:58 am

www.jasonstanley.co.uk/god2/index The first problem i have is with my buttons, they are a CSS rollover... i cannot shrink them to fit on one row and i don't want to stretch them to fill 2 rows. What i want is the second row to be centered... i have tried everything from attempting to create a new d...

Post Posted: January 27th, 2006, 2:34 pm

FutileSoul wrote:
ok, thats good. I just figured out i never reinstalled IE6, since i recovered my computer the other week, and i have IE5 on here because all i really use now is FF.
Could the problem be that I am using IE5?


Yup, that's your problem. IE5 is quirky.

Post Posted: January 27th, 2006, 9:27 am

FutileSoul wrote:
on your link, it shows it correctly aligned in FF, but in IE it is wrong


Like I said before, it looks fine on my IE....

http://www.nightslyr.com/blah.jpg

Post Posted: January 27th, 2006, 9:21 am

FutileSoul wrote:
that makes it too narrow for IE, is there a way to make them both correct.


Looks fine on my IE when I test it...

http://www.nightslyr.com/blah.html

Post Posted: January 27th, 2006, 9:01 am

i put that code in erased the other one, then when it didnt work, i changed it back. I found the problem. Looks like FF doesn't like height's that are done as percentages. In your #mainbox class, remove height: 100%. For the width of that class, I shrunk it down to 610px too. It looks like everythi...

Post Posted: January 27th, 2006, 8:42 am

FutileSoul wrote:
i tried it and see no difference.


Looking at your code, that's probably because you didn't erase your old #mainbox h2 rule, nor did you end the new one with a closing bracket. :P

Post Posted: January 27th, 2006, 6:59 am

yes, the problem is with the main content boxes. In IE it aligns perfectly with the edge of the topbanner, and in FF it extends beyond the edge of the banner. i changed the leftmenu to class, and it didn't seem to do anything. I added .post, that somewhat worked on the news page on FF, now the back...

Post Posted: January 27th, 2006, 6:05 am

Thanks, it works perfectly! :D

Post Posted: January 26th, 2006, 3:49 pm

I'm making a template for a racing group's website. As usual, it looks the way I want it to in IE, but not in FF or Opera. In those two browsers, my content area is way too skinny and tall. I thought I was adding up my margins/padding right, but apparently not (although, double checking, my numbers ...

Post Posted: January 25th, 2006, 10:03 am

grinch2171 wrote:
I couldn't replicate the problem using FF 1.5


I haven't updated to 1.5 yet -- using 1.0.7.

Post Posted: January 25th, 2006, 9:45 am

To be honest, I'm not sure if this post belongs here or in the programming/scripting area, so I hope no one gets mad with me putting it here. I've just put an updated version of my site online. The menu I use for it (a modified Son of Suckerfish) has always worked great across browsers. That is, unt...

Post Posted: January 22nd, 2006, 10:52 am

Question: Does a proper DOCTYPE definition need to include the:

Code: [ Select ]
<?xml version="1.0" encoding="utf-8"?>
line before the actual definition, or will that put the page into Quirk Mode?

Post Posted: January 22nd, 2006, 10:43 am

SugarKane wrote:
You don't have to pay for that link.
Just click and you're there.


You can also use that site without paying ... only you don't get access to the
members specialist forums.


Ah, sorry :oops: I saw the Verisign/credit card stuff and thought I couldn't access it.

Post Posted: January 22nd, 2006, 9:37 am

Problems with boxes seem to cause all sorts of problems for folks. They can all be easily avoided without resorting to hacks and redesigns. Anyway, I have this bookmarked in my "resources folder": What is a box model? - quite helpful. Pay attention to the "avoidance" section of ...
  • Sort by
 
 

© 1998-2016. Ozzu® is a registered trademark of Unmelted, LLC.