Suomedia 5 Junior Poster

This was the first fully Ajaxed site that we created: http://3hmp3.com (based on osCommerce, so please excuse the markup). Take a look at it on Google... absolutely no problem.

You just gotta know how to do it.

Suomedia 5 Junior Poster

I think the only problem that you have is that you have not respected the case sensitivity of variables, eg, in your form you have the file field named as "Picture" whereas in the processing script it is "picture", eg. $_FILES

The two are NOT the same and for this reason it will never work as it is.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

As a general rule, you typically design for Firefox.

I agree - this is exactly how I develop. Get it right in Firefox first, then make corrections for other browsers where necessary.

For IE6 I am not afraid to used underscored classes in my stylesheet, since this is the quickest and simplest way to make corrections for it. Purists insist on importing stylesheets, however IMO this is unnecessary overkill with no gain whatsoever other than more development time.

My only qualms with Firefox are its massive memory leaks.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Addendum: I just searched "Release Records" and their downloads are no longer online. Yet another music download site bites the dust. Most likely cause is poor search engine rankings due to poor site design or insignificant sales also due to poor site design. Reliance on "reputation" alone clearly no longer cuts the mustard.

For any site to be successful with online downloads they MUST be able to get a large proportion of their content within the first ten search results on Google. We are playing against aggressive big boys such as Apple's iTunes whose Quicktime malware alone has killed many sites who have been unable to find a solution for how it screws mp3 downloads (we know the workarounds). Most people do not have anywhere near the marketing budget of the big players, so the only solution is superior software.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

If I google "mp3 downloads" or "buy mp3" or anything like that, i don't see beatport, juno (which is not flash) or your gospel music site.

As for the results. This small site has only one page and one swf but i can see it in google just the same -
See here
or this other flash page: bigtunes
If these sites had 50 pages or so, I'm sure they would all appear as well.

Thats really quite funny. What we are talking about is search results for relevant content. It is true that Google will index the HTML container for a full Flash site, but that is as far as it can go - title tag and description tag (perhaps). Their actual *content* will never be indexed. Both your searches are for site:my_site.com which will naturally bring up the *one or two* search results for whatever is in title tags on the sites.

beatport and juno have a great reputation among dj's and music freaks. I assume he mentioned those 2 because he's into music. You did something for Hi Bias which is a label that I know from way back when, I have records from that label. I believe Hi Bias will prevail because of their reputation, not because they don't use flash.

So clearly you agree that Beatport's online success is in no way connected to being indexed by Google (because their content never can be).

You …

Suomedia 5 Junior Poster

A custom built flash solution will certainly cost more than 100 bucks, but from what I gather from the original thread, he's looking for a simple and cheap solution to get his stuff going.
Not my custom built solution or yours. :)

Dave

He didn't actually mention money, but rather outlined his requirements, which are not "simple" (he mentioned Beatport and Junodownload)

My point was that a Flash solution is not good, for the simple reason that it will never be indexed by search engines. Beatport has a huge marketing budget to make up for this fundamental flaw.

