[PHP] Re: Creating file & file permissions

2002-11-22 Thread Kyle Gibson
Hi All

I'm trying to create temp files with my script.
I'm using the line
$fp = fopen("users/temp123", "w+");

which produces the follow error

Warning: fopen("users/temp123", "w+") - Permission denied in
/webSite/signup.php on line 71

How do I get around this??



Make sure the 'users' directory is chmod'd correctly (777) so your PHP 
script has the ability (ie: permissions) to write/create files inside.


--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: dynamic arraynames

2002-11-22 Thread Kyle Gibson

Please can someone offer an idea.

I am trying to generate arrays to hold inputs to columns.  Column
titles are input to a table as needed.  They are read by the program
and placed across the page.  Then an array goes under each column name
to collect the inputs to the various rows.  Everything works except to
dynamically change the name of the array.  


while($foo=mysql_fetch_array($mysql_result)){
print "";}


I can't see how to change the name of the array on the fly.   
Or maybe their is a better way?  

Still trying to grasp what you're doing, but I think what you need falls 
under the category of variable variables.

For instance:

${"this"} = "some value";

...is the same as...

$this = "some value";

...which is the same as...

$text = "this";
${$text} = "some value";

So dynamic arrays could be generated simply by...

${$name} = array(".


http://www.php.net/manual/en/language.variables.variable.php

Might help too...

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: strings and vars

2002-11-23 Thread Kyle Gibson
Hi;

i have a string and I want to set it as a variable name.

like tahat

i have string like: "string";

how can i get variable $string;



I suppose you are trying to do the following:

$variable = "some value";

So if you wish to assign "string" as $string, simply do the following:

$string = "string";


--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Newbie: element index array

2002-11-24 Thread Kyle Gibson
If I declared an element indexed array and put some values into it:

$a['element1'] = array('btime' => '19D', 'etime' => '22D', 'dayname' => 4);
$a['element2'] = array('btime' => '12D', 'etime' => '20D', 'dayname' => 2);
$a['element3'] = array('btime' => '15D', 'etime' => '17D', 'dayname' => 3);

I would like to ask that how can I completely delete the $a['element2'] in
the array? That's mean I will get 'false' in 'isset($a['element2']) after
the delete process is taken place.

Thanks for your help.


Use unset()

http://www.php.net/manual/en/function.unset.php

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] does //commenting reduce performance?

2002-11-24 Thread Kyle Gibson
I have always had the opinion that the more comments you put into php
scripts, the slower they will run because there is more data to be read...
Can someone tell me if there is any truth in this or whether commenting has
absolutely 'no' impact on the performance of a script?


The comments are ignored, except the characters that initiate the actual 
comment.

//some comment
$somevar="va";

"some comment" wouldn't even be looked at. PHP sees the //, and goes to 
the next line.

I suppose on a large scale this could reduce performance, but the 
performance that is lost in standard applications is minuscule.

One thing you might want to avoid is using comments inside loops.


--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Another cookie question

2002-11-24 Thread Kyle Gibson
In the purpose of getting access to mydomain.se/ha/ I will set a cookie:
setcookie ("login", "OK", time()+3600, "/ha/");


Not sure if this is the case, but try this instead:

setcookie ("login", "OK", time()+3600, "/ha/","mydomain.se");

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] perplexed as to why this is happening...

2002-11-24 Thread Kyle Gibson
Howdy,

I'm doing a simple db check.. grabbing a db value, in this case $sec, based
on the user name registered in the session,
I've created a user called test with $sec  equal to "2" but when i get to
the second echo of $sec the value has changed to "1" and I can't understand
why... can some one please give me some idea as to why this is happening?

