Post Reply 
Basic PHP
Jul. 07, 2004, 11:08 PM
Post: #16
 
..::Oddysey -> First Post::..

I had realized that when I was testing it out and fixed it, but forgot to post it on the forum. Even after that, it DID NOT work.

..::Oddysey -> Second Post::..

I have gone through the Invision Code multiple times to try and find what they do. I have found that they have all the accepted variables in an array. So like all the page variables that are OK would go into and array and all the id variables that are OK would go into a variable. Then after that, they use very complex php to accomplish the rest. As a stated in my first post, this is the first time I have every really worked with php. Bu I was able to 'decode' some of it. Below I attached the index.php file from IPB 1.3 Final. Maybe you can look at it and analyze it more than me. It looks like to accomplish what I want to do, I will have to make some arrays and do some more complicated PHP. I've been searching google for some tutorials and hopefully one of them will give me enough understanding to figure out what they are doing and how I can modify it to work for me.

�{=(~�::[Shea]::��~)=}�
How 'bout you sideburns, you want some of this milk?
This fading text is pretty cool, eh? I bet you wish you had some.
Add Thank You Quote this message in a reply
Jul. 08, 2004, 05:19 PM
Post: #17
 
Shea;
Quote: Below I attached the index.php file from IPB 1.3 Final.
And that attachment would be where?! :o

Understood about your being a newbie to PHP, but don't sell yourself short. You do have the right mindset to be a programmer, and it would appear to me that you also have the tenacity to stick with it until the problem's solved, so I'd say that you're gonna "catch on" a whole lot faster than most people ever would dream of. Wink Keep it up, my young friend.

in re: the routine still doesn't work....

Now I'm wondering what the 'he hockey sticks' is going on. Obviously I'm gonna have to start paying attention to what I'm reading instead of just saying to myself "this looks like Shea could use it". <_< Big Teeth Who knows, maybe I'll soon be switching over to PHP myself, and leaving PERL behind.

Argh, decisions, decisions, decisions, decisions. AARRRGGGGHHHHH! Banging Head [angry] Banging Head


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Jul. 08, 2004, 05:28 PM
Post: #18
 
Oddysey Wrote:Argh, decisions, decisions, decisions, decisions.&nbsp; AARRRGGGGHHHHH!&nbsp; Banging Head&nbsp; [angry]&nbsp; Banging Head
Whoa there fossil Wink Don't want you to get a fracture or a chip [lol] (I should stop with the fossil thing...haha)

Anyways, I don't like working with PHP, it gives me a headache. [wacko]
Visit this user's website
Add Thank You Quote this message in a reply
Jul. 08, 2004, 10:14 PM
Post: #19
 
Here Oddysey, I guess i just forgot to attach the file. [wacko] I guess thats what sleep deprivation does to you..... I have still been looking over the forum code and now I'm getting an idea of how i might go about editing it for my own use, but I can't copy it too much, outherwise that would be stealing others software. And that is bad Wink

I'm thinking of changing some of the arrays and then editing what files they point to and see if that works. Then I'm going to try and change the code enough so it doesn't violate there copyrights. But if I include the IPB copyright at the top of the file, will that allow me to copy some of it ro not?

PS - Renamed the file index.cfg because the forum does not allow php files.

�{=(~�::[Shea]::��~)=}�
How 'bout you sideburns, you want some of this milk?
This fading text is pretty cool, eh? I bet you wish you had some.
Add Thank You Quote this message in a reply
Jul. 08, 2004, 10:25 PM
Post: #20
 
Shea Wrote:PS - Renamed the file index.cfg because the forum does not allow php files.
Allowed. Smile!
Visit this user's website
Add Thank You Quote this message in a reply
Jul. 09, 2004, 06:29 AM
Post: #21
 
Shea;

Thanks - just picked up the attachment; will look at it when I'm done harassing this forum!

In essence, it is the opinion of the legal community that common ideas that are taught either from books or class rooms are not copyrightable (nor are they patentable). That said, if you use an array to hold variables and build an URL from them, this is an accepted "common approach" to solving a problem - it can't be copyrighted.

