Jump to content

sufian

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by sufian

  1. sufian

    Help

    Hey I have a script here and its for searching twitter. the input is currently: <script src="twit-search.js">{"query":"sufiantv", "count":5}</script> If their a way for making it so their is an input box so rather then edit the file to search you can search from the input box and click on submit and it will get the results for you.
  2. Masking a URL, Is it possible to mask a URL in php for example I have a url shortening site and I need it so when you shorten a url the link you get is a mask so lets say I shorten http://google.com into: http://mysite.com/dse when I click on the link: http://mysite.com/dse it stays like that at the top of the site. it does not change to http://google.com when I click it. If php can do that how and if so what other methods are their.
  3. hey I need a script for no dots so when some one fills in the input filed they are not able to put in dots. I have found one that removes spaces but not one that removes dots. remove spaces: <script type="text/javascript"> function nospaces(t){ if(t.value.match(/\s/g)){ alert('Sorry, you are not allowed to enter any spaces'); t.value=t.value.replace(/\s/g,''); } } </script> <input class="input mediumfield" name="username" onkeyup="nospaces(this)" type="text" value="" />
  4. Hey, I'm building a captcha for a register page on my site. So far I have got it showing the image of text, the code for the captcha.php is: <?php session_start(); $string = ''; for ($i = 0; $i < 5; $i++) { // this numbers refer to numbers of the ascii table (lower case) $string .= chr(rand(97, 122)); } $_SESSION['rand_code'] = $string; $dir = 'fonts/'; $image = imagecreatetruecolor(170, 60); $black = imagecolorallocate($image, 0, 0, 0); $color = imagecolorallocate($image, 200, 100, 90); // red $white = imagecolorallocate($image, 255, 255, 255); imagefilledrectangle($image,0,0,399,99,$white); imagettftext ($image, 30, 0, 10, 40, $color, $dir."duepuntozero.ttf", $_SESSION['rand_code']); header("Content-type: image/png"); imagepng($image); ?> And inside the register.php page I have the following: At the top of the page: <?php session_start(); if(isset($_POST['submit'])) { if($_POST['code'] == $_SESSION['rand_code']) { // send email $accept = "Account Created Please Log In."; } else { $error = "Please verify that you typed in the correct code."; } } else { $error = "Please fill out the entire form."; } } ?> And at the top of the register page: <?php if(!empty($error)) echo '<div class="error">'.$error.'</div>'; ?> <?php if(!empty($accept)) echo '<div class="accept">'.$accept.'</div>'; ?> And the form for the register section is: <?php if(!empty($error)) echo '<div class="error">'.$error.'</div>'; ?> <?php if(!empty($accept)) echo '<div class="accept">'.$accept.'</div>'; ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data"> <p><span id="sprytextfield1"> <input type="text" name="name" /> <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span> Name</p> <p><span id="sprytextfield2"> <input type="text" name="email" /> <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span> Email</p> <p><span id="sprypassword1"> <label> <input type="password" name="password" id="password" /> </label> <span class="passwordRequiredMsg">A value is required.</span></span>password</p> <img src="captcha.php"/> <p><span id="sprytextfield3"> <input type="text" name="code" /> <span class="textfieldRequiredMsg">A value is required.</span></span> Captcha</p> <p><input type="submit" name="submit" value="Send" class="button" /></p> </form> <script type="text/javascript"> <!-- var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "custom"); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "email"); var sprypassword1 = new Spry.Widget.ValidationPassword("sprypassword1"); var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3"); //--> </script>
  5. sufian

    php tags

    Basicly I need it so when some one is logged in it checks the session and then looks in the database for a username and password some one has stored from their settings panel and this reads off it so log them in when they access the page for tweeting.
  6. Hey how do I get a php code like <?=username?> to get the info from a mysql database?
  7. Hey I have found this script for twitter but it only lets you type in your username and password for twitter in the php file I need help to make it so their is a section for login and password and when you can tweet. on the page not in the backend. So far its a text box with a post button I want it so its a login password section and login button and then the post area with the text box and post button. <?php /* ---------------------------------------- */ // Change these parameters with your Twitter // user name and Twitter password. /* ---------------------------------------- */ $twitter_username ='username'; $twitter_psw ='password'; /* ---------------------------------------- */ /* Don't change the code belove /* ---------------------------------------- */ require('twitterAPI.php'); if(isset($_POST['twitter_msg'])){ $twitter_message=$_POST['twitter_msg']; if(strlen($twitter_message)<1){ $error=1; } else { $twitter_status=postToTwitter($twitter_username, $twitter_psw, $twitter_message); } } /* ---------------------------------------- */ ?> <!-- This is the form that you can reuse in your site --> <?php if(isset($_POST['twitter_msg']) && !isset($error)){?> <div class="msg"><?php echo $twitter_status ?></div> <?php } else if(isset($error)){?> <div class="msg">Error: please insert a message!</div> <?php }?> <p><strong>What are you doing?</strong></p> <form action="insertTwitterMsg.php" method="post"> <input name="twitter_msg" type="text" id="twitter_msg" size="40" maxlength="140" /> <input type="submit" name="button" id="button" value="post" /> </form> <!-- END -->
  8. sufian

    underline link

    <style type="text/css"> <!-- a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; } --> </style>
  9. Hey do you lot know how to get your apps name when you tweet? http://screencast.com/t/tVZRd2WOA Like in the image above it says "MrTweet" how do I get my apps name their using php in my app.
×
×
  • 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.