elseif ($_POST['cost'] >=11){
//query db
$res = mysql_query("SELECT sec FROM users WHERE uname='$_SESSION[uname]'");
$num = mysql_numrows($res) ;
if ($num == 1) {
//get results
$sec = mysql_result($res, 0, 'sec');
echo $sec; // pulls out sec as 2 ( as is sposed to )
}
if (!$sec = "1"){



Right there. Should be...

if ($sec != "1"){


--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] What is wrong here?

2002-11-24 Thread Kyle Gibson

I'm making a site which will reside in a remote server and had several
problems... most of them where solved once I saw that register_globals
are OFF, but now I don’t know which other settings are affecting my
scripts. I have trouble with header("Location... because the browser is
NOT redirected. If I set an echo statement after I detected that the
username and password using $_POST[""], the echo goes OK but if I
comment the echo and un-comment the 

header("Location: http://www.domainname.com";);
exit;

nothing happens... and no, there isn't anything before that... what can
be wrong? Thanks in advance,

The headers for the page might have already been sent. If there is a 
space at the top of your PHP file like below, any type of header change 
wont work:

---top of file



header("Location: ...");
exit;

?>

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: BBCode?

2002-11-24 Thread Kyle Gibson


Leif K-Brooks wrote:

I'm working on adding simple BBCode to my site.  I'm currently using the 
[i] tag for testing, with the following code:


function bbcode($text){
$text = ereg_replace('\\[i\\](.{1,})\\[/i\\]','\\1',$text);
return $text;
}
print bbcode('[i]This[/i] is a [i]test[/i].');
?>

But it prints "This[/i] is a [i]test".  Is there a better way to 
do this?


",$text);
	return $text;
}

print bbcode("[i]This[/i] is a [i]test[/i].");

?>

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: BBCode?

2002-11-24 Thread Kyle Gibson
Thanks, but that isn't what I want.  The point behind BBCode is allowing 
a small, simpler, securer, subset of HTML.  I.e. 
[img=http://domain.com/image.gif] changes to http://domain.com/image.gif"; alt="" />

In that case:

\\2',$text);
return $text;
}
print bbcode('[i]This[/i] is a [i]test[/i].');
?>

Prints:

This is a test.


--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: BBCode?

2002-11-24 Thread Kyle Gibson
This code is simply not suitable. The object is to replace tags as an entity 
as opposed to simply replacing '[' with '<'.

Obviously not. I was not fully aware of what he required.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: BBCode?

2002-11-25 Thread Kyle Gibson
Thanks a lot, but do you know how to do the same with ereg_replace?  I'm 
trying to learn PCRE, but until I do, I won't be able to add anything to 
this...


\\2',$text);
return $text;
}
print bbcode('[i]This[/i] is a [i]test[/i].');
?>


Works...



--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Newbie: ereg

2002-11-25 Thread Kyle Gibson
I still havent found a site that shows what I need.
I dont think php.net explain how ereg works.

I only want to publish stuff from the stringvariable $text thats inside tags
looking like this

This shall be visible
or
This shall be visible too

thanks
Martin



Try the following:

]+>)([^<]+)(]+>)",'\\2',$text);
return $text;
}

print format_text('This shall be visible.');

?>



--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: BBCode?

2002-11-25 Thread Kyle Gibson
Thanks, but that doesn't allow nested tags (a [b] tag inside of an [i] 
tag, for example).

Nested tags? Do you mean [ib] ? Or [i[b]]?

If you mean [ib], then I'm afraid what you want cannot be done in 
ereg_replace.

As far as I am aware, that is.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: BBCode?

2002-11-25 Thread Kyle Gibson
I think he means:

 "[i]A sentence in italics, with a word in [b]bold[/b][/i]"


Yeah he told me.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: BBCode?

2002-11-25 Thread Kyle Gibson
Thanks, but that doesn't allow nested tags (a [b] tag inside of an [i] 
tag, for example).

Try this:

\2',$text);

while($temp != $text)
{
$temp = $text;
$text = ereg_replace($pattern,'<\1>\2',$text);
}

return $text;
}

print format_text('[i] this is a [b]bold[/b] test [/i]');

?>



--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: More mail() questions.

2002-11-25 Thread Kyle Gibson
I am  trying to get the message portion of the email to have line breaks,
but  whatever I do it displays on one line. This is what I have.

