Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Alert Boxes


do u know the alert box in javascript?

when u write alert("somthing");

well i need that in php what is the alternative function for that in php?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Alert Popup Box
I can't find a way to create an alert popup box for debugging, is this
possible in php? I guess I'm thinking of visual basic where that was so
easy, in php I normally use *print* for this but it can be hard to find.

Making An Alert With Php
i have this code that when the user click it will delete the record:

echo' <td bgcolor="'.$color.'" width="40"><font face="Verdana"
size="1">
<a href="del.php?id='.$id.'&dbf='.$dbf_new.'">delete</a></
font></td>'

i wanted to do a little confirmation before commiting the action. how
to do it?

Alert Messag
I have trouble to display an error message when user does not select anything from a drop down menu in the form. What makes my situation different is that the data in the drop down menu is generated from the database. Code:

Alert Function
Would somebody tell me how I use the onmouseover=alert('string') in a
PHP script without using of JavaScript?

File Changed Alert
I have a Client Management system, and the client's plain text files financialplan.txt, contactinfo.txt, and projectdesc.txt.

These text files are in the client folder (public_html/clients/george) and they are to be included onto one of the client management pages (not yet created).

I need to know if there is a way to detect if a file has been edited, and alert a user if he or she has not yet viewed the changes. The client files might be edited by myself, and my partner to be alerted of these changes, so he may go view the changes. Then when he has viewed the changes the alert would go away, of course.

Alert By Clicking On A Link
Is it possible to set a javascript alert before executing a php script when a hyperlink is clicked. i.e. user clicks hyperlink "delete" to execute delete.php?task=del&id=2

Javascript Alert Question
I'm working on an e-mail form (btw many thanks to Philip Ronan for the
very cool email address format tester function, best I've seen so far).

I've been trying, with limited success, to produce a javascript alert
box which shows the user a validation error message. The error message
itself is dynamic, i.e., it's contained within a php variable.

I seem to be running into two issues:

1. I can raise the alert box, but I can't pass the string contained in
the $myerrormessage variable. Clearly I don't quite have the syntax just
right.

2. When the alert box does appear, the content of the web page behind
the alert box disappears, i.e., the page goes blank. When the user
clicks the OK button on the alert box, the blank web page remains, and
the user must click the Back button to return to the form.

The html that generates the form is wrapped inside a php function (the
file itself is php). The 'action' attribute of the form is "<?php echo
$PHP_SELF ?>". The form also contains a hidden field called 'action'
whose value is 'send_mail'.

When the user clicks the submit button, the script calls itself
recursively, and the $action variable's value, 'send_mail', is sent to a
switch. The switch calls a send_mail function, which performs all the
validation checks and generates an html error message if $myerrormessage
is not empty. This script was based on models provided in this book:

http://www.wrox.com/WileyCDA/WroxTi...0764557440.html

Currently I'm rendering the error message via another php function which
produces the html containing $myerrormessage. This works just fine, of
course, but I'm afraid some wiseguy web developer out there will look at
it and proceed to tell me all about how lame it is.

Can I add an onclick attribute to the form, to call a javascript
function inside the <body> tag of the html which renders the form?

Security Alert! The PHP CGI Cannot Be Accessed Directly.
I have installed php4.2.2 using the windows installer but i am having problem. I get the message:

Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.

Empty Field Alert And Go Back
I would like to alert the user that leaves a blank field that it is obligatory. After that return him to the previous page... I tried this code but it doesn't work. I can either alert and continue to the next page, or simply return to the previous page without the alert.. Code:

HTML Forms - Alert To Save Changes
Is there a way in PHP to prevent a user from moving away from a page with an HTML form on when they made changes and didn't click submit? I would like some alert box to confirm if they want to leave or if they want to save the changes. Is that at all possible? I've tried Javascript but with no luck.

PHP And Java Applet : Instant Alert Problem......
I have a web page entry and a java applet running at the "manager" office. I need to instantly send an alert to the "manager" once the customer had key in their transactions.

