Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else { "<a href='PeterBonConfirmation.html'></a>"; } That's whats printing out: <p>Failed to set sender: @localhost [sMTP: Invalid response code received from server (code: 501, response: <@localhost>: no local part)]</p> Perhaps show us the entire script, mainly after what you've shown us already?? I've seen it happen before, all it is is the HTML after the script would contain a closing tag or another column which forces the form back into it's right place... If you notice after the form is submitted the adverts on the right side dissapear... Adam
  2. Don't need to use: die(' .. '); .. can use: die(" .. "); ??? Is it actually showing ANYTHING in the source? Namely the HTML tags before and after the script?? Adam
  3. From what I can see you're not outputting the rest of the page after the PHP output.. you look at the source before the form is submitted and you can see a closing body and html tag, but when you look at the source after the form is submitted and there's no body or html tag and it ends with: <p>Failed to set sender: @localhost [sMTP: Invalid response code received from server (code: 501, response: <@localhost>: no local part)]</p> So basically after your script you need to output the rest of the page and that will make it align correctly.. Adam
  4. Should be: while ($row = mysql_fetch_array($query)) { echo "<br /> Title: " .$row['Title']. "<br /> Story: " .$row['Content']; } EDIT: Notice the quote removed from the end...
  5. Try echo'in out $tabs and make sure its correct, and also change: $result = mysql_query("select * from $tabs order by id"); to.. $result = mysql_query("select * from {$tabs} order by id") or die('MySQL Error: ' .mysql_error()); ...then see what happens. Adam
  6. Reckon I've got the logic right, but can't get it to work properly... <?php $resSQL = "SELECT * FROM reservations WHERE (datefrom BETWEEN '{$year}/{$month}/01' AND '{$year}/{$month}/{$daysInMonth}' OR ((datefrom BETWEEN '{$year}/{$month}/01' AND '{$year}/{$month}/{$daysInMonth}') AND (dateto BETWEEN '{$year}/{$nextMonth}/01' AND '{$year}/{$nextMonth}/{$daysInMonth}')))"; ?> What is working is that it's returning any reservations where the starting date is in $month .. however still the overlapping reservations are left out, both any at the start or end of month.. I may have overused brackets starting at the "OR"... All variables are correct, double checked. I think it's just something wrong with either bracket use or slight logic problem. What does a fresh pair of eyes see? Any help appreciated, Cheers! Adam
  7. I imagine then that your just sort of incrementing the current ID by 1 for the "next" button? Seen as the IDs don't match up and you can't always guarantee that they will all be flowing one after another, you could try something more like: <?php $record = (int) $_GET['record']; $query = mysql_query("SELECT * FROM table LIMIT {$record}, 1"); //... ?> That would return the first, second, third record or whatever from the table.. obviouslly it won't always match the ID, but you could still do a check for that.. like if they go to .. adult.php?id=3 .. then you select it by the ID, or if its .. adult.php?record=2 .. then you select it by the record number or something? I don't know but it's a an idea, would allow you to keep the "next" button feature... Adam
  8. As chronsiter says, can't really detect refresh with PHP... But why would you want to log them off if they refreshed?? It would get really annoying if every time I refreshed the page I was logged out... I'd reccomend database sessions aswell, sounds like you want it closely montiored and secure so they're your best bet! Adam
  9. Could try JOINs.. http://www.google.co.uk/search?hl=en&q=mysql+join Or perhaps this may help.. http://www.astahost.com/info.php/mysql-multiple-tables_t12815.html Adam
  10. double check $filename 's what its supposed to be ..
  11. Hate working with dates in MySQL, but here's the problem: "SELECT * FROM reservations WHERE (datefrom BETWEEN '{$year}/{$month}/01' AND '{$year}/{$month}/{$daysInMonth}')"; That works almost perfectly, except for it won't return reservations that overlap months (in the next month anyway). So if the datefrom date is january 29th, it won't show the reservation in february... The dates are stored in "date" (YYYY-MM-DD) format. I sort of come close to working it out then my mind goes blank and i can't think... doing my head in! Anybody have any possibilities? Cheers, Adam!!
  12. Ignore first half of last post, but there's your problem... Adam
  13. Well just cut and paste the function into a new file and test it out, eg: <?php function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $type = substr($str,$i+1,$l); return $ext; } print getExtension('testfile.jpg'); ?> if it works properly should return "jpg", but possibly could be returning ".jpg" ?? You could use something MUCH simpler like: function file_extension($filename) { $path_info = pathinfo($filename); return $path_info['extension']; } Adam
  14. Does it say "wrong file type" .. or does it say .. "Unknown file extension! Only .gif, .jpg, .png, pdf and dwg and files are allowed to be uploaded" ?? Have you double checked the function getExtension is returning the right value? Adam
  15. Yeah, building on what they've said... When you get to: $row = mysqli_fetch_assoc($result); extract($row); header("Location: http://localhost/webapp/logingreet.php?user_name=$row[userid]"); Use: $row = mysqli_fetch_assoc($result); $_SESSION['user_name'] = $row['user_name']; header("Location: http://localhost/webapp/logingreet.php"); Change the query to: $query = "SELECT * FROM users WHERE userid='$_POST[user_name]' AND pwd=md5('$_POST[password]')"; (note * .. which means select every field) Then on logingreet.php: <?php session_start(); if ( isset($_SESSION['user_name']) ) { echo "Hello,{$_SESSION['user_name']}Welcome to the secret page"; } else { echo "Not logged in!"; } ?> ... not forgetting session_start() at the start of each page. Hope that sheds a little more light on things?? Adam
  16. <?php echo "Hello,{$_GET['user_name']}Welcome to the secret page"; ?> All you're doing here is outputting $_GET['user_name'], which is whatever they enter in the URL ?
  17. You're not making a lot of sense - "it will result in a blank page in the middle", ey? what do you mean blank pages? Like for example if there was no id=5 and you've gone to .php?id=5, it would be a blank page? Could just not link to them? or to stop the pages being blank perhaps output an error? Wouldn't be much use in storing them in another query to be honest, don't think it's possible to sort of temporarily save the results and access them in another query without literally saving them in another table? But that would be pointless? Could store them in an array if you really wanted though? An when you say sorted, do you mean so the IDs are all sort of flowing ie. 0 1 2 3 4 5 6 7 ... or do you mean by category? If its by category could just use: ALTER TABLE tableName ORDER BY category If it's flowing I'm not a 100% but I don't think it's possible with a simple query? But could loop thru the results and sort of rearrange them that way, probs get a little messy but would be a soloution.. Try and explain things better.. Adam
  18. Never really worked with oracle before so can't say a great deal.. but if you show a little more code just sorta how you retrieve the array from the db, might be able to help you bit more.. Adam
  19. I assume it's to build a js function? I imagine you'll need quotes around $type value aswell?? Using kens code.. <?php echo '("' . $Type . '",0,"' . $Say . '")'; ?>
  20. Could perhaps use title="" ?? Or could develop your own custom popup or something with javacript? Adam
  21. Could use javascript... something like: <body onload="document.forms[0].inputName.focus();"> ?? Adam
  22. Can echo a variable in any way you like, but unless you've literally set the variable (ie. $var = 'something' .. $var has absoloutley no value, the script cant guess or assume the value... Adam
  23. try: $text = 'Sample text' ."\n". 'Sample text';
  24. Okay, well it should be. Most likely a problem else-where.. what error are you getting? Adam
  25. Perhaps "TEXT"? Could set the character set to UTF-8 aswell, just to make sure? Though I'm no expert at all with character sets... Adam
×
×
  • 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.