Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How to pass a value in Javascript to a value in php

 
   Database Help (Home) -> PHP RSS
Next:  Number of objects  
Author Message
jiing.deng

External


Since: Feb 15, 2005
Posts: 3



(Msg. 1) Posted: Thu Feb 17, 2005 2:58 am
Post subject: How to pass a value in Javascript to a value in php
Archived from groups: comp>lang>php (more info?)

I have not learned Javascript,just copy & paste & revise

<script language="JavaScript">
function confirmDelete{
re = confirm("Delete or not?(yes,cancel)");
if (re == "0"){<?php $re1 = 0;?>}else{ <?php $re1 = 1;?>}
<!--the upper line will cause the confirm windows disappearing--!>
return 0;
}
document.writeln(confirmDelete());
</script>
<?php
echo "\$re1 = $re1";
?>


1. How to pass the value "re" in Javascript to $re1 in php
2. How to revise to make the confirm window appear and pass the value
correctl

thanks in advanced.
-jiing-

 >> Stay informed about: How to pass a value in Javascript to a value in php 
Back to top
Login to vote
Colin McKinnon1

External


Since: Apr 27, 2004
Posts: 13



(Msg. 2) Posted: Thu Feb 17, 2005 6:40 am
Post subject: Re: How to pass a value in Javascript to a value in php [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wrote:

 > I have not learned Javascript,just copy & paste & revise
 >
 > <script language="JavaScript">
 > function confirmDelete{
<snip yucky javascript>
 >
 > 1. How to pass the value "re" in Javascript to $re1 in php
 > 2. How to revise to make the confirm window appear and pass the value
 > correctl
 >

Put a form on your page with a input field called 're' and set the value,
then submit the form from javascript. Or use an iframe/popup.

C.

 >> Stay informed about: How to pass a value in Javascript to a value in php 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Can i pass value to javascript from php - Hello, i need to pass some variables or value to javascript from php script. well all i need to pass to value to javascript that is with in same php file the two values r in php i need to pass it to javascript from there to ext page the following code..

pass a session variable, pass a variable in a post - I have this nice bad_orderXL.php page that works, calls some queries and prints to the browser: --------------- Validate_login("bad_order.php"); if($_SESSION["LMS_USER_DESC"]=='customer'){ $id = $_SESSION["LMS_LOGGED_IN&quot...

javascript in php - I have this bit of php in a much larger php file that requests information from users don't supply enough info, I want to open another html file for display. I get an error that sends me far down into the php file to the start of some html code. Am I..

Help rendering Javascript? - I'd like to execute javascript if I'm in a certain directory. I can't figure out how to render the javascript script below. I always end up with some type of parsing error. Any suggestions? <?php $url= $_SERVER['PHP_SELF']; $isWPAdmin = strstr($ur...

javascript widget - hey guys i m trying to generate a widget like reddit/delicious/google adsense widget please give pointers on how to do it thanks
   Database Help (Home) -> PHP All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]