/    Sign up×
Community /Pin to ProfileBookmark

Hi guys i dont know how to implement this script but i have seen it been used befor. This is what i have so fare.

<?
if ($result == “”) {
?><?php
echo “www.$domain_field “;
?><?php
echo “$dot”;
?><?
} else {
?><?php
echo “www.$existing_domain_name”;
?><font face=”verdana,helvetica,arial” size=”2″><?php
echo “$dot1”;
?>

What i am trying to on the previous page the user is asked to if they already have a domain name if they do the give me the name in the “existing_domain_name” field followed by the type of domain like .com .net, which is selected from the dot1 dropdown menu. If they dont have a domain name the enter the desired domain name in the “domain_field” text box followed by the doamin type from the “dot” drop down menu.

I dont know how to use the (if) or (else) script can someone please tell me.

Thank You.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@scragarNov 16.2007 — [code=php]<?php
if(condition){/* condition for you will proberly be something to do with
$_GET['domain'] if your passing a query string, sore maybe it's a cookie:
$_COOKIE['domain'] or, as I prefare, a session: $_SESSION['domain'] */
// you do stuff here if it's true, so:
echo "please fill in the form";
// you can even end PHP to write out large blocks of text if your not
// exactly planning to use variables.
?> <form action="?" method=post"><input type="text"
.......
<?php
}else{// use else to say if the condition was false
// stuff to do here, you can follow the same rules as above.
};// end the whole if here.[/code]
Copy linkTweet thisAlerts:
@bokehNov 16.2007 — [code=php]<?php
echo "$dot";
?>[/code]
[/QUOTE]
I've seen it all now. Wouldn't it be easier to just do this:[code=php].[/code]Also why do you keep opening and closing PHP tags?[code=php]?><?php[/code][/QUOTE]That is just a pointless waste of processing power and lowers readability.
×

Success!

Help @aiden857181 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...