I'm wondering how should I do this? by using php socket? to use another programming language to develop the server ? anyone with any experience before in doing this.

I did manage to come out with something. Here's what I've come out with :

a) a php socket server waiting for connection.
b) load an applet to connect to the php socket server.
c) the socket server will fetch from the database every 'n' seconds to send the latest data.

it works.....but the php socket can only allow one connection at a time. And I am trying to make it as real time as possible because a few sec of delay can cause a very big impact.

How To Redirect After (header) After Sending An Alert Message
I have a php script that checks whether the user is allowed to perform an
action. If he is not allowed; I display a warning; using the alert function.
After clicking away this function, I want to redirect the user to the
original page using the header function.
However, I get the normal message " headers already sent"... I know what
the problem is.
But how do you normally deal with this situation? use a html/php for the
warning instead of alert message? or is there another way?

Popup Alert Similar To Yahoo Messenger In PHP
I would like to create a pop up something similar to yahoo messenger
popup which comes on the right pan of the status bar. This i planned
to alert the users via popup when he gets the mail.



Check Boxes
I have a very little problem with check boxes. How can I write a simple PHP code to tell me when a check box has been checked, and then use the name of the checkbox in a function.

Reading POP Boxes
I've been looking round for something that will read the contents of a pop
box and populate a MySQL table.

The e-mails will all be of a fixed format and include a jpeg as an
attachment. I need to put the following columns in:

sender
subject
body
filename (possibly appended to the date to mitigate the risk of
The script would also need to save the attachment to a predetermined folder.

Does anyone know of anything that would do this? Alternatively, how much
would it cost for someone to get this working for me?

Combo Boxes Question
I am wondering how I can make the whole array appear in the code that is below with the database entry to be selected. At the moment it just displays the database entry.

Populating Two Combo Boxes
I have one combo box (Category) which is populated by a MySQL table using php. I am trying to use the onchange javascript to submit the value selected so that I can populate the other combo box (sub-category) based on what was previously choosen. So can anybody give me a clue on how to submit the first boxes value so that the second can see what was selected (javascript function).

An Array Of Text Boxes
I have the full code in a php script where I essentially display a form with checkboxes, and 2 text boxes associated with each checkbox to record grades ( marks and remarks ). The form displays correctly and the checkboxes I select do pass the correct id numbers for the students to be graded, also the numeric data in the first textbox is correctly transmitted HOWEVER the data in the second textbox gets randomly truncated.

e.g, if the "remarks" textbox has 'hello', it gets truncated to 'o'. It seems I'm not resetting something or there is another simple oversight somewhere, perhaps the script treating the data as a string rather than as an array Code:

Multiple Drop Down Boxes
I want to create two multiple drop down boxes, the first will display all the company names, once this has been selected all the stock information for that company will appear in the second drop down boxes.

Dynamic Combo Boxes
i have a problem with creating some dynamic combo boxes. i have a form and the user enters the number of printers required, on the recieving page i display that many combo boxes ready for their input...but the problem is its not generating the correct number of combo boxes for some reason. i think i'ts because i need to reset the cursor on the result set so it can whip through the printers again but am not sure. please see following code:

Printing Colored Css-boxes
I've got a page with a couple of tables inside a couple of colored boxes(css-style), but when I try to print the page I end up with a copy without colors.

Form Drop Down Boxes
I have a bunch of products i want to add to a database, i have a form to submit the products to the database.

What i need to crack is to have a drop down box for category 1 (beer or wine) and then automatically populate the drop down box for category 2 depending on the first selection

if cat1 = beer then cat2 options = Lager, Malt, Stout.
if cat2 = Stout then cat3 = Guiness, london, Old boot.
if cat3 = Guiness then cat4 = Bottle, Can.

I have four sub categories so need this to work on the fly before adding all info to the database ...

Conditional List Boxes
I am attempting to create a list box that is dynamically populated based on the selection of another list box.  I am in way over my head..only way to learn I guess.  The code below has a year listbox and then based on the year selection, the page should either show another listbox (show industry selection when year <> 2005) or it should render the main form (when year=2005). I cannot get the main form to appear. Code:

If Statement And Check Boxes.
I have a database full of different articles/stories. I would like to have a publish check box so that if it is checked, that story appears on the homepage, I know how to do this. HOWEVER, i need ot be able to limit this so that only one can ever be checked off... Code:

Dynamic Text Boxes
I have a form where field techs can close out service calls, Time in, time out, work done, who the tech is....ect...

Currently I have 20 fields for parts..... Part1 / Part1QTY....and so on to Part10 / Part10QTY.... the form emails, and it also feeds data into MySQL... so everything is working fine...

What I would like to do, is stream line it...so there is only 2 fields...part_number and qty....and when techs needs to enter more parts then click on a button that creates 2 new sets of text boxes for input....
thus allowing me to have them enter more the just 10 parts and qty's.

I thought about, maybe having a secondary form on my HTML page, with different sets of submit buttons, and they can enter 1 part at a time... but I could not get the secondary form Submit button to not clear the data in the primary form...so that didn't work for me.! I'm am basically stuck here... there maybe one or two other issues I have...but those are not so critical.

I do have a great deal of MS Access experience but this PHP is a totally different monster. For those who know access, it's very easy to add a new record in a subform and just keep adding records...which is sort of what I'm trying to do here.

Dynamic Listy Boxes
we are trying to  buid some dynamic list boxes.  Our  code that  generates the
listbox  creates  a string  containing the list box definition and the  last line of the  file is echo  $outstr. 

When we  execute this, the list box works fine. Now when we embed it into am html page  in this way: <?php  include statuslistbox.php   ?>, we get  errors  that  say "constant  statuslistbox.php  not defined"  The listbox define file has  the php brackets  top and bottom. The embeding html has no brackets other than the ones show above. It seems to make no difference  if the calling file  is a php extension html extension.

Drop Down Answer Boxes
how to insert drop down answer boxes (like the oes you get in questionnaires) into my cong, i can't seem to get the coding right or make anything appear in the box.

Generating Drop Down Boxes From Mysql
i'm using php with mysql. i need to be able to extract items out of my database and put them into a drop down box so that the data is dynamic.

In this example, i need to get all of the names from the name.office field into a drop down box to be used in further scripts/processess.

<html>
<head>
</head>
<body>

<?

$db = mysql_pconnect ("localhost", "XXXX", "XXXXX");

if (!$db)

{
echo "error: could not connect to database. please try again later";
exit;
}

mysql_select_db("XXXXXXX");
$query = "select name from office";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);