Our ecommerce engine, once released will be fully GPL and *free of charge*. There are others already available that are suitable ( we previously developed with osCommerce, eg. http://holyculturedownload.com ). As for search engine indexing (which is vital), the results speak for themsevles.

So, my recommendation is to find a suitable ecommerce engine and adapt it to suit - this is both the best and cheapest way. While its true that there are a few "cheap" out of the box solutions, they are by no means suitable for the very competitive music industry. As with any business, its necessary to invest in order to gain decent returns, whether that be time in doing it yourself or to pay a developer.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

The problem with full Flash solutions is that your site will never be indexed by search engines.

A truly professional solution (fully Ajaxed site) will cost you significantly more than $100


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Yes. This should work:

$path = $_SERVER['DOCUMENT_ROOT'] . '/upload/';

Matti Ressler
Suomedia

Suomedia 5 Junior Poster

The image(s) must be attached to the mail in the way that I showed you. Exactly where on the server the file is moved to is up to you. It actually is normally uploaded to /tmp/ and must be moved from there to a directory within your webspace. This is done with move_uploaded_file() that you see in my script.

If you are attaching mutiple images, you can use a loop rather than repeating the same code multiple times.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

On some web servers you can set permissions using your FTP client. In most you can right click the file or directory and chosse to set permissions. I use Filezilla and it has "file attributes" in the right click menu.

Alternatively, in your web hosting control panel you should have a file manager. Please consult the documentation for your hosting on how to set file and directory permissions.

If you are on a Windows server, I know absolutely nothing :icon_cheesygrin:


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

You would do far better not to rely on javascript for this at all. Instead you should parse the post with PHP and from that display a confirmation for the delete if delete was selected. That is simply good coding practice.

It is common to use javascript for error checking (I do myself) however the form should still submit and also be checked with PHP if javascript is disabled.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

LOL..
But I dont steal others code (like you!).

Now you have overstepped all boundaries of decency.

Please backup your accusation or make an unreserved apology.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Quite clearly correct ? :icon_lol: setting the action of a form when a button is clicked is correct as well. Just like how "some" features of a stupid site doesn't work when javascript is turned off, a form which uses javascript to assign the action, wouldn't work.

Thats exactly my point. If you "Turn off" javascript, anything dependent on javascript will fail.

Setting the action of a form using javascript is idiotic. That was my point, not yours. That I pointed it out has caused you to continue trolling like this ever since.

Wow ! Is that so ? A user can turn off javascript ONLY for a form and not for the whole page ! Hmmm.. you know something that others dont ! wink wink

This is typical of your trolling - you try to take something somebody has written and make something different from it - bravo! If you insist on putting it that way (which I never said) then yes, it can be done.... you think about it.

Lol..But still some things wouldn't work. Oh, I noticed something.. Even Daniweb's smiley dropdown, undo, redo wouldn't work if I turn off javascript :( ! Sad, Isn't it ?

Yes, its very sad that you cannot see the difference between smileys and a login form. One is essential, the other not.

Wow! Insecurity ! You will steal my job ! :S LOL..

Do you actually have a job??

I just …

Suomedia 5 Junior Poster

The full file system is the way the folders are structured in the site ?

It the directory structure of your webspace on the server. Create a file with this, put it in your main directory and open it:

<?php
  echo $_SERVER['DOCUMENT_ROOT'];
?>

That will give the full file system path to your main directory.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

In each of the files that have the error (3 in the attachment) add a closing curly bracket } before the very last ?> in each file.

With your $path variable, it MUST be a full file system path, eg. /home/suomedia/public_html/upload/ or use:

$_SERVER['DOCUMENT_ROOT'] . '/uploads/'

Also, you are far better to use a PHP redirect than javascript:

<?php
header("location: success.htm");
?>

Matti Ressler
Suomedia

Suomedia 5 Junior Poster

:twisted: Nope ! I was sarcastic about your first statement. duh!

Why be sarcastic about something that is quite clearly correct? You try to make a point that non essential things like "listen" buttons not working are "bad", yet cant see how ridiculous it is to create a form that wont function without javascript. DUH!!!!!

A user can't turn off javascript for a FORM (More surprise !!!).

Oh really? Paste your own code into a file, open it in your browser with javascript turned off. Then tell me that it still works :icon_lol: SURPRISE!!!!!..... it doesn't. Yes, a user CAN turn off javascript for your form.

I thought the "LISTEN" button was an ESSENTIAL feature of that stupid site !

You thought wrong (as you do about many things). I think you will find that you can still, browse the site, create an account, purchase music and any other essential thing with javascript turned off. The essential things all work just fine. That you like to call it "stupid" only indicates your own insecurity.

:icon_rolleyes: Yeah, asking the user to have a hyperlink instead of what he asked for(ie., a button), is a VERY GOOD solution!

Oh gee.... I think you better look again:

<html>
<body>
<form method="post" name="test" action='welcome.php';>
<input type="submit" name="button1" value="login"><a href="register.php"><input type="button" name="button2" value="Register"></a>
</form>
</body>
</html>

I don't know about you, but I definitely see two buttons :icon_rolleyes:

Give me one good reason why I should jealous of one crappy site ? …

Suomedia 5 Junior Poster

Damn. This is so bad. You didn't get the feeling of sarcasm from that.

You are sarcastic about the reality of how bad your solution is? Now THAT is funny :icon_cheesygrin:

You spend so much time bagging a site because non essential javascript controls don't work when javascript is turned off in a user's browser (surprise, surprise!), yet cant see the reality of how bad it is to code an ESSENTIAL feature that is totally dependent on javascript..... the ONLY point you have proved is how BAD our solution is.

Yes, you are quite clearly jealous... that is even funnier :icon_lol:

Suomedia 5 Junior Poster

As per the rules, Suomedia, it's good to keep things on the site. Solving problems through PMs, email and sending attachments makes things cumbersome and difficult to search through if someone else is sharing the problem.

It is on site. This forum is designed to allow attachments to posts so that the threads are not cluttered with mile long posts of code (more than one file in this case).

Please leave moderating to the moderators :icon_frown:


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Attach your files in a zip using the attachment option when posting your next message (the paper clip).


Matti Ressler
Suomedia

Suomedia 5 Junior Poster


if the user has javascript turned off? Nothing happens, not good.

There, by your own hand. Your "solution" was a very bad one.

As for your bagging of holyculturedownload.com, I believe that is jealousy pure and simple :icon_lol:


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Please use the attachment option (the paper clip) and attach a zip of your files to your next post.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

You would need the domains hosted on the same server and serve the images using a proxy. (needs root access). Not my forte so you will need to Google it if nobody else has a solid answer.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Nope. That wasn't the point. The point was, .
But the bottomline is, if javascript is disabled, many options in the site holyculturedownload doesn't work.
FYI,

Clearly you have a bee in your bonnet. So, you find that javascript controls dont work on a site when javascript is turned off? Congratulations, perhaps you learned something?

Now look at the POINT of the example, and you will see that content previously loaded with Ajax still loads and the site can be browsed normally - the point there was that this is vital for search engines, not for users who KNOW they cannot disable javascript on such a site and expect to enjoy the rich features. Your "bottomline" is totally mindless. Perhaps you can code something close to its standard? I think not.

I know exactly what my first point was - that if javascript is turned off in a FORM for user input and it does not function, then that is not good (your form example). Try the form on holyculturedownload.com and tell me that it doesn't work, both with and without javascript - THAT is how forms should work.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Maybe she just want to create an application by herself and wants to know the processes intensively.And some e-commerce application lacks features needed by the client.

Maybe she can answer all by herself also :icon_wink:

Suomedia 5 Junior Poster

Try this:

<!--[if !IE]> -->
<object type="application/x-shockwave-flash"
  data="http://www.zeriislam.com/menu.swf" width="923" height="90">
<!-- <![endif]-->
<!--[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
  width="923" height="90">
  <param name="movie" value="http://www.zeriislam.com/menu.swf" />
<!--><!--dgx-->
  <param name="loop" value="true" />
  <param name="menu" value="false" />
  <p>Flash Player Required</p>
</object>
<!-- <![endif]-->

Matti Ressler
Suomedia

smartness commented: He helped me... thanks +1
Suomedia 5 Junior Poster

Why are you creating an e-commerce application when there are open source ones available (including multiple stores . I know at least two)?


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

That unfortunately, didn't work in FF2 when I disabled javascript. Click on the "Listen" button to test. Strangely, even gmail's "send" button didn't work when I disabled javascript.

Now that is pedantic... the "listen" button is clearly a javascript/Ajax control. The point was that the SITE functions without javascript for the purpose of search engine indexing (which it does very well).... I dont believe that Googlebot listens to music :icon_lol:

I think you will find that the signup page functions quite fine without Javascript (it does have it).


Similarly, forms should be designed not to be dependent on Javascript to accomplish their purpose. That Gmail fails for something so fundamental is surprising, but not acceptable.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

You have a missing closing curly bracket } in your code.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Yes, of course it can be done with php. Its quite a bit of code which I don't have the time for, but I am sure somebody else probably will. The web is full of tutorials on how to do this.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

If javascript is disabled, even the form validation/ajax wouldn't work. :)

What Ajax? A well written script will function without either javascript or Ajax. A good example: http://holyculturedownload.com/

This is a heavily Ajaxed site. Turn off javascript and it is still functional - this allows it to have Google results like this and for users to still browse the site.

A form should not rely only on javascript for validation - the PHP side should also check the $_POST data.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Yes. If you use phpmyadmin you will see it as export options in many formats. One that I commonly use is CSV.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

And if the user has javascript turned off? Nothing happens, not good.

Your are far better to structure you page in such a way as to not depend on javascript.

Most login/register pages have form inputs for username and password for registered members, and a simple linked button to the registration page if the user is not registered:

<html>
<body>
<form method="post" name="test" action='welcome.php';>
<input type="submit" name="button1" value="login"><a href="register.php"><input type="button" name="button2" value="Register"></a>
</form>
</body>
</html>

