Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
hyperlink an if statement
Old 04-27-2005, 11:23 AM hyperlink an if statement
hiptobesquare's Avatar
Extreme Talker

Posts: 186
Location: London UK
Trades: 0
Hi.. can anybody tell me how to hyperlink the output of an if statement to a new document.
This is my document:


<?php echo "
<html>
<head>
</head>
<body>
your aperture width is";
foreach ($_POST as $field => $apwidth)
{
echo " $apwidth ";
}
?> mm
<?php

$doorsize2 = (($apwidth + 30) / 2);
$doorsize3 = (($apwidth + 60) / 3);
$doorsize4 = (($apwidth + 90) / 4);
$doorsize5 = (($apwidth + 120) / 5);

/* hopefully the echo of the 1st if statement will make clear what i want to do*/

if ($appwidth < '2000')
{
echo "newdocument.php";
}

elseif ($apwidth < '3000' and $apwidth > '2000')
{
echo "<br>you need 3 doors $doorsize3 mm wide each";
}

elseif ($apwidth < '4000' and $apwidth > '3000')
{
echo "<br>you need 4 doors $doorsize4 mm wide each";
}

elseif ($apwidth < '5000' and $apwidth > '4000')
{
echo "<br>you need 5 doors $doorsize5 mm wide each";
}

else
{
echo "<br> please call ********** for assistance";
}

?>
</body>
</html>



Thanks for pondering guys & girls

Last edited by hiptobesquare; 04-27-2005 at 11:40 AM..
hiptobesquare is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-27-2005, 12:08 PM
Logical Program's Avatar
Super Talker

Posts: 130
Location: Atlanta, Georgia
Trades: 0
If you want to hyperlink it... Just do this...

Code:
if ($appwidth < '2000'){
    echo "<a href=\"newdocument.php\">New Document</a>";
}
But, if you actually want that file to show on the same page... Do this...

Code:
if ($appwidth < '2000'){
    include('newdocument.php');
}
__________________

Please login or register to view this content. Registration is FREE
- For all of your website programming and design needs, make the logical choice. Logical Assistance For Real-World Clients.
Logical Program is offline
Reply With Quote
View Public Profile Visit Logical Program's homepage!
 
Old 04-27-2005, 01:14 PM
hiptobesquare's Avatar
Extreme Talker

Posts: 186
Location: London UK
Trades: 0
thats totally sweet thanks man.
hiptobesquare is offline
Reply With Quote
View Public Profile
 
Old 04-27-2005, 04:41 PM
Logical Program's Avatar
Super Talker

Posts: 130
Location: Atlanta, Georgia
Trades: 0
Glad I could help.
__________________

Please login or register to view this content. Registration is FREE
- For all of your website programming and design needs, make the logical choice. Logical Assistance For Real-World Clients.
Logical Program is offline
Reply With Quote
View Public Profile Visit Logical Program's homepage!
 
Reply     « Reply to hyperlink an if statement
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14755 seconds with 12 queries