SRL Archive - Web Development

Help with making a homepage


almost

2008-06-10 00:10:08

I would like to learn more about HTML so I can make an awesome homepage.
All I have so far is a MySpace log in box, but at least it works.
I want to have a YouTube search box but I can't figure out how to do this.
I basically want this in HTML-
program New;
begin
OpenWebPage('http://youtube.com/results?search_query=' +
Replace(ReadLn('Search for:'), ' ', '+'));
end.

And the other thing I need to find out how to do is opening up programs.
I tried
<a  href="file:///C:\Program Files\SCAR 3.14\scar.exe" >Launch SCAR</a>
and
<a  href="file:///C:\Documents and Settings\All Users\Desktop\SCAR Divi 3.14.lnk" >Launch SCAR</a>
But those ask me to download SCAR and stuff…
So how can I just bring up a program?
And can I have it launch a certain program when I visit my home page?

I know I will probably have more questions later but that's all I can think of for right now.

Dumpin

2008-06-10 06:19:12

you can't open exe files from the net… people will be able to nasty stuff with your computer then.

and for the youtube searcher.. do something like:

[php]
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$query = $_POST['query'];
$search = "http://youtube.com/results?search_query=" . $query;
header("Location: $search");
} else {
if($_SERVER['REQUEST_METHOD'] == 'POST') {
echo("error");
}
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test search</title>
</head>

<body>
<form action="<?=$_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="query" />
<input type="submit" name="submit" />
</form>
</body>
</html>

[/php]


a example to this script is here:

http://gamefire.nl/search.php

i quickly made this out of the head so it is not great :P

almost

2008-06-10 13:10:18

you can't open exe files from the net… people will be able to nasty stuff with your computer then.

Yes very true, but I thought maybe a file located on your computer already would work.
Thanks a lot for that, I will test it out.
And it looks like I'll be needing some other languages too.
I don't understand any of the php stuff.

Edit:
Firefox can't find the file at /C:/Documents and Settings/Neil/Desktop/<?=$_SERVER['PHP_SELF']; ?>.

It gives me this every time.
I don't know the language but I'll see if I can fix it.

Dumpin

2008-06-10 15:19:52

php is serverside scripting.. this means you need to upload it to a host that supports php or make your server… http://www.en.wampserver.com/ is a nice one to start with i think.

almost

2008-06-10 15:33:18

Oh well I'd like to do it nice and simple on just my homepage.
Just make it the same way youtube does it.
I can do it the same way I made the log in for MySpace, go to youtube and click view source and find all the coding junk for the search bar, then paste that on my homepage.
But learning how to make my own seems more fun.

Dumpin

2008-06-10 16:02:07

you can get a long way with php in web designing.. I am starting to learn it well now.. a few weeks ago i didn't understand a thing of it now it is easy for me :P

if you know the basics it's fairly simple.

Zezi

2008-06-10 16:43:26

From: Dumpin
you can get a long way with php in web designing.. I am starting to learn it well now.. a few weeks ago i didn't understand a thing of it now it is easy for me :P

if you know the basics it's fairly simple.


Yea, all you need to know is post, and get vars anda way you go XD

Try something like this XD
…… I looked over your code a bit more dumpin, and that's exactly what i was gonna do, only thing is…

Both your if and else are
[php]
if($_SERVER['REQUEST_METHOD'] == 'POST') {
echo("error");
}
[/php]

So… :S XD

And you don't even need an else } if (thing) since there's only really 2 options, true or false, so you'd just need else { echo 'Something failed'; include $_SERVER["PHP_SELF"];


;p >.< Dumpin's so smart lately, me so proud :bart:

almost

2008-06-10 18:10:01

Well then I should start learning some PHP stuff then.
I don't know what server side means, but would I be able to make a youtube search bar on my home page with PHP? And make it serverside or whatever?
I've been looking for a new language to learn.
I'll google it but does anyone know a super good place to learn it?

And thanks for the help

Dan Cardin

2008-06-10 19:30:25

http://www.3dbuzz.com

almost

2008-06-10 19:56:51

I found a very nice tut on PHP for the very basics and up, and I understand it all so far.
But how do you uhh… Run PHP?
I save the examples the tut has as a .html and it opens up with firefox but the php parts never work…

Dumpin

2008-06-11 01:59:31

php autoruns when you open the file..

http://webmaster.iu.edu/PHPlanguage/index.shtml < explaination of php

and Boxcrop, if i didn't do it again in the else, it showed the error echo already before anything was done…

almost

2008-06-11 11:24:55

I save the examples the tut has as a .html and it opens up with firefox but the php parts never work…

That's what I had figured, but how do I fix this?
In the tut the very beginning part says to save this example script and open it up.
The HTML part works but none of the PHP parts work.
And I tried all the other example scripts too.
[php]<html>
<head></head>
<body>

Agent: So who do you think you are, anyhow?
<br />

<?php
// print output
echo 'Neo: I am Neo, but my people call me The One.';
?>

</body>
</html> [/php]

The page only shows
Agent: So who do you think you are, anyhow?

and in the picture it is also supposed to say
Neo: I am Neo, but my people call me The One.

Dumpin

2008-06-11 12:29:01

did you safe the file with an .php extension?

almost

2008-06-11 12:37:03

I've tried it both ways and neither one works. (that means save it as WhatEver.php right?)
The problem seems to be echo.
It never works.

And I downloaded wamp and saved the youtube thing into the www folder but I still can't get it to work…
Now I get
Firefox can't find the file at /C:/wamp/www/<?=$_SERVER['PHP_SELF']; ?>.



Edit:
I got echo working with wamp!
You have to save your files in a new folder in the www folder.
But now with the youtube thing I just get this
Forbidden
You don't have permission to access /page/< on this server.

And the address bar says http://localhost/page/%3C?=$_SERVER['PHP_SELF'];%20?%3E

Dumpin

2008-06-12 02:34:57

hmm i think you need a host for it then… try this:

[php]<?php
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$query = $_POST['query'];
$search = "http://youtube.com/results?search_query=" . $query;
header("Location: $search");
} else {
if($_SERVER['REQUEST_METHOD'] == 'POST') {
echo("error");
}
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test search</title>
</head>

<body>
<form action="" method="post">
<input type="text" name="query" />
<input type="submit" name="submit" />
</form>
</body>
</html>[/php]

almost

2008-06-12 12:40:16

Thanks A LOT!
It is working.
Rep'd!

And I'm just about good enough at php to make that myself now.
I made a pretty cool calculator. =)