$message = "1st Line\n";
$message .= "2nd Line\n";
$message .= "\n";
$message .= "3rd Line\n";
$message .= "\n";
$message .= "4th Line\n";

mail ("", $subject, $message, $headers);

TIA



As far as I've encountered, you can simply do the following:





--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: deleting a record.

2002-11-26 Thread Kyle Gibson
".$myrow['id']."  ".$myrow['company']."";
	printf("(DELETE)",
$PHP_SELF, $myrow["id"]);
}?>


There's an easier way to display this. It should make your life 
easier...made mine.

Take a look:


// get the list of resellers from the db
$res = mysql_query("SELECT * FROM resellers ORDER BY id");

// print all records in the DB
while ($myrow = mysql_fetch_array($res)): ?>


 



(DELETE)



now when I click on delete it just reloads the page and doesn't delete the
record. I have this code before anything else on the page to handle the
delete...

if($delete){
$res= mysql_query("DELETE FROM resellers WHERE id=$id");
header("Location: admin2.php?op=resellers");
}


What you should do here is check to see if $res is failing, simply by 
doing the following:

if(!$res) echo "error";

Then, place an 'exit;' after the header(...) command to see if the 
$delete variable is actually being passed.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: testing for empty array

2002-11-26 Thread Kyle Gibson
I have an array $keywords, how do I test to see if it is empty?  $keywords == '' seems to throw out an error.


Maybe...

if(count($keywords) <= 0)
{
	//...
}


--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: string

2002-11-29 Thread Kyle Gibson
hi everyone..
how to get the part of string and make it into a variable..
sample :
  "determine"
now, i want to take just "mine" or 4 word from right, or "deter" (for 
left function).
and after i got it, i want to make the "mine" into $x variable
my mind..
$x = "mean"
help please...

$x = substr("determine",-4);

For more information on SUBSTR,

http://www.php.net/manual/en/function.substr.php

;)

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: PHP & Javascript compatibilty

2002-11-29 Thread Kyle Gibson
I'm developing a WYSIWYG editor using PHP and Javascript (for COM). However, I start having problems when I try to display the page using the .php extension. The Javascript is not working. 

However, when I save it to HTML, it worked fine. 

Can anyone please help me? Why is this so? What can I do to get Javascript working with PHP with ease? Any articles on this?

Thanks a lot... again. :)

If you show me some code I can look at, I might be able to assist you.

You should have no trouble executing JS on a file with a .php extension, 
so long as it is incorporated into HTML.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing arguments to the same script

2002-12-01 Thread Kyle Gibson
Thanks for responding.  I think I'm still doing something wrong.  Take a
peek:

if(isset($_GET['questions'])) {
  echo "Questions link content will go here";
		   }
elseif(isset($_GET['samples'])) {
  echo "Samples link content will go here";
		   }
elseif(isset($_GET['rates'])) {
  echo "Rates link content will be here";
		   }
elseif(isset($_GET['contact'])) {
  echo "Contact information will go here.";
} else {
echo "Main content goes here.";
}

The only thing that EVER gets displayed is the final else. (Main content
goes here.)  What am I doing wrong?  Once again, the links are in this
format: 



This string merely filles the $HTTP_SERVER_VARS["QUERY_STRING"] variable.

So you should rather check to see if $HTTP_SERVER_VARS["QUERY_STRING"] 
equals 'questions', 'samples', etc...

$_GET['var'] requires that the link look like this:



You could then call $_GET['page'], which would contain the value samples.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Detecing a Number

2002-12-04 Thread Kyle Gibson
I have a repeating function to add. The user enters the number of how many
numbers they want to add, then it repeats a form field. What I want to do is
detect to make sure that the value they enter is a number. If not, don't do
the do while loop and if it is, then go ahead and do it. How can I do this?


If you don't want to deal with any JavaScript, I suggest you try a 
simple ereg function like below:

//$num = number entered by user