$row = mysql_fetch_array($result);

?>

</body>
</html>what goes here??? i have tried many things and not been able to get it to work.

Spaces In <input Text> Boxes.
When I submit a form where a user has typed a space into the input box, then check that value in the action .php file, only the text before the first space is displayed. How can I get all of the text sent?

eg

Code:
<form name="form2" method="post" action="temp.php">
<input type="text" name="name">
<input type="submit" name="Submit" value="Submit">
</form>

Then in temp.php
Code:
echo "Username = $name";

If the user enters "Greg Bennet" into the text field, I get back "Username = Greg".

Dynamic Text Boxes With While Loop?
Basically I have a dynamic number of categories. Each of these categories requires a text box, therefore I have a dynamic number of text boxes. My question is if there is anyway using a while loop that this can be done?

<?
while ($nextcat = array.php($categories))
{
echo $nextcat;
$varname = $strip_tags($nextcat)
?>
<input type = textarea name = <? $varname ?>>
<? } ?>

Dynamic Dependent Drop Down Boxes
I need to build a dynamic page with 2 drop down boxes on it where the contents of the second drop down box are dependent upon the selection made in the first drop down box (the first box contains districts/regions and the second box contains towns/cities). The customer wants this to happen on a single screen but can this be done with PHP?

Dynamically Filling Selection Boxes
I was wondering if anyone knows how to fill a selection box with different values depending on a selection made in a nother selection box in the same page. I dont know if what I'm tryin to do can be done or not, at least in PHP. First a quick background:

We have a number of projects running right now, each of which is subdevided into various tasks. Now, I've got two selection boxes. The first contains a list of all current projects. What I want to do is this: when someon selects a project from the first box, I'd like the second box to be filled with a list of the tasks that have been assigned tot hat project.

Dynamic Drop Down Boxes With Php Query
I need to build a dynamic page with 2 drop down boxes on it where the contents of the second drop down box are dependent upon the selection made in the first drop down box (the first box contains districts/regions and the second box contains towns/cities). The customer wants this to happen on a single screen but can this be done with PHP?

The above question is already answered by many people and they want me to use Javascript.
My doubt is the second box shoud query the list from a table in mysql using php. How do i do that?

Using Mail() And Avoiding Spam Boxes !
Im using the mail() command to send an email to people who register on
my site, but many are ending up in people's spam boxes on hotmail.

This problem isn't true of all users - probably around 60%.

Im being as open as possible using a number of headers, but can anyone
suggest a way of getting through with less problems ?

$sender = "From: Name <email@domain.com>" . "";
$sender .= "Return-Path: email@domain.com" . "";
$sender .= "MIME-Version: 1.0" . "";
$sender .= "Content-Type: text/plain; charset=iso-8859-1" . "";
$sender .= "Content-Transfer-Encoding: 8bit" . "";
$sender .= "X-Mailer: PHP/" . phpversion();

Passing Values From Text Boxes
what I'm trying to do is pass some values from text boxes, yes it may sound simple, but let me explain more... I've got a form, and what I want to do is that when you enter a new question and select a existing category from the drop down box, it then inserts the values into the database no problem. However if enter a new question, and a new category, then submit the info, I get a null value. The Code...

Handling Multiple Check Boxes
I have a PHP generated page which displays X many records. Each record has
a checkbox preceding it. The user checks several checkboxes, and hits a
delete button. All the corresponding records will be deleted.

But I'm running into difficulty...

Right now the NAME property of each check box is the primary key of the
corresponding record. Hence if I know which checkboxes are checked, I
simply use DELETE using the NAME value.

Generally speaking, how do I get the server side to see which check boxes
were checked?

The check box names may not be sequential, if any records have been deleted
previously, and the first check box might be a number greater than 0.

Is there an easy mechanism to do this? Some kind of built in cnotrol array
allowing me to loop over every check box that was on the form submitted?

I could store the last and first checkbox number in a hidden input, then
loop starting/ending at those values, but that may loop over a lot of
controls that do not exist.

Checking Check Boxes From Post
I have a group of five checkboxes that I need to check in a script after a
post-operaiton. I was using the code:

$drv1 = $_POST['driving_1']

but if the user left checkbox "driving_1" empty, i get a php error upon
processing. So, I looked in the manual and found the fuction empty(). So I
tried:

If (empty($drv1)) {
then do this
}

But it doesn't seem to be working. Actually, what I really want is if not
equal to empty, something like:

If (!empty($drv1)) {
then do this
}

Punctuation Marks In PHP Text Boxes
I am not a PHP user; I manage the server/ network for our business.
We've employed web developers (chosen because they're friends of the
MD) to build us a site and they've used PHP & MySQL to do it.

The problem we have is that if we use an apostrophe when writing a
product description or product title in the back office of our site,
when that data is then used or carried through to another part of the
site eg. a live product page or an order summary page, the apostrophe
has a backslash before it. We have run into other issues with the use
of various punctuation marks in the text fields of the back end of the
site and have always been told by the developers that it is a fault of
PHP and is common with PHP text fields.

Now, as I said, I'm not a PHP user and certainly no expert. But I have
installed and used Mambo Server, Wordpress, phpBB and a couple of other
PHP MySQL products through my own curiosity and have done so
successfully and have never experienced any of the issues we seem to be
facing with these text boxes. I am growing increasingly suspicious of
the level of competence of the developers and feel that they are making
excuses for their inability. Can anyone tell me, from what I've said
here, whether my suspicions are justified or is it the case that PHP is
limited in these areas?

Drop Down Boxes Change By Selection
what i'm trying to do is when a user selects a country say UK, all the uk states are displayed in another selection box below BUT if the US is selected all the us states are shown, this is on nion every friends/dating site just curious as to how this is done.

Selections On Dropdown Selection-boxes
I have a article manager script that im nearly done with and when you press save, it takes you to another page to check that you have entered the required fields by checking for the POST vars, if not it redirects back to the page and stuffs the entered fields into GET vars header( location: file.php?errors=$errors&var1=$var1 ) 's you back to the previous page.

Now i have no trouble reshowing the entered info in regular text fields as i grab it from GET but i dont seem to be able to reshow a drop down box selection it always reverts back to the first option when i redirect the page.

Dynamic Drop Down Boxes With Mysql
I'm working on a database project for a class and am having problems populating select boxes with a field from a mysql table.  The first thing that I'm trying to do is pull the field LastName from the table Faculty.  Then when the user selects the faculty member in the drop down box, it will then display all of the fields related to that faculty member...first and last name, title, office number etc and allow the user to edit those fields and then resubmit them to the database.

However I can't seem to get the drop down box to populate, so if anyone has any suggestions as to how to fix this I would love to hear them. Code:

Avoiding Php Mail() To Spam Boxes
I'm sending soliticited emails for a nonprofit and i'm finding when i use PHP's mail function, and the mail goes through my ISP's SMTP, a decent percentage of the mails go to people's spam boxes.

are there known headers or something i could add to my code to make them less spam box prone?

Long Strings In List/menu Boxes
Is there a way to get a list/menu box to resize as the page is resized and
for any long string that is an item in the list to be spread over two or
more lines in the same way as text in a table does.

Filtering Selection In Multiple Drop Down Boxes
I want to allow a user to conduct a search on a database using multiple drop down boxes.
On the first page they will have a drop box filled with records from field A. Once they select which one they want, a second drop down box will then appear with records from field B which are present for field A (a filter).

What I want though is that the first dwon down box still appears on the second page, but shows the record that the user selected. What is happening now is that when the second page comes up, the first box shows the default selection rather than the selection that the user chose. My code for the drop down boxes is: PHP Code:

How Can I Print Out Multiple Text Input Boxes?
How Can I Print Out Multiple Text Input Boxes. The function below prints out three text boxes. The code below is static, cannot accept user input, and therefore cannot be changed. What I need to do is write a function or maybe a class that can accept user input and print or echo a different number of text boxes, depending on the user input.

The name variable for each of the textboxes needs to have a different name. For example, the name for the first text box would be something like "name=textfield1", the second would be "name=textfield2", and so forth. PHP Code:

Dynamic Number Of Text Boxes/insert
On page one I ask 'How many boxes do you want?' and I have a simple form - the code is below:

<form action="addhouses.php" method="post">
<input type="text" name="numimages" size="3">
<input type="submit" name="submit" value="Submit">
</form>

On the next page I want to display how ever many boxes they said on the previous page.
Let's say they choose 4 - there are then 4 boxes which allow you to browse to files on your computer. Clicking submit on this page takes you to the third page which uploads the files and inserts the filenames into the database. Currently the code I have on the third page works fine for a static number of defined boxes. It is: PHP Code:

Drop Down Boxes Selecting Selected Option
i make a PHP Query select the one that has been selected in a drop down box? Code:

Drop Down Boxes Selecting Selected Option
I have this code to allow me to get the selected option selected in the dropdown. The option is stored in url variable the code i currently have is selecting everything. I am doing something wrong? Code:

Select Menu OnChange To Update Text Boxes
I've a select menu filled from mySql, So when I change the selection.. I want to change 3 text boxes also by the same row of database that is = to the row of the select menu.

So i tried a lot but failed.. cuz I cant send to javascript the updated values when the selected menu change.


Copyright © 2005-08 www.BigResource.com, All rights reserved