Jump to content

jagat21

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jagat21's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. this also might help u ............. http://in.php.net/file_get_contents
  2. you can do something like this : if(isset($_GET['sortorder']) && $_GET['sortorder']=='ASC') { echo'<a href="users.php?sortby=id&sortorder=DESC">Sort By Descending Order</a>'; } else if(isset($_GET['sortorder']) && $_GET['sortorder']=='DESC') { echo'<a href="users.php?sortby=id&sortorder=ASC">Sort By Ascending Order</a>'; }
  3. After firing the select query u have written, "select hobbies from tablename ", u can use explode() function in order to get the individual values of each hobbies. i.e. u have stored following values of hobbies in database table : id ..... hobbies 1...... reading, music, cricket now after selecting this record from query, $hobbies = explode(',',$row['hobbies']); this will give u an array of all hobbies that u have stored in single field. so u can access individual hobbies as an array elements.
  4. For selecting multiple values for hobbies field u can use checkboxes. And @ the time of inserting record combine them in a single string. and store the value.
  5. ya, but check the version of php/ mysql installed on the linux server. The syntax of the language will be same in both case.
  6. You can check in your hosting panel that if any database user is created for accessing the databases on your server. And if the database user is created on your database server, then check that its assign to the database you are using.
  7. Hi, Have a look at PHP Process Control Functions. http://in.php.net/pcntl this might help u.
  8. Hi, now try this : <?php if ($user_sel_date>=$mycurrentdate) { if ($from>=$my_current_time) { ?> <form name="time" method="post"> <table width="300px" border="0" cellspacing="0" cellpadding="0"> <tr> Other form elements here </tr> </table> </table> </form> <? } else { echo "Time cannot be less than current time."; } } else { // this is line 192 ?> <table width="300px" border="0" cellspacing="0" cellpadding="0"> <tr><Td align="center" valign="middle" class="content_heading"><br />You cannot register on the previous date...</Td> </tr></table> <? } ?>
  9. Hi, As u have tried no. of server, then may be some problem in ur email script. Can u please put ur code here so that others can check it, if some problem is there in ur script.
  10. Try to set following variable's value : php_value max_input_time 3600 in ur htacess file.
  11. Hi, try this <?php if (!is_authed()) { print ('You are not permitted to view this page, <a href="index.php">click here</a> to go back.'); } else { ?> <h2>Membership Registration</h2><hr /> <?php if(isset($_POST['submit'])) { $submit = $_POST['submit']; } function show_form() { global $_POST, $print_again, $error; global $first_name, $last_name, $interests, $username, $newsletter; ?> <form method="post" id="login" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> <fieldset> <legend>Username</legend> <p class="hint">Please enter a username for your user account. Note that username should be between 4 and 30 characters.</p> <p><label for="username">Username:</label> <input type="text" <?php error_bool($error, "username"); ?> title="Please enter a username" id="username" name="username" size="30" value="<?php echo $username; ?>" /></p> </fieldset> <fieldset> <legend>About You</legend> <p><label for="first_name">Forename:</label> <input type="text" <?php error_bool($error, "first_name"); ?> title="Please enter your first name" id="first_name" name="first_name" size="30" value="<?php echo $first_name; ?>" /></p> <p><label for="last_name">Surname:</label> <input type="text" <?php error_bool($error, "last_name"); ?> title="Please enter your last name" id="last_name" name="last_name" size="30" value="<?php echo $last_name; ?>" /></p> <p class="hint">Please enter any interests/hobbies you have (optional).</p> <p><label for="interests">Your Interests:</label> <input type="text" title="Please enter any interests/hobbies you have" id="interests" name="interests" size="30" value="<?php echo $interests; ?>" /></p> </fieldset> <fieldset> <legend>Newsletter</legend> <p class="hint">Sign up for jackgodfrey.org.uk newsletter. This newsletter includes what forthcoming events we are arranging, the latest Honeylands news and our latest news. You can Opt-out at any time....so sign up and give it a try!!</p> <p><label for="newsletter">Newsletter:</label> <input style="border:none" type="radio" value="yes" id="newsletter" checked="checked" name="newsletter" />Opt-in <input style="border:none" type="radio" value="no" name="newsletter" />Opt-out</p> </fieldset> <p><label for="Submit" style="width: 20px"> </label> <input type="submit" name="submit" value="Edit Profile" class="sendbutton" /> <input type="reset" value="Reset Fields" class="sendbutton" /></p> </form> <?php } if(isset($submit)) { check_form(); } else { show_form(); } function check_form() { global $_POST, $error, $print_again; global $first_name, $last_name, $username, $newsletter; $first_name = check_input($_POST['first_name']); $last_name = check_input($_POST['last_name']); $interests = check_input($_POST['interests']); $username = check_input($_POST['username']); $newsletter = $_POST['newsletter']; $error['first_name'] = false; if(empty($first_name)) { $error['first_name'] = true; $print_again = true; $message="<li>The <span><b>Forename</b></span> field is empty</li>"; } else if(!ereg("^[A-Za-z]{2,30}$",$first_name)) { $error['first_name'] = true; $print_again = true; $message="<li><span><b>Forename</b></span> must contain letters only</li>"; } if(empty($last_name)) { $error['last_name'] = true; $print_again = true; $message.="<li>The <span><b>Surname</b></span> field is empty</li>"; } else if(!ereg("^[A-Za-z\-]{2,30}$",$last_name)) { $error['last_name'] = true; $print_again = true; $message.="<li><span><b>Surname</b></span> must contain letters only</li>"; } if(empty($username)) { $error['username'] = true; $print_again = true; $message.="<li>The <span><b>Username</b></span> field is empty</li>"; } else if( mysql_num_rows(mysql_query("SELECT username FROM users WHERE username = '$username'")) ) { $error['username'] = true; $print_again = true; $message.="<li>The username you have selected has already been used by another member in our database. Please choose a different Username!</li>"; } else if(!ereg("^[A-Za-z0-9 \-]{4,30}$",$username)) { $error['username'] = true; $print_again = true; $message.="<li><span><b>Username</b></span> must contain letters and numbers only</li>"; } if($print_again) { echo "<h2 class=\"errorhead\">There has been an error:</h2><p>You forgot to enter the following field(s)</p> <ul id=\"validation\">$message</ul>"; show_form(); } else { // Stop the form being used from an external URL // Get the referring URL $referer = $_SERVER['HTTP_REFERER']; // Get the URL of this page $this_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"]; // If the referring URL and the URL of this page don't match then // display a message and don't send the email. if ($referer != $this_url) { echo "You do not have permission to use this script from another URL.<br />"; echo "If you are behind a firewall please check your referrer settings."; exit; } echo "done"; } } } ?>
  12. Hi, u can encode the query string variables while sending them. And on the other page u can decode it and use it again. Use following functions : 1) base64_encode() 2) base64_decode()
  13. can u mention what error u r getting while executing the script ?
  14. Hi, try this. $txt = "yetrwueyrkw sjdfgskjdhfg kdjfgskjdfhgk dhfgskjdfhgs kjfhgskjf gskdjfh slkjdfhsl f"; echo $txt; $newtext = wordwrap($txt, 20); echo "<br>" . $newtext . "....";
  15. As per ur requirement, u can also use Snoopy class available for php for the same thing. And regarding the link, u have to check the source code of the page on which u are posting this variable. I think, [b]form action[/b] of that particular web page. And u can use that form action URL in snoopy class for posting your variables.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.