if(ereg("[^0-9]+",$num):
	//returns true, a non numeric character was found
else:
	//returns false, the string is all numbers
endif;

I haven't tested the above, so it may not work syntactically but the 
concept is the same...

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Just Curious

2002-12-07 Thread Kyle Gibson
I was just curious, but what program or website do you all use to view and
reply to the newsgroups with ?



Fun Fact # 14:
Netscape 7.0

;)

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Execute a cgi inside of php?

2002-12-11 Thread Kyle Gibson
include("");


If you wish for this to be a correct PHP statement, it should be:

include("");


Otherwise it will error.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Google and php

2002-12-13 Thread Kyle Gibson
Hi!

If i have made all my sub pages in my webpage by an include in index.php, like
http://example.com/index,php?page=subpage34
How can i make google to recognize my subpages allso?


Long as there is a link *somewhere* that google can come across to get 
to each sub-page, it will index every page of your site, regardless of 
what the URL is unless you specifically state otherwise in the 
robots.txt file.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: can I mail unlimited in one click?

2002-12-16 Thread Kyle Gibson
Hi,

I wonder if I can mail 300 customers in one click?

part of script:

while($listrow = mysql_fetch_array($listresult))  {

$recipient = $listrow[epost];
$subject = "$subj";
$message = "$mess";
$headers .= "From: $admail\n";
$headers .= "Reply-To: $admail\n";
$headers .= "X-Mailer: PHP\n";
mail($recipient, $subject, $message, $headers);
}

or is there a limit?

Thanks for any help
Jan Grafstrom



Why not just put all the email address into the BCC header field?


$headers .= "Bcc: $email[0], $email[1],,$email[n]\n";


Of course the BCC list could be filled programmatically...

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: nested if in a for statement

2002-12-17 Thread Kyle Gibson
 snip 
/* variables in array set earlier in script */
$userVars = array($nameFirst, $nameLast, $pass, $pass2, $auth, 
$dob_year, $dob_month, $dob_day);

for ($i=0; $i <= count($userVars); $i++) {
if (empty($userVars[$i])) {
 echo "please enter all required info";
 break;
}
}
--- snip 

count($array) returns the number of items in the array.

$array[$i] retreives the item at location $i, but remember, this 
location is ZERO-BASED. That means if we have an array of 10 items, the 
positions would be from 0 to 9.

In the above code you have $i <= count($userVars)

The problem is that when $i = count($userVars), $i has surpassed the 
position of the last time, thus causing it to return as being empty.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: nested if in a for statement

2002-12-17 Thread Kyle Gibson
count($array) returns the number of items in the array.

$array[$i] retreives the item at location $i, but remember, this 
location is ZERO-BASED. That means if we have an array of 10 items, the 
positions would be from 0 to 9.

In the above code you have $i <= count($userVars)

The problem is that when $i = count($userVars), $i has surpassed the 
position of the last time, thus causing it to return as being empty.

Basically, just remove the '=' from $i <= count($userVars)



--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: recommendation needed for dedicated server hosting

2002-12-18 Thread Kyle Gibson
Hi,
I recently went through a horrendous experience with two different hosting
providers.  I'd like some recommendations on excellent hosting providers if
anybody has some.

My key priorities in order are:
1) around-the-clock, technically competent TELEPHONE support (webchat
support, message boards, email based support etc. will not do!)
2) reasonable hosting fees (no more than 300/month) for a dedicated server
3) services for the following - backup, OS upgrades/patching, security

If anybody has been with a company that they're happy with for at least a
year please leave some feedback.  Thanks!


I've been with RackShack for a little more than a year now and I and 
very satisfied with them.

www.rackshack.net

Servers @ $99 per month

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: \Z characters

2002-12-21 Thread Kyle Gibson
$connection = db_connect("Could not connect  DB");
$SQL="SELECT id,PVLN from lhpl_side WHERE PVLN =\"\\Z\" ";
$result= mysql_query($SQL,$connection) or die (mysql_error());
$num = mysql_numrows($result);


Not too sure on this, but it might solve the problem. Use single quotes 
instead...

