Jump to content

Desdinova

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Everything posted by Desdinova

  1. Just keep the .connect with the PHP code. No need to include HTML. .connect.php: <? $db_host = "host name"; $db_user = "jeliot"; $db_pwd = "password"; $db_name = "email"; mysql_connect($db_host, $db_user, $db_pwd) or die(mysql_error()); mysql_select_db($db_name) or die(mysql_error()); ?> you have a typo in the code where the script gets included. Other than that, change the include line to: require (".connect.php"); require will kill the script when the file can't be found. include will not.
  2. It seems to only find one row. Could you pass the table data from the database? so like copy the 2 rows it's supposed to find.
  3. hmm I see. Ok, if you'd please clean up the script you posted and remove any unnecesary items I can look it through. Don't have too much time on my hand to figure all stuff out :) or you could wait for someone else to help.
  4. first of all, tab your code. lets pretend '-' is a tab. Do it like this: if ($something){ - do this; } if ($somethingtwo){ - if ($somethingthree){ - - do that; - } } this way you can see what is happening where. I suggest you download crimson editor, and go to options to add another vertical guideline halfway the screen. al the //comments and /* comments */ could be placed right next to it, giving you a short and brief overview. another quick comment, I wouldn't suggest the submit button as an identification as to what process you should run. Somebody hitting enter in your form will not activate the button, thus not POSTing the submit button value. Rather place a hidden field with name submit and value set or something, so you really know what's going on. Unless you have multiple formbuttons with different option. Then you should use the submitname, and preferably disable the enter button. The code itself looks ok. You could be able to connect your database using 2 lines mysql_connect("localhost","username","pass"); mysql_select_db("dbname"); just 2 cents :) mind the tabbing! You'll need it lateron. I promise.
  5. for the first: ' . $num . ' ' . $question . ' for the second, I think your while loop is in a table, and your table is not properly closed when you echo the submit button (so your submit button probably shows up after a </tr> which positions it on top of the table). there :)
  6. $totalamount = $pro * PROPRICE + $comp * COMPPRICE + $personal * PERSONALPRICE + $diy * DIYPRICE + $host * HOSTPRICE + $qna * QNAPRICE + $facts * FACTSPRICE + $calc * CALCPRICE + $news * NEWSPRICE; + $setupcomp * SETUPCOMPPRICE; + $setuppersonal * SETUPPERSONALPRICE; + $setupdiy * SETUPDIYPRICE; + $setuphost * SETUPHOSTPRICE; didn't look through the whole code, but I found some extra ;-thingies in here. Try this: $totalamount = $pro * PROPRICE + $comp * COMPPRICE + $personal * PERSONALPRICE + $diy * DIYPRICE + $host * HOSTPRICE + $qna * QNAPRICE + $facts * FACTSPRICE + $calc * CALCPRICE + $news * NEWSPRICE + $setupcomp * SETUPCOMPPRICE + $setuppersonal * SETUPPERSONALPRICE + $setupdiy * SETUPDIYPRICE + $setuphost * SETUPHOSTPRICE;
  7. Well for starters you could of course limit your needs. So instead of wanting to make sure you get ALL duplicates, just find some, or a lot. And for this you could use the methods you described yourself. And maybe you should think of Filesize.
  8. This is more a CSS issue than PHP. I suggest you take a closer look at CSS and HTML. It can be easily done with DIVs and the CSS Float option, or the position-element.
  9. I'm not sure what you're trying to achieve. As you can see, the error is in calendar/index.php and you're trying to include calendar/index.php? that would create an infinite loop? I'd suggest 'require' and format it like <? require ("index.php"); ?> If the file cannot be found, you could try complete URLs (<? require ("http://www.whatever.com/index.php"); though I have the feeling some servers may have this feature disabled. However, it should be on the same server, so it might be possible. It shouldn't give errors.
  10. you mean like just wait? sleep(60); should give you 60 seconds of pause-time. sleep is very useful for login scripts, so you let it sleep for 1 or 2 seconds, so a mass-password-inputting piece of software can only process about 60 to 30 a minute. meaning it would take at least a few days to actually crack a code.
  11. Yes I had it like that. But the problem with this is, that it only gets as much childmenu's as the amount of queries I put in it, thus not making it infinitely deep.
  12. are you sure every item is spelled the right way (mind caps and all)?
  13. did you try putting the numbers between quotes? ie WHERE col = '10'?
  14. or put a ob_start(); right at the beginning of the page, and a ob_end_flush(); at the very end. else, what emerhka (or something, can't remember sorry ;) ) said.
  15. Ok well this is the case. I have a mysql database, with a table Menuitems: ID, Name, LinkedID. The idea is this, a menuitem gets an incremented ID, a name, and a linkedID. The linkedID shows which ID is the menu's parent. Now I want the childs to go infinitely deep, meaning I need some sort of query loop. Brief example: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] ID----Name--------LinkedID 1-----MenuA----------0------ 2-----MenuB----------0------ 3-----SubmenuA-----1------ 4-----SubmenuAA----3----- [/quote] This would produce: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] MenuA --SubmenuA ----SubmenuAA MenuB [/quote] As you can see, if LinkedID = 0, the menu is not a child, else it is. So everytime LinkedID != 0, a query must be called. How can I loop this?
  16. I might have a simular problem.. I'm trying to run a shell_exec with a ping, but this only works well when run from a browserwindow. Through a cronjob it's not running the shell_exec at all..
×
×
  • 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.