Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

jimbobd

Members
  • Joined

  • Last visited

  1.    jimbobd reacted to a post in a topic: MySQL Update script not working
  2.    jimbobd reacted to a post in a topic: MySQL Update script not working
  3. Thanks guys! I've looked through this script loads but not noticed that! I changed it to my ID cookie but changed the query aswell and the second time spelt my cookie wrong. Will use the cookie from now on as it worked. Thanks alot!
  4. Thanks guys but: webdesigner93 - That is all my code from this script. pat24 - That's what my code already is. I changed it yesterday as somehow I copied and pasted wrong :S. James - thanks, I'll have a look at escape strings. Sorry rafflemine - that didn't work :/ I can't understand why it isn't working. Plus I don't really need a variable for $new as it should always be updated to 0 however I tried using a variable to see if I could get it to work.
  5. Thanks but it didn't work
  6. Hi there, I am attempting to update a MySQL table with the following script but I can't get it to work even though I've tried all sorts of changes in the query. <?php require('dbconfig.php'); $updateid = $_SESSION['ID']; $new = "0"; $query = "UPDATE users SET new='$new' WHERE ID='$updateid'"; mysql_query($query); mysql_close(); header("Location: home.php"); ?> Can you see anything wrong? Thanks for your help, Jim
  7. Hi there. I am having trouble with a script which used to work but since moving to a new host I have changed a lot. Could someone please help me find where I am going wrong because the error I get doesn't give any kind of clue to what is wrong and I just can't figure it out. Here's the code: <?php //GET key: 1=not logged in, 2=user non-existant, 3=wrong password, 4=fields blank, 5=registered now login, 6=user already exists, 7=passwords don't match, 8=emails don't match, 9=email not sent //This checks for invalid inputs function checkOK($field) { if (strstr("\r",$field) || strstr("\n",$field)) { die("Invalid Input!"); } } //random string generator function randstr($md5 = "no", $length = "32", $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890') { //character list length $char_length = (strlen($chars) - 1); //start the string $string = $chars{rand(0, $char_length)}; //generate string characters for ($i = 1; $i < $length; $i = strlen($string)) { //Generate a random character from the list $c = $chars{rand(0, $chars_length)}; //make sure same characters don't appear together if ($c != $string{$i - 1}) { //add letter to string $string .= $c; } } //optional md5 encryption if ($md5 == "md5") { $string = md5($string); } //return the string return $string; } //This code runs if the form has been submitted if (isset($_POST['Submit'])) { //This makes sure they did not leave any fields blank if ((!$user) || (!$pass) || (!$pass2) || (!$email) || (!$email2)) { header("Location: register.php?reason=4"); } //make field values into variables $user = $_POST['user']; checkOK($user); $pass = $_POST['pass']; checkOK($pass); $pass2 = $_POST['pass2']; checkOK($pass2); $email = $_POST['email']; checkOK($email); $email2 = $_POST['email2']; checkOK($email2); require('dbconfig.php'); // checks if the username is in use if (!get_magic_quotes_gpc()) { $user = addslashes($user); } $check = mysql_query("SELECT username FROM users WHERE username = '$user'") or die(mysql_error()); $check2 = mysql_num_rows($check); //if the name exists it gives an error if ($check2 = 0) { header("Location: register.php?reason=6"); //check that the variable's length is ok } else if ((strlen($user) < 5) && (strlen($user) > 20)) { //if the username is not the correct length, redirect header("location: register.php?reason=9"); } // this makes sure both passwords entered match if ($pass != $pass2) { header("Location: register.php?reason=7"); } // here we encrypt the password and add slashes if needed $pass = md5($pass); if (!get_magic_quotes_gpc()) { $pass = addslashes($pass); $user = addslashes($user); } // checks that both emails match if ($email != $email2) { header("Location: register.php?reason=8"); } //message subject $subject = "Social Space email verification"; //unique random string for boundary string $random_hash = randstr("md5"); //headers must be seperated with \r\n $headers = "From: no-reply@groupyournetworks.com\r\nReply-To: support@groupyournetworks.com"; //add boundary string and mime-type application $headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\""; //message body //generate random code with md5 encryption to ensure uniquity (mostly) $code = randstr("md5"); ob_start(); //Turn on output buffering ?> --PHP-alt-<?php echo $random_hash; ?> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi <?php echo $user; ?> and welcome to Social Space. To complete your registration go to: http://www.groupyournetworks.com/authenticate.php?user=<?php echo $user; ?>&code=<?php echo $code; ?> --PHP-alt-<?php echo $random_hash; ?> Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit <h4>Hi <?php echo $user; ?></h4> <p>To complete your registration click the following link: <a href="http://www.groupyournetworks.com.authenticate.php?user=<?php echo $user; ?>&code=<?php echo $code; ?>"><?php echo $code; ?></a></p> --PHP-alt-<?php echo $random_hash; ?>-- <?php //save message to $message and clear output buffer $message = ob_get_clean(); if (mail($email, $subject, $message, $headers)) { } else { header("Location: register.php?reason=9"); } // now we insert it into the database $insert = "INSERT INTO users (username, password, email, new, valid, code) VALUES ('$user', '$pass', '$email', '1', '0', '$code')"; $insert2 = "INSERT INTO networks (ignore) VALUES ('ignore')"; $add_member = mysql_query($insert); $add_member2 = mysql_query($insert2); mysql_close(); header("Location: index.php?reason=5"); } else { die("The form must be submitted!"); } ?> Thanks, Jim
  8. Thanks, obviously your biased towards Wesh ;P but I understand what you're saying. I do have a debit card but it can't be used with paypal and my stupid bank won't give a me a debit card until I'm 16 even thought they gave a friend of mine one at 14. :@
  9. Fairly sure it's not my script as while searching the web others have posted that after after asking their host to open socket connections reCaptcha worked. The error I get is "Could not open socket" *sigh* I suppose I'll have to use a paid hosting service. It's just that at 15 it's quite tedious to use paid online services. Just out of interest could you reccommend a decent, cheap paid host? At the moment I'm thinking of awardspace. Thanks for your help, Jim
  10. Hi, my website relies totally on the use of API's but every free host I've used so far restricts free users from any outbound connections so I can't even use reCaptcha. I will most likely use a paid host soon but I really need a free host to test my site with. Thanks for your help, Jim
  11. jimbobd replied to jimbobd's topic in Frontend
    I have been learning JQuery and realised that there is a tabs function which looks useful so I'll give that a try
  12. jimbobd replied to jimbobd's topic in Frontend
    Would it be better to accomplish this using html to load an almost identical page with the only difference being the alternate box. Or possibly even in flash?
  13. jimbobd posted a topic in Frontend
    Hi there, I am trying to create a combined login/register box using tabs to switch between. I have used Javascript to switch the tabs but I just seem to be getting two boxes on top of each other :S Could you please point out where I am going wrong? Thanks. Here is my code: <script language="javascript">if (box == "login") {</script> <div class="login"> <p align="center" class="style15">Login</p> <form id="form1" name="form1" method="post" action="login.php"> <label><span class="style11"> Username:</span> <br /> <input type="text" name="user" id="user" /> </label> <label><span class="style11"> Password:</span> <br /> <input type="password" name="pass" id="pass" /> </label> <label><br /> <input type="checkbox" name="remember" id="remember" /> <span class="style14">remember me</span> </label> <br /><br /> <div align="center"> <input type="submit" name="Submit" id="Submit" value="Submit" /> </div> </form> </div> <script language="javascript">} else if (box == "register") {</script> <div class="login"> </div> <script language="javascript">}</script> <div id="logintab" onclick="document.getElementById('logintab').style.background-image='url(Images/tab_on.png)'; document.getElementById('registertab').style.background-image='url(Images/tab_off.png)'; var box='login';"> </div> <div id="registertab" onclick="document.getElementById('registertab').style.background-image='url(Images/tab_on.png)'; document.getElementById('logintab').style.background-image='url(Images/tab_off.png)'; var box='register';"> </div>

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.