$connection = db_connect("Could not connect  DB");
$SQL="SELECT id,PVLN from lhpl_side WHERE PVLN ='\Z'";
$result= mysql_query($SQL,$connection) or die (mysql_error());
$num = mysql_numrows($result);


--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Problem with the List?

2002-12-21 Thread Kyle Gibson
Are my posts getting through?  They appear to come back on the list but I
also get this response...


I see them, so I suppose the list has received them.

I got that same error yesterday. Hmmm. :\

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Function returning a reference - how ?!?

2002-12-21 Thread Kyle Gibson
I'll try.


/* This function instantiates and returns a new Parent class. */
function createParent()
{
return new Parent;
}
/* $p is a reference of the Parent object created by createParent(). */
$p = &createParent();


I believe the problem occurs here. $p becomes a reference to the 
createParent() function whose return value is the Parent object.

This *should* work:

function createParent()
{
	//the lack of the '()' might have caused other problems
	return &new Parent();
}

$p = createParent();

That way $p equals the value that is returned by the function 
createParent, which is a reference to the Parent object.

Then again, I haven't tested any of this, just going on some instinct here.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cheap Hosting

2002-12-26 Thread Kyle Gibson
Hello,
 
I need a nice, reliable host for my new website. It needs to be fast, 
reliable, needs a good uptime, and some features. PHP and MySQL are the 
two I really need. Does anyone recomend one that's really cheap? So far 
I've found on, $5 a month, but it's slower then what'd I like. If 
nothing else pops up, I'll go with it. I'd also like domain parking 
and/or domain registration (don't really need the registration though). 
Thanks in advance!

Thanks,
Stephen Craton
http://www.melchior.us
 
"What is a dreamer that cannot persevere?" -- http://www.melchior.us

Try www.frozeonline.com

;)

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Newbie mail () question

2002-11-22 Thread Kyle Gibson
I have just built a simple formmail script that validates certain fields and
then if alls well mails the information to the client's email addressand
displays some confirmatin html. This is all fine except for one minor issue.
When I collect the email to check it looks OK etc the header From : in
Outlook Express gives the www.servername.com

Can I personalise this a bit to display the From:  as the email address that
the user has supplied i.e  $Email

I'm v. new to this so any help appreciated!



Try this:


//...snip

$headers="From: $name <$email>\r\n";
mail($recipient, $subject, $message, $headers);

//...end


The above code seems to work for me.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: put result of "include" into a variable

2002-11-22 Thread Kyle Gibson
For some (strange, I know) reason I would like to copy the content of a
webpage into a database.

I would like to have code like

$whocares = include ("http://www.microsoft.nl";);
$query = "insert into html values ($whocares,...)";
..

However, include can not copy the content to a variable. Does anyone
have an idea how to circumvent this problem?



Try:

$fp = fopen ("http://www.example.com/";, "r");
$data = "";
while(!feof($fp))
{
	$data .= fread($fp,1024);
}

//$data now contains all the html for the website

fclose($fp);

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] $HTTP_SERVER_VARS

2002-05-04 Thread Kyle Gibson

Heya folks,

I've got a little problem here, maybe you can help me out.

$HTTP_SERVER_VARS["HTTP_REFERER"] is supposed to point to the referring 
webpage, if it exists. As is $_SERVER["HTTP_REFERER"] and $HTTP_REFERER 
itself.

However, it seems that I do not have this variable available on my 
server. I do however have this funky variable called "HTTP_WREFERER" 
which returns a strange string like value like below:

VLMHAALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJ

I've searched PHP.net, and practically every PHP site on the Internet 
with no luck as to what this is supposed to represent. I've even tried 
to find out how I could "enable" the HTTP_REFERER variable, since it 
seems that it is disabled or something.

I am guessing that WREFERER is some kind of encrypted version of 
HTTP_REFERER, but I don't know. It changes everytime, so it is hard to say.

I'm running on PHP Version 4.0.6, if that helps.

Thanks,

Kyle Gibson


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] SSH

2002-05-04 Thread Kyle Gibson