If you use Mechan's code outright, line for line, then yes, you're heading for trouble. But if you simply used the same ideas, then no, you're in the clear. Do what every one else does (including me): copy it all first, make sure it works like you want, then keep tweaking it until it no longer looks the same at all, but still works. The idea is not that you have customized it, it's that you have found a better way to implement the algorithm to solve the problem. (Yes, some lawyers would argue that this is merely an attempt to skirt an accusation of theft, but I've taken many a school class where this was done to teach students how to understand what another programmer was thinking as he/she solved a problem. Take that, all you weasels lawyers out there! [angry] )

Go for it - make it yours! [lol]

Oops, almost forgot. While cleaning out some old bookmarks, I ran across this one from PHP Freaks. See what you think, and report back to me. Big Teeth


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Jul. 09, 2004, 05:05 PM
Post: #22
 
Thanx for the information and link. I think I ran accross that site on one of my google searches, but not for this problem.

�{=(~�::[Shea]::��~)=}�
How 'bout you sideburns, you want some of this milk?
This fading text is pretty cool, eh? I bet you wish you had some.
Add Thank You Quote this message in a reply
Jul. 09, 2004, 07:05 PM
Post: #23
 
I looked through all the tutorials that I thought might mention what I'm trying to do. Unfortunately, none of them did Sad , but I did find a small tutorial on arrays and that helped me to understand the IPB code a little more. They also had a VERY good link section and right now I'm trying some of the links to see if they have anything about it. I'll get back to you if I find a good tutorial. Big Teeth

�{=(~�::[Shea]::��~)=}�
How 'bout you sideburns, you want some of this milk?
This fading text is pretty cool, eh? I bet you wish you had some.
Add Thank You Quote this message in a reply
Jul. 18, 2004, 06:32 PM
Post: #24
 
Ok Oddysey.....I looked through most of the links on PHP Freaks and none of them came up good. I'm still trying to figure out the IPB code, but everytime I think I understand it, I get lost again. I did come up with this code which I thought would work, but it didn't. I still dont understand arrays enough to change them to fit my needs.

Code:
<?php

if ($_GET['page']=="") and ($_GET['id']=="") {
include('main.php');
}
elseif ($_GET['page']=="main") {
include('main.php');
}
elseif ($_GET['page']=="tutorials") and ($_GET['id']=="") {
include('tutorials/main.php');
}
elseif ($_GET['page']=="tutorials") and ($_GET['id']=="1") {
include('tutorials/1.php');
}
elseif ($_GET['page']=="tutorials") and ($_GET['id']=="2") {
include('tutorials/2.php');
}
elseif ($_GET['page']=="tutorials") and ($_GET['id']=="3") {
include('tutorials/3.php');
}
else {
include('404.php');
}

?>

You can use 'and' in PHP right or is that why its not working?

�{=(~�::[Shea]::��~)=}�
How 'bout you sideburns, you want some of this milk?
This fading text is pretty cool, eh? I bet you wish you had some.
Add Thank You Quote this message in a reply
Jul. 19, 2004, 06:48 AM
Post: #25
 
Shea;

Coupla suggestions. One, I'm sure I've seen code us the "and" keyword, but you know, when I try to go find an example, I come up empty. Now why is that, I wonder. Use the amptersand, or a pair of them together, and see what happens.

Two, a programmer often thinks of placing the most commonly expected result at the beginning of a multiple test, such as yours. Sometimes it pays to put the least likely expected result at the head of the list, and work towards the most common expected result. Just a thought; you might reverse the order of your list of tests, and see what happens.


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Jul. 19, 2004, 05:07 PM
Post: #26
 
I just tried the 'and' command because I was looking through some PHP code for a download counter and I saw If '(whater=="4") and (blah=="9") {'...maybe I should try using a surrounding parenthesee. So it would be like:

Code:
elseif (($_GET['page']=="tutorials") and ($_GET['id']=="3")) {
include('tutorials/3.php');
}

�{=(~�::[Shea]::��~)=}�
How 'bout you sideburns, you want some of this milk?
This fading text is pretty cool, eh? I bet you wish you had some.
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: