(help)How to Create my Own Wapmaster Services?
Collapse
X
-
Leave a comment:
-
i tried already the registration form and heres the result http://unliwap.net/services/form.php i didnt change anything tell me whats next
Leave a comment:
-
Sure, take your time. Anyway here is the complete example of snippet, if u have any question about it feel free to ask.
PHP Code:<?php
if (isset($_POST['submit'])) {
if (isset($_POST['name']) && isset($_POST['linkname']) && isset($_POST['link'])) {
$error = false;
if ($_POST['name'] == '') {
$error .= 'Name is empty<br/>';
}
if ($_POST['linkname'] == '') {
$error .= 'Linkname is empty<br/>';
}
if ($_POST['link'] == '') {
$error .= 'Link is empty<br/>';
} else {
if (!preg_match('/^(http:\/\/)?[a-z0-9-_.]+\.([a-z]{2,4})+$/D', $_POST['link'])) {
$error .= 'Invalid link format<br/>';
}
if (strpos($_POST['link'], 'http://') === false) {
$_POST['link'] = 'http://'.$_POST['link'];
}
}
$datafile = 'data/users.dat';
if (is_readable($datafile)) {
$handle = @fopen($datafile, 'r');
$output = fread($handle, filesize($datafile));
if ($output != '') {
for ($i = 0; $i < count($output); $i++) {
$data = explode(',', $output[$i]);
if ($data[0] == $_POST['name']) {
$error .= 'Name is token<br/>';
}
if ($data[1] == $_POST['linkname']) {
$error .= 'Linkname is token<br/>';
}
if (trim($data[2]) == $_POST['link']) {
$error .= 'Link is token<br/>';
}
}
}
fclose($handle);
} else {
echo 'Can\'t find data file<br/>';
return;
}
if (empty($error)) {
$name = (strlen($_POST['name']) <= 50)
? htmlentities(str_replace(',', ',', trim($_POST['name'])), ENT_QUOTES, 'UTF-8')
: htmlentities(str_replace(',', ',', substr(trim($_POST['name']), 0, 50)), ENT_QUOTES, 'UTF-8');
$linkname = (strlen($_POST['linkname']) <= 50)
? htmlentities(str_replace(',', ',', trim($_POST['linkname'])), ENT_QUOTES, 'UTF-8')
: htmlentities(str_replace(',', ',', substr(trim($_POST['linkname']), 0, 50)), ENT_QUOTES, 'UTF-8');
$link = (strlen($_POST['link']) <= 50)
? htmlentities(str_replace(',', ',', trim($_POST['link'])), ENT_QUOTES, 'UTF-8')
: htmlentities(str_replace(',', ',', substr(trim($_POST['link']), 0, 50)), ENT_QUOTES, 'UTF-8');
$writedata = "$name,$linkname,$link\n";
if (is_writeable($datafile)) {
$handle = @fopen($datafile, 'a');
fwrite($handle, $writedata);
fclose($handle);
echo 'Hello '.$name.', thank you for registering.<br/>Set this link to your site:<br/>
'.htmlentities('<a href="./service.php?link='.$link.'">'.$linkname.'</a>', ENT_QUOTES, 'UTF-8').'<br/>';
} else {
echo 'Can\'t find data file<br/>';
return;
}
} else {
echo $error;
unset($error);
}
}
} else {
echo '
Registration<br/>
<form method="post" action="./index.php" enctype="multipart/form-data">
<p>
Name: <br/>
<input type="text" name="name" maxlength="50" value=""/><br/>
Linkname: <br/>
<input type="text" name="linkname" maxlength="50" value=""/><br/>
Link: <br/>
<input type="text" name="link" maxlength="50" value=""/><br/>
<input type="submit" name="submit" value="Register"/>
</p>
</form>';
}
?>Last edited by arnage; 13.08.11, 15:10.
Leave a comment:
-
Thankz for helping guys maybe i will try it later cause i'm still looking for a nice hosting and thinking for my domain name for my domain name
Leave a comment:
-
Originally posted by soul_reaper View Postnot kidding bro ,but let him try ,then if is something he don`t know post here and someone would help :-D
For example, in this snipet that i wrote no one made a comment to explode delimiter (-) even though a site where we all now have the name coding-talk.com,
not to mention missed structure at header() or loop through file which is all basic... And look at this persistent caricature...
Originally posted by Ajmalrasi View Posti know how to do it and i dont want to share it completely here.
oops sorry
now corrected
Name : <?php echo $name;?>
Link Name: <?php echo $linkname; ?>
Link : <?php echo $link; ?>
Leave a comment:
-
i know how to do it and i dont want to share it completely here.
demo here
Originally posted by arnage View PostNope, some other data needs to be displayed at this point, that information is useless for displaying as the user is just entered his name and site.
And we come to a paradox situation where someone who says that its "easy as 123" actualy shows that he doesn't have a clue what is needed to do next even after he got part of code done.
Also, $linkname var is not field name "Url" as URL stands for "Uniform Resource Locator" aka LINK, wich is the field below.
Var $linkname is field Linkname and $link is... guess what.
now corrected
Name : <?php echo $name;?>
Link Name: <?php echo $linkname; ?>
Link : <?php echo $link; ?>
Leave a comment:
-
Originally posted by arnage View PostKidding bro? He said he is a newbie.
Leave a comment:
-
Originally posted by Ajmalrasi View Postuse this on next page
Name : <?php echo $name;?>
Url : <?php echo $linkname; ?>
Link : <?php echo $link; ?>Nope, some other data needs to be displayed at this point, that information is useless for displaying as the user is just entered his name and site.
And we come to a paradox situation where someone who says that its "easy as 123" actualy shows that he doesn't have a clue what is needed to do next even after he got part of code done.
Also, $linkname var is not field name "Url" as URL stands for "Uniform Resource Locator" aka LINK, wich is the field below.
Var $linkname is field Linkname and $link is... guess what.
Leave a comment:
-
use this on next page
Name : <?php echo $name;?>
Url : <?php echo $linkname; ?>
Link : <?php echo $link; ?>
Leave a comment:
-
Originally posted by soul_reaper View Postis easy if you know what you doing... if you try different methods until you get wat you want is not easy...nobody was born learned ,try yourself ,no one will give you ready-made...only if you pay for his work
Originally posted by jet05 View PostHi everyone please help us creating a wapmaster services like wapshared.com i'm just a newbie
Originally posted by Ajmalrasi View Postuse some logic and create.
Make sure you next time your post at least looks like this:
PHP Code:<?php
if (isset($_POST['submit'])) {
if (isset($_POST['name']) && isset($_POST['linkname']) && isset($_POST['link'])) {
$error = false;
if ($_POST['name'] == '') {
$error .= 'Name is empty<br/>';
}
if ($_POST['linkname'] == '') {
$error .= 'Linkname is empty<br/>';
}
if ($_POST['link'] == '') {
$error .= 'Link is empty<br/>';
}
if (!preg_match('/^http:\/\//', $_POST['link'])) {
$_POST['link'] = 'http://'.$_POST['link'];
}
$datafile = 'data/users.dat';
if (is_readable($datafile)) {
$handle = @fopen($datafile, 'r');
$output = fread($handle, filesize($datafile));
$data = explode('-', $output);
if ($data[0] == $_POST['name']) {
$error .= 'Name is token<br/>';
}
if ($data[1] == $_POST['linkname']) {
$error .= 'Linkname is token<br/>';
}
if ($data[2] == $_POST['link']) {
$error .= 'Link is token<br/>';
}
fclose($handle);
}
if (empty($error)) {
$name = htmlentities($_POST['name'], ENT_QUOTES, 'UTF-8');
$linkname = htmlentities($_POST['linkname'], ENT_QUOTES, 'UTF-8');
$link = htmlentities($_POST['link'], ENT_QUOTES, 'UTF-8');
$writedata = "$name-$linkname-$link\n";
if (is_writeable($datafile)) {
$handle = @fopen($datafile, 'a');
fwrite($handle, $writedata);
}
fclose($handle);
} else {
echo $error;
}
unset($error);
}
header('Location: /');
exit;
} else {
echo '
Registration<br/>
<form method="post" action="./index.php" enctype="multipart/form-data">
<p>
Name: <br/>
<input type="text" name="name" maxlength="50" value=""/><br/>
Linkname: <br/>
<input type="text" name="linkname" maxlength="50" value=""/><br/>
Link: <br/>
<input type="text" name="link" maxlength="50" value=""/><br/>
<input type="submit" name="submit" value="Register"/>
</p>
</form>';
}
?>
Im finished discussion what is simply to who.
Jet05 if u have any question u can ask here.Last edited by arnage; 08.08.11, 17:35.
Leave a comment:
-
is easy if you know what you doing... if you try different methods until you get wat you want is not easy...nobody was born learned ,try yourself ,no one will give you ready-made...only if you pay for his work
Leave a comment:
Leave a comment: