Everything posted by Kanishk Dudeja
-
How to use javascript inside PHP?
Okay. Sure. Will look into it. Thank you
-
How to use javascript inside PHP?
I tried another method. It worked. $qry = "insert into contactus(name,email,subject,message) values('$name','$email','$subject','$message')"; $result=mysql_query($qry); if($result){ header('Location: contactus.php?status=sent'); }else{ header('Location: contactus.php?status=fail'); } And this code in contactus.php <?php if(!empty($_GET['status'])) { $status = $_GET['status']; if($status=="sent") { echo "<script type='text/javascript'>\n"; echo "alert('Your message was successfully sent.');\n"; echo "</script>"; } else { echo "<script type='text/javascript'>\n"; echo "alert('Could'nt send your message.');\n"; echo "</script>"; } } ?>
-
How to use javascript inside PHP?
The code doesnt work.. If($result) comes out to true, i want it to display an alert box and just stay on the same page. It goes to contact_us_action.php which is the php handling the form. I want it to just stay on the same page.
-
How to use javascript inside PHP?
I need to show an alert box to the user in case a form gets successfully submitted. But it is not working. The alert box does'nt pop up. The form is on page contactus.php. I want the user to stay on that page only. So i have added header('Location: contactus.php'); Here is the code. $qry = "insert into contactus(name,email,subject,message) values('$name','$email','$subject','$message')"; $result=mysql_query($qry); if($result) { echo "<script type='text/javascript'>\n"; echo "alert('Your message was successfully sent.');\n"; echo "</script>"; header('Location: contactus.php'); } else { echo "<script type='text/javascript'>\n"; echo "alert('Could'nt send your message.');\n"; echo "</script>"; header('Location: contactus.php'); }
-
Problems with float
okay. Thanks
-
Problems with float
Hey that worked. Thanks a lot. It worked because of adding float:right to nav. But why is it working now? I mean when i floated logo to the left it was understoof that nav would be on right. Why do i have to add float:right to nav too?
-
Problems with float
I am making a site on dreamweaver. But i am encountering some issues with float. I have a division "Header" which contains two divisions "Logo" and "Nav" "Logo" contains the logo and "Nav" contains the links for navigation. I have floated "Logo" to the left because i want the links to be there on the right of the logo. That works but when i add margin-top to the Nav, the whole header(including the logo) shifts down. Rather than just the Nav shifting down. Im posting the html and css code here. <div class="header"> <div class="logo"><a href="#"><img src="web page3.png" width="400" height="130" style="display:block;" /></a></div> <div class="nav"> <ul> <li><a class="onscreen" href="index.php">Home</a></li> <li><a href="aboutus.php">About Us</a></li> <li><a href="services.php">Services</a></li> <li><a href="whyfulcrum.php">Why Fulcrum?</a></li> <li><a href="contactus.php">Contact Us</a></li> </ul> </div> <!-- end .header --></div> .header { width:960px; height:145px; } .logo { float:left; } .nav { margin-top:50px; margin-right:20px; }
-
Dynamically set width and height of image using javascript
yeah thanks
-
Dynamically set width and height of image using javascript
I used another method. It worked. Thanks for your suggestion though <img id="enter" src="enter.PNG" alt="enter" /> <script type="text/javascript"> target=document.getElementById('enter'); target.style.width=((252*screen.width)/1280)+'px'; target.style.height=((62*screen.height)/800)+'px'; </script>
-
Dynamically set width and height of image using javascript
Okay. Thank you
-
Dynamically set width and height of image using javascript
I want to dynamically set the height and width of an image using javascript so that the image looks proportionally fine according to different screen resolutions.. The original image is of 252*62 pixels.. I have used the following code..but it doesnt seem to work. <script type="text/javascript"> function resizeheight() { var height = ((62*screen.height)/800); return height; } function resizewidth() { var width = ((252*screen.width)/1280); return width; } <img id="enter" src="enter.PNG" height="resizeheight()" width="resizewidth()" >