Search found 14 matches

by somdcomputerguy
Sun Sep 29, 2013 7:34 pm
Forum: PHP Scripts
Topic: Input form and assign new URL to variable
Replies: 1
Views: 1113

Re: Input form and assign new URL to variable

This should give you the full URL of the page you're at, I don't know if this is what you need though..

Code: Select all

echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
by somdcomputerguy
Sun Sep 22, 2013 4:13 am
Forum: PHP coding => General
Topic: how to generate 3 unequal numbers?
Replies: 5
Views: 1176

Re: how to generate 3 unequal numbers?

:o Well I did come up with a solution, see my second post in this thread, and in my first post, I thought I had declared that the declaration of the variables were OK as they were, but I probably wasn't too clear (definitive) on that. But thanks again anyway, for providing some code that shows a dif...
by somdcomputerguy
Sat Sep 21, 2013 9:11 am
Forum: PHP coding => Mail
Topic: simple mail code
Replies: 1
Views: 945

Re: simple mail code

maybe this'll work

Code: Select all

if !mail($email_to, $email_subject, $email_message, $headers) die('error!');
by somdcomputerguy
Fri Sep 20, 2013 8:37 pm
Forum: PHP coding => General
Topic: how to generate 3 unequal numbers?
Replies: 5
Views: 1176

Re: how to generate 3 unequal numbers?

Hmm, interesting approach johnj. But the first variable (A) needs to be either 2 or 3, and B needs to be either 4 or 5, while C can be any number 2 thru 5, but not equal to (the same as) A or B. Thanks for the reply though!
by somdcomputerguy
Fri Sep 20, 2013 7:55 pm
Forum: PHP coding => General
Topic: how to generate 3 unequal numbers?
Replies: 5
Views: 1176

Re: how to generate 3 unequal numbers?

Well I did write code that does what I want. I used two If loops in a While loop. Like I said, it does do what I want, but I spent too much time trying to get it to work. I concluded that I would put it all in a While loop, instead of a Do .. While loop, but I spent alot of time trying (unsuccessful...
by somdcomputerguy
Fri Sep 20, 2013 4:25 pm
Forum: Your Scripts
Topic: PHP generated website skeleton
Replies: 0
Views: 1184

PHP generated website skeleton

This is a slimmed down bit of PHP code that I use to make the sites that I make. <? include("menu.txt"); if (!isset($_GET['page'])) { include("mainpage.txt"); exit; } if (file_exists($_GET['page'] . ".txt")) { echo "<script type='text/javascript'>document.title='Website - " . ucfirst($_GET['page']) ...
by somdcomputerguy
Fri Sep 20, 2013 4:02 pm
Forum: PHP Scripts
Topic: Creating a Script
Replies: 1
Views: 1402

Re: Creating a Script

I realize this is a somewhat old thread that I'm replying in, but, I'm fairly new here and I want to provide any info I am capable of.. Most, if not all, free web hosts do not have, or make available, PHP. Perhaps this free host you refer to is one of them. Send them an email and ask, or browse thru...
by somdcomputerguy
Fri Sep 20, 2013 10:49 am
Forum: PHP coding => General
Topic: how to generate 3 unequal numbers?
Replies: 5
Views: 1176

how to generate 3 unequal numbers?

I need to produce 3 random numbers (from 2 to 5) that aren't the same. The first and second variables are what they are, and the third variable shouldn't equal either one of the first two. I have this code (which doesn't work for me, obviously), and I have tried multiple variations of operators. I c...
by somdcomputerguy
Fri Nov 25, 2011 2:26 pm
Forum: JavaScript
Topic: validate the phone number.
Replies: 1
Views: 873

Re: validate the phone number.

by somdcomputerguy
Tue Nov 15, 2011 6:33 am
Forum: PHP General
Topic: Search music Lyrics on the net
Replies: 0
Views: 318

Re: Search music Lyrics on the net

Possible? Probably. But what specifically do you want to search for? Any lyrics? Lyrics for a particular song? A specific word in any lyrics? A specific word in lyrics for a particular song? A list of sites, or just one site, with lyrics would help too.
by somdcomputerguy
Tue Nov 15, 2011 6:23 am
Forum: PHP coding => General
Topic: wrong PHP code?
Replies: 3
Views: 554

Re: wrong PHP code?

Is there a value for $_POST[DJ]?
by somdcomputerguy
Mon Nov 14, 2011 5:41 pm
Forum: PHP General
Topic: Looking into a PHP file on a websrver
Replies: 0
Views: 331

Re: Looking into a PHP file on a websrver

robbeh989 wrote:I was wondering if there was a way I could download/see the script on their page.
This is not possible.
by somdcomputerguy
Mon Nov 14, 2011 1:08 pm
Forum: PHP coding => General
Topic: error line one?
Replies: 1
Views: 386

Re: error line one?

Well there is no PHP start and end tags in your third code snippet..
by somdcomputerguy
Sat Nov 12, 2011 4:52 pm
Forum: PHP coding => General
Topic: Case Statement
Replies: 0
Views: 287

Re: Case Statement

Try it out this way. This is what you're after I think.

Code: Select all

<?php
  $months= array('Jan', 'Feb', 'Mar', 'Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec',);
  $number = rand(0,11);
   print($months[$number]);
?>