Jump to content

JonnoTheDev

Staff Alumni
  • Posts

    3,584
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JonnoTheDev

  1. If the text contains no spaces or line breaks it will push the cell out
  2. Firstly you need a javascript function function decision(message, url){ if(confirm(message)) location.href = url; } Use an image or whatever as the delete button and call the function: <a href='#'><image border='0' src='images/trash.gif' onclick="decision('Are you sure?','mypage.php?action=delete&id=2')"></a> Then add your php to delete the record if($_GET['action'] == 'delete') { mysql_query("DELETE FROM table WHERE id='".$_GET['id']."'"); header("Location:mypage.php"); exit(); }
  3. Needs colour and lose the background. Bit like a newspaper.
  4. READ is a mysql reserved word. You cannot use it as a field name. http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html
  5. Why are the using 2 tables? If you want members to login to 2 sites then the should both query the same members table. Your other option albeit an unorthodox one is that if a user registers on one site their details are saved into both member tables
  6. Using imageMagick via an exec() command http://www.imagemagick.org/script/index.php
  7. Can you print the mysql error using mysql_query($query) or die(mysql_error());
  8. There is one here in his HTML. Should be fine. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  9. Looks knackered
  10. Difficult. You may be better adding a surname field to the database and writing a script that will break the name up and update name and surname. Add a new field for surname on any forms that insert into the table
  11. That may be a bit complicated for this users level of experience
  12. Each record in the database will have a primary key id i.e. 1 John Abrams 2 Lisa Brown 3 John Cash etc Use this id as the value of the select list option. When the search button is clicked use the id to find the records you want: SELECT * FROM table WHERE user_id='".$_POST['user_id']."' so if I select Lisa the query comes out as: SELECT * FROM table WHERE user_id='2'
  13. What I want to know is why you would create an individual class to validate one piece of information. You are creating a single function wrapper. Bad programming. These would be better off in a simple functions file: function check_email() function check_username() etc Makes no sense to instantiate an object to check an email address.
  14. View the source of the webpage in your browser when they appear to find the location. This should give you an idea of what is causing them. Could be a javascript include, CSS file, etc
  15. You need to use round() to round up. $num = 8.95; $num = round($num); ceil rounds fractions up so 4.3 will become 5
  16. Its gotta be this within your query. Check my post above `{$this->kernel->get_config ( 'images_table' )}`
  17. Must be. Use the following: $this->kernel->query("INSERT INTO ".$this->kernel->get_config('images_table')." VALUES('','".$image_id."','".addslashes($upload_folder.$file_name)."');");
  18. Since your error reads It seems that you maybe passing an object into the query rather than the SQL. There is nothing wrong with the SQL syntax. Check your code.
  19. If this is your hosting environment i.e: /public_ftp/ /public_html/ /cgi-bin/ Then your web files are located in /public_html/ and are all accessible publically. This is where you do not want to store your mp3 files or users can just use http://www.yourdomain.com/mp3/xyz.mp3 as an example. If you do the following: /public_ftp/ /public_html/ /cgi-bin/ /mp3/ Then users cannot access this directory publically. If the mp3 files are for download then you can write a download script on your website that grabs the file from outside of your website document root.
  20. http://www.higherpass.com/php/Tutorials/Using-Curl-To-Query-Remote-Servers/
  21. Along the lines of $errors = array(); if(!strlen(trim($_POST['name']))) { $errors[] = "Name"; } if(!strlen(trim($_POST['address']))) { $errors[] = "Address"; } if(!count($errors)) { // no errors - insert record foreach($_POST as $key => $val) { $_POST[$key] = mysql_real_escape_string(trim($_POST[$key])); } mysql_query("INSERT INTO table SET name='".$_POST['name']."',address='".$_POST['address']."'"); header("Location:xyz.php"); exit(); } else { // display errors echo "You need to complete the following fields: ".implode(", ", $errors); }
  22. You need to learn cURL properly. Write a function that takes the URL to make the request and any POST data in the form of an array. Each request is made using curl_exec() What you have basically done is logged in using: curl_setopt($ch, CURLOPT_URL, 'http://quiver.outwar.com/myaccount.php'); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, 'login_username=username&login_password=password'); $result1 = curl_exec($ch); And then pasted my example code in. You must make further requests to the website, so your second request is to security_prompt.php i.e. curl_setopt($ch, CURLOPT_URL, 'http://quiver.outwar.com/security_prompt.php'); // rest of code // execute request $result = curl_exec($ch);
  23. If I were you I would tidy that code up also. It is best practice to reload the page after any update/insert query. This prevents a user hitting refresh on their browser and causing multiple updates or inserts into your database. The code that inserts/updates the database is best placed at the very top of your file (before any HTML or data is printed to the screen). That way you can use the header() function to reload the page i.e. if($_POST['submit']) { // update database mysql_query("UPDATE table SET name='".mysql_real_escape_string($_POST['name'])."' WHERE id='".mysql_real_escape_string($_POST['id'])."'"); // reload page to prevent user refresh header("Location:xyz.php?id=".$_POST['id']."&update=success"); exit(); } // display a message if update was ok if($_GET['update'] && $_GET['update'] == 'success') { echo "Thank you. Your record was updated successfully"; }
  24. Store the mp3s outside your web document root so they are non-accessible. The only way a user can download the file is via your websites own download script.
  25. All you need to do then is add the sample code I have given you to submit the following to security_prompt.php prompt_number = 12 answer = security_submitted = Continue so: $dataArray = array('prompt_number' => 12, 'answer' => 'slumdog millionaire', 'security_submitted' => 'Continue'); Read up on using cURL and write yourself a set of functions as you are likely to need POST and GET routines or set various cURL options in the future.
×
×
  • 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.