Creating a dynamic signature

Anything technology related that does not fit in other categories
tw2
Posts: 99
Joined: Wed Sep 24, 2003 9:11 pm

Creating a dynamic signature

Post by tw2 »

red
i`m reading through this mess man
only one way this will get fixed..
you need to sit down and start over from the begining
and post it from the start. on how to .
if everyone keeps trying what you posted it will never work as you know .
a few steps were left out .i think you got in a little bit of a rush.
oh well a good winter time project.. :P

Archived topic from Iceteks, old topic ID:1293, old post ID:12094
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

tw2 wrote: red
i`m reading through this mess man
only one way this will get fixed..
you need to sit down and start over from the begining
and post it from the start. on how to .
if everyone keeps trying what you posted it will never work as you know .
a few steps were left out .i think you got in a little bit of a rush.
oh well a good winter time project.. :P
All the article was really intended for was to explain the concept - not the actual code. I just used that code for an example, but you can use anything. As long as you have a
random <?php header("location: ");?> it makes it work.

I think the only problem in this case is a script error. If you copy and paste my script I can't see why it does not work.

Archived topic from Iceteks, old topic ID:1293, old post ID:12095
Honk if you love Jesus, text if you want to meet Him!
tw2
Posts: 99
Joined: Wed Sep 24, 2003 9:11 pm

Creating a dynamic signature

Post by tw2 »

yes but, red.
the way it was posted.that is what they think it the code step by step
on how to make it :rolleyes:

Archived topic from Iceteks, old topic ID:1293, old post ID:12098
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

Might re-do it later. But the thing is, if it's done correctly it should work first shot, so not really sure what to add.

Archived topic from Iceteks, old topic ID:1293, old post ID:12107
Honk if you love Jesus, text if you want to meet Him!
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

Red Squirrel wrote: Might re-do it later. But the thing is, if it's done correctly it should work first shot, so not really sure what to add.
So you mean that there were other steps that you left out? I definately think that you should re-write it, I dont see why you shouldn't.

Archived topic from Iceteks, old topic ID:1293, old post ID:12198
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

No steps where left out, but just a few obvious ones I might of not put enough details on. Now that I think of it, I never actually emailed the other tech sites to get this posted everywhere, so I'll redo it and email them after.

Archived topic from Iceteks, old topic ID:1293, old post ID:12202
Honk if you love Jesus, text if you want to meet Him!
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

Ok, I just rewrote some parts, try it again and let me know if it works. I want to make sure I did not leave anything out and if you get it to work I'll send it over to a few hundred tech sites for posting. I never even did it when I first submitted it anyway. Almost 1000 hits is pretty good for something that's hardly been around. :dance:

http://www.iceteks.com/articles/db.php/act...icle/dynsig/p/1

Archived topic from Iceteks, old topic ID:1293, old post ID:12208
Honk if you love Jesus, text if you want to meet Him!
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

even with you re-writing the article I think the first one had more information. I still am not getting this right and I think it's because you might be leaving out the stuff that you think is obvious, and it's not to me.


Archived topic from Iceteks, old topic ID:1293, old post ID:12228
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

Nothing is left out. It's as complicated as it gets. What is it doing? What's the link to the image, I'll check it...

Archived topic from Iceteks, old topic ID:1293, old post ID:12230
Honk if you love Jesus, text if you want to meet Him!
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

That's most likely a result of the .htaccess file not working properly or something. It should have

ForceType application/x-httpd-php

and then the .jpg (php code) should go in the same folder.

Archived topic from Iceteks, old topic ID:1293, old post ID:12435
Honk if you love Jesus, text if you want to meet Him!
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

See I have everthing that you are saying, but it's just not working. Maybe I am going to try this on a different server besides mine, since I use a newer version of PHP and maybe the syntax changed?

Archived topic from Iceteks, old topic ID:1293, old post ID:12436
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

Could be... maybe put everything in a folder and send it to me and I'll check if it works on my host "as is". Maybe it's my version of php or something...

Archived topic from Iceteks, old topic ID:1293, old post ID:12438
Honk if you love Jesus, text if you want to meet Him!
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

Can you show me a link of what you mean?