I am curious as to how I would go about executing SSH command line 
operations through PHP. Say for instance the command "ftpwho", which 
would return a list of users connected to a FTP server, along with what 
they are doing, etc. I've tried to open a socket to my SSH server, along 
with the functions system(), shell_exec(), and exec().

Thanks,

Kyle Gibson




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $HTTP_SERVER_VARS

2002-05-04 Thread Kyle Gibson

> Have you tried looking at a phpinfo() page and seeing what variables are
> available?
> 
> Make a page with just the following line in it and load it up through
> your web server.
> 
> 


Yes. That is how I know of WREFERER. Do you know what it is?

If you want, you can look at my phpinfo page here:

http://php.plaguenet.com/MyAdmin/phpinfo.php.


Kyle Gibson




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $HTTP_SERVER_VARS

2002-05-04 Thread Kyle Gibson

Whoops. It wont show unless you come from somewhere else...


Go here and click the link:

http://www.plaguenet.com/wreferer.php


Thanks,


Kyle Gibson



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: SSH

2002-05-04 Thread Kyle Gibson

Thanks, I'll try what you suggested.



-Kyle


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: $HTTP_SERVER_VARS

2002-05-04 Thread Kyle Gibson

My firewall prevented me from seeing the variable in action.


Ignore this.



-Kyle



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: HTML to mysql - from msql to html

2002-05-04 Thread Kyle Gibson

You entered data into a text area field that was entered into a mysql 
row. Then you tried to print it out.

Try this:

$content = str_replace("\n","",$row["row_name"]);

echo $content;


-Kyle


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] weird foreach problem when calling date or getdate function,

2002-05-04 Thread Kyle Gibson

> Those numbers don't look like timestamps to me (as they can't be larger 
> than about 4294967296). What they look like is the result of some imp or 
> perhaps even a gremlin breaking into your code and smooshing together 
> yearmonthdayhourminutesecond, then trying to PRETEND it's a timestamp.
> 
> Go back and read the date/time chapter of the PHP manual a little more 
> closely.
> 
> miguel


They look like MYSQL timestamps to me.

http://www.php.net/manual/en/function.date.php

The MySQL timestamp format is NOT the same as the PHP timestamp format
(otherwise known as the Unix timestamp format).

MySQL uses a MMDDHHMMSS format whereas PHP uses a  format.

MySQL timestamp: 20020207164744
PHP (Unix) timestamp: 1013096864



-Kyle




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $HTTP_SERVER_VARS

2002-05-05 Thread Kyle Gibson

> My last guess, was to turn off my Firewall (*Norton* Personal Firewall)
> and after that my PC returned a correct HTTP_REFERER!


Exactly what I did. Funky, huh?


Thanks,

Kyle Gibson


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: SSH

2002-05-05 Thread Kyle Gibson

I've tried this,



$cmd = `ftpwho`;
echo $cmd;

and/or

$cmd = shell_exec("ftpwho");
echo $cmd;




But I get this error:

Warning: Cannot execute using backquotes in safe mode in test.php on line 2



-Kyle


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: SSH

2002-05-05 Thread Kyle Gibson

> Your ISP has safe mode turned on which means you cannot use backquotes. Read all 
> about it at http://www.php.net/manual/en/features.safe-mode.php.


I am my own ISP, techically.

In the php.ini file, safe mode is off. Which is why I am curious as to 
why this is occuring.

---
;
; Safe Mode
;
safe_mode = Off

---


-Kyle


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Who's having a good hosting experience these days?

2002-05-05 Thread Kyle Gibson

> My clients aren't rich big money folks but I need a PHP capable host for
> 
> about $11ish or less a month.  Traffic is minimal, and like I say the
> only tech support calls I've had to make this past year were when the
> hosting service tweeked and freaked something thus messing it all up.


http://solutions.plaguenet.com/

HTH


-Kyle


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: SSH

2002-05-05 Thread Kyle Gibson

> What does phpinfo() have to say about it?


It says that the Local Value is "on" but the master value is "off".


-Kyle



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php