Matti Ressler
Suomedia

Suomedia 5 Junior Poster

That should actually be

$query = "SELECT address_code FROM address WHERE userID= '".$myuserID."'";
$result = mysql_query($query);
$row = mysql_fech_array($result); //or while($row = mysql_fetch_array($result)) if your query returns more than 1 row
<td><input type="text" name="PickupAddressPostCode" value="<?php echo $row['address_code']; ?>" /></td>

Cheers,
Naveen

That should actually be:

$query = "SELECT address_code FROM address WHERE userID= '".$myuserID."'";
$result = mysql_query($query);
$row = mysql_fetch_array($result); //or while($row = mysql_fetch_array($result)) if your query returns more than 1 row
<td><input type="text" name="PickupAddressPostCode" value="<?php echo $row['address_code']; ?>" /></td>

Don't you hate it when the phone rings and the edit window times out ;)


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

You must close each form with </form> and make sure that one form is not within another.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

You need to connect to mySQL, select the database, make the query, fetch the result with mysql_fetch_array() and close the connection.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Thats only 17 lines :icon_frown:

How about attaching the actual whole file? - Signupcomplete.php


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

I don't believe you will find a way to access remote hardware using PHP.

If you do, please let me know.... maybe I can win a MacBook Air also! :icon_lol:

Matti Ressler
Suomeia

Suomedia 5 Junior Poster

I don't see anything there that wont run on PHP4, although I would change this:

$query = "SELECT * FROM $table_id";

to this:

$query = "SELECT * FROM " . $table_id;

Perhaps the problem is with your DomDocument class? You should attach the files to your post.

Matti Ressler
Suomedia

Suomedia 5 Junior Poster

This is a PHP error, not a javascript error. Your error message tells EXACTLY where the problem is:

Notice: Undefined index: StudentName in /home/stud/1/0472547/public_html/Signupcomplete.php on line 49

Line 49. Please post the code in this file.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

. Its not a good practice to have @, because it makes your life very difficult to know where the exact error is.

I agree. I have absolutely never used it.... another lazy practice even worse than short tags.

Good code has error handling, not error suppression.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Mark as solved ;)

Suomedia 5 Junior Poster

The error is in your PHP. You are missing this:

$StudentName = $_POST['StudentName'];

Matti Ressler
Suomedia

Suomedia 5 Junior Poster
$query = "SELECT address_code FROM address WHERE userID= '".$myuserID."'";
$result = mysql_query($query);

<td><input type="text" name="PickupAddressPostCode" value="<?php echo $result['address_code']; ?>" /></td>

Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Perhaps something like this?

<?php
function myfunction($buffer) {
	return str_replace('hello', 'goodbye', $buffer);
}
$mystuff = ob_start("myfunction");
?>
I am here to say hello
<?php
ob_end_flush();
?>

Matti Ressler
Suomedia

hunkychop commented: gives good solutions while having much patience with my extreemly ADD posts +2
Suomedia 5 Junior Poster

Well, as I first suggested, declare the variable:

$sentmail = NULL;

Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Probably the best way to start learning is to pick up an open source application such as Joomla or PHPnuke and learn from it, modify it, break it.

I use WAMP as a local development environment which allows running these applications on my local machine rather than a web server.

You need at least a good text editor designed for programming - I use Ultraedit.

The web is full of good PHP tutorials (make sure they are recent).... just search.


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Anything that is outside PHP tags is not available to PHP to manipulate.

Its hard to understand exactly what you are trying to do - why do you wish to manipulate the HTML? What is "the configuration". What is "the data contained in a statement"?

Why not just have PHP output the correct HTML based on your "configuration"?


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

The table already exists. Your latest code is correct (the other you had "$database_name" in quotes, which is incorrect).


Matti Ressler
Suomedia

Suomedia 5 Junior Poster

Its possible. It requires a GEO-IP database. There are a number of free and commercial ones available.


Matti Ressler
Suomedia

VIeditorlover commented: fast and accureate answer ! +1
Suomedia 5 Junior Poster

Although the syntax of your example is incorrect, yes, you can create a function to manipulate the data.

eg.

<?php
function myFunction($input) {
      $output = strtolower($input);
      return $output;
}

$data = 'TEST';
$result = myFunction($data);

echo $result;
?>