[PHP] Re: Making a simple borderless pop up window with a Close button

2002-03-20 Thread qartis

If you want a popup window that lacks a border entirely, check out
chromeless windows at www.microbians.com



Denis L. Menezes [EMAIL PROTECTED] wrote in message
000f01c1cf3f$5321d520$c900a8c0@d8d0l7">news:000f01c1cf3f$5321d520$c900a8c0@d8d0l7...
 Hello friends.

 I am making a database website where I need to add a small help button for
 every field on the form. Whenever the user clicks the small help button, I
 wish to show a titleless popup window containing the help text and a
close
 button. Can someone  help me with the php script for this.

 Thanks
 Denis




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




[PHP] Re: setcookie problem: Cannot add header information - headers already sent by

2002-03-13 Thread qartis

I don't think you can have an empty line (even in the php) before cookies
are set


Frank Ramsay [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Cookies have to be set before the HTML block begins.

 -fjr

 Bob wrote:

  here is the example:
 
  ?php
  // Beginning php
 
  // Saving the page header in the variable $head.
  $head = ENDH
  !DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN
  html
head
  titleFeedback form/title
/head
 
body bgcolor=white
  h1 align=centerFeedback form/h1
  ENDH;
  // End of page header
 
  // Saving the page footer in the variable $tail.
  $tail = ENDT
  hr
/body
  /html
  ENDT;
  // End of page footer
 
  // Set up variables that will be saved in the cookies
  // Define unique cookie prefix
  $ID = My_ID;
  // Cookie lifetime in seconds (in this example, three days)
  $cookie_life = 60;
  // Name of cookie that holds the user's name
  $n_name = $ID . _Name;
  // Name of cookie that holds the user's email
  $n_email = $ID . _Email;
  // Name of cookie that holds the user's last login
  $n_last = $ID . _Last;
 
  // These lines print the form with user input and mails to the
  webmaster.
  if( isset($sfeedback)) {
  Setcookie($n_last,Date(H:i d/m/Y),time()+$cookie_life);
  print $head;
  ?
  Thanks for your feedback, ?php echo $name ?. Here is what you
  said:br
  Name: ?php echo $name ?br
  Email: ?php echo $email ?br
  Feedback: ?php echo $feedback ?br
  ?php
  // Mails the feedback to the webmaster.
  $subject = Feedback from your site;
  $sendto = [EMAIL PROTECTED];
  $header = From: $email;
  mail($sendto, $subject, $feedback, $header);
  print Thank you.  Your comments have been sent to the
  webmaster\n;
  // Print end and leave
  print $tail;
  exit();
  }
 
  // This loop treats users who have not been to the site before.
  if(!$$n_last) {
  if( ! isset($name)) { // if no name - display the form
  echo $head;
  ?
  Welcome to our system! Please fill in the following information:
  !-- $PHP_SELF is the PHP way of referring to the current page --
  form action=?php echo $PHP_SELF ? method=POST
  Name: input type=text name=namebr
  Email: input type=text name=emailbr
  !-- Submit button --
  input type=submit value=Submit/form
  ?php
  echo $tail;
  exit;
  } else {
  // Set cookies and continue
  Setcookie($n_name,$name,time()+$cookie_life);
  Setcookie($n_email,$email,time()+$cookie_life);
  $$n_name = $name;
  $$n_email = $email;
  }
  }
 
  // This loop treats repeat users.
  Setcookie($n_last,Date(H:i d/m/Y),time()+$cookie_life);
  echo $head;
  ?
  Welcome back to our system, ?php echo $$n_name ?.
  ?php
  // Have previous login
  if($$n_last)
  echo Your last login was on  . $$n_last . .;
 
  // User fills in feedback form
  ?
  form action=?php echo $PHP_SELF ? method=POST
  Name: input type=text name=name value=?php echo $$n_name
  ?br
  Email: input type=text name=email value=?php echo $$n_email
  ?br
  Feedback:br
  textarea name=feedback wrap=virtual cols=40 rows=5
  /textarea
  br
  !-- Submit button --
  input type=submit value=Submit name=sfeedback
  /form
  ?php echo $tail ?
 
 
  Warning: Cannot add header information - headers already sent by
  (output started at C:\WebShare\wwwroot\last\cookie.php:59) in
  C:\WebShare\wwwroot\last\cookie.php on line 75
 
  Warning: Cannot add header information - headers already sent by
  (output started at C:\WebShare\wwwroot\last\cookie.php:59) in
  C:\WebShare\wwwroot\last\cookie.php on line 76
 
  Warning: Cannot add header information - headers already sent by
  (output started at C:\WebShare\wwwroot\last\cookie.php:59) in
  C:\WebShare\wwwroot\last\cookie.php on line 83
 
  what' wrong?
  thanks!




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




[PHP] Re: Need Urgent Help!!

2002-01-31 Thread qartis

Make flash send the form's variables to email.php. Contents of email.php:


?
$message = Your message here. If you'd like to use some of the form
elements, call them as $varname. To make a newline in the mail message type
\n.;

// $toemailaddress will need to be set to the recipient's email address. In
flash, set a form element to be named toemailaddress. In PHP, uncomment the
line below.
// $toemailaddress = [EMAIL PROTECTED];

if ( mail ($toemailaddress,'Your message subject here,$message,'From:
[EMAIL PROTECTED]')){
echo ?sent=true;
} else {
echo ?sent=false;
}
?


This script will also tell your flash file whether the mail was successfully
sent or not, by outputting sent as 'true' or 'false'.




Scott [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 All,
 I have just found out that the VB script that I have used to send email
from
 my web site is null and void, apparently the server does not do VB or
 something along those lines (security) but that's not the issue.  I have
 contacted my teh people who host my site and they told me I have to use
PHP
 script.
 My website (Flash) needs to be able to send emails and membership
 applications from form I have already created, does anyone have any
scripts
 and directions that some with absolutely no code writing skills can use.
 Your help is greatly appreciated!!
 Billy





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Making your include files invisible (header() in if loop)

2002-01-31 Thread qartis

I wanted to hide the existance of my include files by making them
'invisible': give a 404 error when requested. This worked, but the files
that were including were obviously 404ing too. So I decided to use $PHP_SELF
and check whether the script's PHP_SELF was it's filename, which would mean
that it was being accessed directly, as opposed to being included. I tried
this code:



(include.php)
?
$string = include;
$container = $PHP_SELF;
if(strstr($container,$string)) {
header(HTTP/1.0 404 not found);
exit;
}
?


at the top of the include files, but it wasn't working. Change the header()
to an echo and test it. It echoed. So it's a problem with the header(). I
tried this:


?
header(HTTP/1.0 404 Not Found);
?


and it worked perfectly. Can header() not be in an if loop or something like
that?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] File uploading like hotmail

2002-01-28 Thread qartis

I think you might be looking for input type=file HTML form element.


Duky Yuen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I want to make something like when you are attaching something to an
 email in hotmail. I want to make something that searches your own
 computer for files on your harddisk that you want to upload to the
 server.

 But I don't know if this is possible. If this is possible.Can somebody
 tell me which function I should use? Or if someone have an example...
 please...

 Duky




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] using a text file for variables in a form?

2002-01-26 Thread qartis

The HTML would be having problems because PHP would compile this:

--
?
print 'INPUT TYPE=TEXT NAME=savings VALUE=' .
$data[SAVINGS] . ';
?
--

as:

--
INPUT TYPE=TEXT NAME=savings VALUE='
--

Note VALUE's quotes:  and '. Try with this:

--
?
print 'INPUT TYPE=TEXT NAME=savings VALUE=' .
$data[SAVINGS] . '';
?
--

Alexis N. Mueller [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Dan,

 Thanks for replying so fast.. I tried it out right away.

 The script part of it didn't seem to give me much grief, however the html
 part of it seems to be having issues
 with the combination of single quotes (') and double qouotes (), or maybe
 it's the order, or a linebreak in the email... i don't know...

 ?
 print 'INPUT TYPE=TEXT NAME=savings VALUE=' .
 $data[SAVINGS] . ';
 ?

 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Any Ideas

2002-01-26 Thread qartis

I'm guessing something along the lines of:

--
$string=str_replace(!,,$string);
$string=str_replace(@,,$string);
$string=str_replace(#,,$string);
$string=str_replace($,,$string);
$string=str_replace(%,,$string);
$string=str_replace(^,,$string);
--

etc.


Philip J. Newman [EMAIL PROTECTED] wrote in message
003d01c1a6a5$fa7d60e0$0401a8c0@philip">news:003d01c1a6a5$fa7d60e0$0401a8c0@philip...
Any Ideas how I can remove   !@#$%^*()_+=-';:/.,? charactors from a
string?

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Speed test: mysql query vs. file_exists()

2002-01-24 Thread qartis

I'm running a logs system where log entries are .log files with filenames
like 03012002.log for January 3rd, 2002. You can view when logs have been
posted with a calendar, which will make the particular day a link if that
day's log file exists. I'm thinking of storing the log entries in a mysql
database, using code somewhat like the following:

$query = select username, log, date_format(date, '%a %b %D') as date, from
logswhere username = $username;
$dates =  mysql_db_query($bb_news_db, $query) or die(Select Failed!);
while ($row = mysql_fetch_array($dates)) {
$date[row[$dates]]=1;
}

So that each log entry would be put in the $date[] array, and then when the
calendar script wanted to find out if there was an entry by that user on
that particular day, it would just have to check the $date[] array.Will
there be any speed difference between this and my current (file_exists();)
method?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] WAP

2002-01-17 Thread qartis

An easier way to do this is (in wap.php):

?
header(Content-type: text/vnd.wap.wml);
echo(?xml version=\1.0\?\n);
echo(!DOCTYPE wml PUBLIC \-//WAPFORUM//DTD WML 1.1//EN\
\http://www.wapforum.org/DTD/wml_1.1.xml\;\n\n);
?

And then continue with wml tags. This will be parsed by php but will also
have correct headers for WAP browsers.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: To you know-it-all's out there...

2002-01-06 Thread qartis

Your code works perfectly as a .php file



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Extract a string from a string

2002-01-03 Thread qartis

Thank you very much!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Extract a string from a string

2002-01-02 Thread qartis

I've got a search script, where you can search for a string and it will
return links to the HTML files that contain the string. I've also written a
function, where it will highlight each instance of the searched string by
using:


$asdf = fopen($logfile, r);
$contents = fread($asdf,filesize($logfile));
fclose($asdf);
$contents=stri_replace($hi,b
style=\color:black;background-color:#FFCC66\.$hi./b, $contents);
echo $contents;


(stri_replace because I wrote a function to do that)
Where $hi is the string that is to be highlighted. Of course, if the user
searched for HI, and Hi was found, it would show up as a highlighted HI,
becuase it only uses $hi as the highlighted word, not the original string.
I'm fairly sure that I could do this with ereg functions, but I've spent too
long looking and now it just about makes me sick just looking at it.

Pleeease, can anybody help?


-qartis



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]