Edit:
Is there a good way of writing your php and html pages?
I use notepad, but I'd like to use something that looks like the PHP tags to type it up.

Another thing-
I wasn't familiar with these lines, so I took them out and it seemed to work the same.
[php]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test search</title>
</head>[/php]
So what do they do? (Besides the <title> tags)

Dumpin

2008-06-27 11:04:07

hmm ok..

the first/ second line includes XHTML version 1.0. ( http://en.wikipedia.org/wiki/XHTML)

I think you know what the <head></head> tags are… if not, everything there won't be shown on the page but will be included. ( e.g for functions )

the meta tags is used for including CSS scripts and stuff. in this case it is used to make sure that the webpage uses UTF-8 charset.

almost

2008-06-27 13:23:39

Ahh ok thanks for that.
And during the time SRL has been down I've just been getting better at PHP.
Made myself a MySpace password stealer :)
www.bluetooth.x10hosting.com
It does start to get easy after the basics.

Dumpin

2008-06-27 14:41:15

hmm

WARNING


MySpace has found this site to be a phishing site.
Read Tom's blog on phishing

You have been logged out and your login history has been cleared as a precaution.

You may log back in below, but in the future be aware of links that bring you to unfarmiliar places.

-MySpace technical team


Profiles this message has protected: 39521

almost

2008-06-27 21:41:20

Ya that's supposed to make it look all real and stuff, so they log in, and it emails me their stuff then logs them in.

Dumpin

2008-06-28 13:46:54

ooh ok lol… nice. :P

just using POST data on this one?