Archived topic from Iceteks, old topic ID:1293, old post ID:14146
Honk if you love Jesus, text if you want to meet Him!
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

It should read it as php but it should not be displaying anything but the image, what exactly do you get, just the php code? You should be getting the image.

Archived topic from Iceteks, old topic ID:1293, old post ID:14189
Honk if you love Jesus, text if you want to meet Him!
Chris Vogel
Posts: 5140
Joined: Fri Jan 10, 2003 1:14 am

Creating a dynamic signature

Post by Chris Vogel »

Is there a way to use the rand() function instead what you have done?

Maybe something like this:

Code: Select all

<?php
$random = rand(1,10);
header("Cache-Control: no-cache, must-revalidate, no-store");
header("Location: http://whatever/sig/sig$random.jpg");
?>
[code]

Assuming you have ten jpg images named correctly... 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:1293, old post ID:15087[/size][/color]
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

Yep would work. I did not know about the rand command when I wrote that article, I use it allot in the cybervillage bank steal section and stuff. :)

Archived topic from Iceteks, old topic ID:1293, old post ID:15093
Honk if you love Jesus, text if you want to meet Him!
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

[quote=takahita_tsukino] Is there a way to use the rand() function instead what you have done?

Maybe something like this:

Code: Select all

<?php
$random = rand(1,10);
header("Cache-Control: no-cache, must-revalidate, no-store");
header("Location: http://whatever/sig/sig$random.jpg");
?>
[code]

Assuming you have ten jpg images named correctly... [/quote]
 damn you tak! You telling me the script can be that simple now? Figure it out red! 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:1293, old post ID:15138[/size][/color]
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

That's IF you have the images named properly. If you have it like mine (a b c etc) then you need if statements for each one. But it's not more complicated, it's just more code.

Archived topic from Iceteks, old topic ID:1293, old post ID:15145
Honk if you love Jesus, text if you want to meet Him!
Chris Vogel
Posts: 5140
Joined: Fri Jan 10, 2003 1:14 am

Creating a dynamic signature

Post by Chris Vogel »

Red Squirrel wrote: That's IF you have the images named properly
Yep, as in sig7.jpg or sig10.jpg... :)

Archived topic from Iceteks, old topic ID:1293, old post ID:15146
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

takahita_tsukino wrote:
Red Squirrel wrote: That's IF you have the images named properly
Yep, as in sig7.jpg or sig10.jpg... :)
which is what I had, Someone make the script work and let me know, I can care less about renaming the pictures, just make sure it works, we have been trying to get this to work for a long time now..

Archived topic from Iceteks, old topic ID:1293, old post ID:15171
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

Use something like this:

Code: Select all

<?php
$random = rand(1,10);
header("Cache-Control: no-cache, must-revalidate, no-store");
header("Location: http://whatever/sig/sig".$random.".jpg");
?>
[code]

That should do it.  Make sure the random 1,10 is the right numbers for what you have.

 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:1293, old post ID:15172[/size][/color]
Honk if you love Jesus, text if you want to meet Him!
Chris Vogel
Posts: 5140
Joined: Fri Jan 10, 2003 1:14 am

Creating a dynamic signature

Post by Chris Vogel »

".$random.".
Could you please explain why you did that? :)

Archived topic from Iceteks, old topic ID:1293, old post ID:15173
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

how about just the whole code, I want to get this right.

Archived topic from Iceteks, old topic ID:1293, old post ID:15197
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

It tells php that it's a variable. For example, you have this:

$variable="text";

echo("$variablesome stuff");

output: $variablesome stuff

But if you use

echo($variable."some stuff");

output: textsome stuff

But I've also seen situations where the first example still outputs the variable, so either way is probably ok, but the second way is the better way to do it. It's just easier to read.

Archived topic from Iceteks, old topic ID:1293, old post ID:15202
Honk if you love Jesus, text if you want to meet Him!
Chris Vogel
Posts: 5140
Joined: Fri Jan 10, 2003 1:14 am

Creating a dynamic signature

Post by Chris Vogel »

Is there a way to use get a random letter? I guess I could do rand(1,26) and then pair up a number with a letter, but is there an easier way?

Archived topic from Iceteks, old topic ID:1293, old post ID:15246
Locked