Jump to content

heldenbrau

Members
  • Posts

    159
  • Joined

  • Last visited

Everything posted by heldenbrau

  1. Just getting back to this, thanks for the support. I haven't tried doing the http_build_query yet, but I just asked somebody with the problem to save the html of the first page, they are viewing it from Safari with a mac, this is part of the code, it looks like it shows a url that would fail: ('b93').style.display='block';"> <a class="topseltxt" href="gem.php5?expand=DarkxzxBlue&first=AAAAAxzxMachinexzxCut&second=LabxzxBluexzxSapphire&third=DarkxzxBlue&fourth=Oval&level=4">Dark Blue</a><br> <div class="contain" id="a93"> <div class="menuitems" id="b93"><a class="topseltxt" href="gem.php5?expand=Oval&first=AAAAAxzxMachinexzxCut&second=LabxzxBluexzxSapphire&third=DarkxzxBlue&fourth=Oval&level=4">Oval</a><br><a class="topseltxt" href="gem.php5?expand=RoundxzxBrilliant&first=AAAAAxzxMachinexzxCut&second=LabxzxBluexzxSapphire&third=DarkxzxBlue&fourth=RoundxzxBrilliant&level=4">Round Brilliant</a><br> I changed the @ to xzx becausse I thought @ might not be understood, but it has no effect.
  2. I spent all day yesterday correcting the links and correcting lots of errors on the site. I haven't fixed them all, but the ones I haven't fixed are just div being closed without one being open, there was no way I could find of fixing it without making the php code not work so I left it for now. I asked my customer to try it and she is still having the same problem. I want to try the php.ini thing, but I don't know where to start and what errer reporting I need to turn on. Would the following work, to include pages I want to test, then tell her to visit the page? <?php error_reporting(E_ALL); ini_set("display_errors", 1); include("index.php5"); ?>
  3. I searched for *.ini and there are none in the FTP site, I don't know how to find it if it is not on the FTP site. This is my host 1and1 FAQ about modifying the php.ini file. http://faq.1and1.co.uk/scripting/php/8.html I think you are right about the URL's not validating and have been trying to correct it, but have now found a new problem. The error is using & in the URL instead of & but I can't fix it in the following main bit of code: header("location:gem.php5?level=3&expand=$goup2&first=$goup1&second=$goup2"); if I change the & to & it doesn't work, it shows & in the URL bar and not & and the link doesn't work. But the following code does work for the links at the side of the page: <a href="gem.php5?expand=$lsbsecond&first=$lsbfirst&second=$lsbsecond&level=3">$prlsbsecond</a><br/> In the URL bar the above code shows & not & Is there something else to use when using header("location: ?
  4. I can't find it on the FTP site using FireFTP, if I use find to search for for PHP.ini it doesn't find anything. I have read other forums and they say about uplaoding an htaccess file or uploading a php.ini file which modifies the main one. It sounds like you can't access the main php.ini file. The index page loads then she clicks on one of the gem pictures and it loads a page called gem, this gives the 500 internal server error. The website is www.diamondcz.com
  5. My browser does report PHP errors like if I miss out a ; it will say so in the browser. But the woman who is getting this error only has Internal server error displayed on her screen and no error report. I don't think I have access to the php.ini file, it is another thing they stop us being able to use.
  6. I'm not sure if this is the right forum to ask on, but I have a website that uses PHP which is giving problems to one person and possibly more. She has tried lots of different computers with different routers and browsers and gets internal server 500 error. The home page loads fine, but when she clicks on a link that sends a query to the database and brings back a page she gets the internal server error. My web host is not being helpful because I can't see the error log, only they can and they aren't respecting that the person has tried different computers and telling me to tell her to clear cache and cookies and flush dns. I have given up on technical support, but now I don't know what to do to try and solve this problem, any ideas?
  7. I have 3 sales channels, ebay, Amazon and romancart. I want to use their API's to manage stock levels and started to write the program, but now I have found out that romancart doesn't have API access. I haven't ever used API's before so it is a totally new thing for me to learn. What I want to know is, is it possible to update the stock in romancart anyway, like login to the website find the stock and change it with a PHP program, or any kind of computer program?
  8. Thanks loads, that worked. Should have asked here an hour ago instead of looking up all this parseInt stuff that didn't make any sense.
  9. I have a variable which is 100 and I want to add 1000 to it making 1100 tbox$count.value = change$count+1000; It give the following 1001000 What do I need to do to make it display 1100?
  10. The program only emails me to let me know that somebody has filled in the form. Everything that goes into the form is put into a database, then I use another website to view what has been entered into the form and decide to delete it or verify it. Nothing from the form goes into an email.
  11. I have just added validation. I made 9 number png files and named them 1.png to 9.png then picked a random number from 1 to 9 four times and put them in order $a$b$c$d to make the number and display the png files. Then it sends the number as a hidden field. I haven't had any spam since then. So this is really just to annoy people?
  12. I wouldn't call it spam because the websites it has put into the form don't exist. It is just randomly generated rubbish. I don't have validation because I didn't consider something like this, now I will have to add it. But what is the point of this stuff?
  13. What is the purpose of a spam bot?
  14. I forgot to say, no picture is uploaded, this stuff goes into the title, description and video URL link box.
  15. I added a form to my website so people could upload pictures. When somebody uploads a picture I get sent an email. Today I keep getting emails saying somebody has uploaded a picture, but when I check it is full of rubbish such as this: aihotryivvjk, [url=http://lfhelcxniajg.com/]lfhelcxniajg[/url], [link=http://zeqmxytfhfob.com/]zeqmxytfhfob[/link], http://equhlndtroti.com/" target="blank">khq2VJ aihotryivvjk, [url=http://lfhelcxniajg.com/]lfhelcxniajg[/url], [link=http://zeqmxytfhfob.com/]zeqmxytfhfob[/link], http://equhlndtroti.com/ Every form is filled in with this stuff. What is this stuff?
  16. I keep getting the following error: Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established With this code: <?php $level = $_POST[level]; $first = $_POST[first]; $second = $_POST[second]; $third = $_POST[third]; $fourth = $_POST[fourth]; $mysqli = new mysqli("*****", "*****", "******", "********"); if ($mysqli === false) { die("ERROR: Could not connect to database. " . mysqli_connect_error()); } $vidlink=mysql_real_escape_string($_POST[vidlink]); $title=mysql_real_escape_string($_POST[title]); $des=mysql_real_escape_string($_POST[des]); $website=mysql_real_escape_string($_POST[website]); $cat= mysql_real_escape_string($first . $second . $third . $fourth); why won't it work?
  17. Is there a quick way to increment a value in a database. I want to count how many times users go to certain pages. So when somebody clicks the page, a php script connects to the database and adds 1 on to the number. The only way I know how to do it is to connect to the database, search the table for this page and get the number of times it is viewed, then update the table. So 2 queries, is there a way to do it in one?
  18. I am trying to do the following query, but it produces an error, which I expect. SELECT * FROM newgems WHERE cut='10 Hearts & Arrows' OR cut='8 Hearts & Arrows' WHERE colour='Lavender' OR colour='Light Champagne' OR colour='White' What do I use instead of WHERE? Because if I use AND then it selects everything in White, not just '10 hearts & arrows' and '8 hearts & arrows'. It needs to select only white, lavender or light champagne gemstones that are 8 or 10 hearts and arrows cut.
  19. Here is the current code $level=1; $n=1; $sql = "SELECT * FROM dczcat1 ORDER BY position"; if ($result = $mysqli->query($sql)){ if ($result->num_rows > 0){ while ($row = $result->fetch_array()){ $table=$row[cattable]; echo"$table"; $scat2=$table . 2; echo"$scat2"; $cat=$row[cat]; echo"$cat"; $n+=1; ${sql . $n}="SELECT * FROM $table ORDER BY position"; echo"$sql"; if(${'result' . $n}=$mysqli->query(${sql . $n})){ if(${'result' . $n}->num_rows>0){ echo"Pumpkin"; while (${row . $n} = ${'result' . $n}->fetch_array()){ echo"<br />should not be displayed if it doesn't say Pumpkin above"; $level+=1; echo"LEVEL69:$level"; echo<<<HTML <div class = "menutitles" onmouseover="document.getElementById('$table').style.display='block';document.getElementById('$scat2').style.display='block';" onmouseout="document.getElementById('$table').style.display='none';document.getElementById('$scat2').style.display='block';" > <a class="topseltxt2" href="gem.php?cat=$table">$cat pos44</a><br/> <div class="contain" id="$table"> <div class="menuitems" id="$scat2"> HTML; $prevtab=$table; $table=${row . $n}[cattable]; echo "$table"; $scat2= $table . 2; echo "$scat"; $cat = ${row . $n}[cat]; echo "$cat"; select($n, $cat, $table, $scat2, $mysqli, $level); } }else if($level==1){echo" <a class='topseltxt' href='gem.php?cat=$table'>$cat pos2</a><br/> "; echo"table:$table"; }else{ ${sql . $n}="SELECT * FROM $prevtab ORDER BY position"; if(${'result' . $n}=$mysqli->query(${sql . $n})){ if(${'result' . $n}->num_rows>0){ While(${row . $n}=${'result' . $n}->fetch_array()){ $table=${row . $n}[cattable]; $scat2= $table . 2; $cat = ${row . $n}[cat]; echo" <a class='topseltxt2' href='gem.php?cat=$table'>$cat pos3</a><br/> ";} } } $level-=1; } }else{ die("ERRORpos1: Could not execute query $sql." . $mysqli->error); }echo"</div> </div> </div>"; } } }else{ die("ERROR: Query failed: $sql." . $mysqli->error); } Here is the html dczcat1RoundBrilliantdczcat1RoundBrilliant2Round BrilliantSELECT * FROM dczcat1 ORDER BY positionPumpkin<br />should not be displayed if it doesn't say Pumpkin aboveLEVEL69:2 <div class = "menutitles" onmouseover="document.getElementById('dczcat1RoundBrilliant').style.display='block';document.getElementById('dczcat1RoundBrilliant2').style.display='block';" onmouseout="document.getElementById('dczcat1RoundBrilliant').style.display='none';document.getElementById('dczcat1RoundBrilliant2').style.display='block';" > <a class="topseltxt2" href="gem.php?cat=dczcat1RoundBrilliant">Round Brilliant pos44</a><br/> <div class="contain" id="dczcat1RoundBrilliant"> <div class="menuitems" id="dczcat1RoundBrilliant2"> dczcat1RoundBrilliantWhiteWhite<br />should not be displayed if it doesn't say Pumpkin aboveLEVEL69:3 <div class = "menutitles" onmouseover="document.getElementById('dczcat1RoundBrilliantWhite').style.display='block';document.getElementById('dczcat1RoundBrilliantWhite2').style.display='block';" onmouseout="document.getElementById('dczcat1RoundBrilliantWhite').style.display='none';document.getElementById('dczcat1RoundBrilliantWhite2').style.display='block';" > <a class="topseltxt2" href="gem.php?cat=dczcat1RoundBrilliantWhite">White pos44</a><br/> <div class="contain" id="dczcat1RoundBrilliantWhite"> <div class="menuitems" id="dczcat1RoundBrilliantWhite2"> dczcat1RoundBrilliantCitrineCitrine</div> </div> </div>dczcat1Antiquedczcat1Antique2AntiqueSELECT * FROM dczcat1 ORDER BY positionPumpkin<br />should not be displayed if it doesn't say Pumpkin aboveLEVEL69:4 <div class = "menutitles" onmouseover="document.getElementById('dczcat1Antique').style.display='block';document.getElementById('dczcat1Antique2').style.display='block';" onmouseout="document.getElementById('dczcat1Antique').style.display='none';document.getElementById('dczcat1Antique2').style.display='block';" > <a class="topseltxt2" href="gem.php?cat=dczcat1Antique">Antique pos44</a><br/> <div class="contain" id="dczcat1Antique"> <div class="menuitems" id="dczcat1Antique2"> dczcat1AntiqueOldEuropeanCutOld European CutPumpkin<br />should not be displayed if it doesn't say Pumpkin aboveLEVEL69:5 <div class = "menutitles" onmouseover="document.getElementById('dczcat1AntiqueOldEuropeanCut').style.display='block';document.getElementById('dczcat1AntiqueOldEuropeanCut2').style.display='block';" onmouseout="document.getElementById('dczcat1AntiqueOldEuropeanCut').style.display='none';document.getElementById('dczcat1AntiqueOldEuropeanCut2').style.display='block';" > <a class="topseltxt2" href="gem.php?cat=dczcat1AntiqueOldEuropeanCut">Old European Cut pos33</a><br/> <div class="contain" id="dczcat1AntiqueOldEuropeanCut"> <div class="menuitems" id="dczcat1AntiqueOldEuropeanCut2"> dczcat1AntiqueOldEuropeanCutWhiteWhite</div> </div> </div> It has run with no errors, but it isn't displaying the information correctly. That is because it is not obaying the if(){} it is ignoring that num_rows>0 and executing what is in {} anyway.
  20. If I do get rid of the database structure though, I still want to understand how it can skip passed the word pumpkin but still display the next line of text. The problem is all caused because of these 2 lines, I have fixed the $result thing, but now I have a new problem. if(${'result' . $n}->num_rows>0){ echo"Pumpkin"; while ($row = ${'result' . $n}->fetch_array()){ echo"<br />should not be displayed if it doesn't say Pumpkin above"; It shouldn't try to fetch the array because num_rows is not greater than 0, but it does try and fetch the array and then it says call to function fetch_array() on a non object. But it shouldn't call it, it should skip it because num_rows is not greater than 0 and if it was greater than 0 then surely it should display the word pumpkin, but it doesn't display the word pumpkin and still goes on to execute the next 2 lines. To me this is impossible.
  21. It only echos the pumpkin once, the second time round it doesn't at line 9 on the html. I am still learning and maybe I will work on the database structure later, but now I want to understand how it is possible that the word pumpkin is not displayed and the next line is. For the database, is it significantly slower to search a new table than to just search 1 huge table for everything. I thought it would be quicker to search lots of little tables than search one big one each time. I've tried to do this program with one big table and it is really difficult so I decided it would be easier to split them up and if it was not too slow use this structure.
  22. I have updated it since, I will post the code again and the html to make sure that it is the exact same code. $sql = "SELECT * FROM dczcat1 ORDER BY position"; if ($result = $mysqli->query($sql)){ if ($result->num_rows > 0){ while ($row = $result->fetch_array()){ $table=$row[cattable]; echo"$table"; $scat2=$table . 2; echo"$scat2"; $cat=$row[cat]; echo"$cat"; $sql="SELECT * FROM $table ORDER BY position"; echo"$sql"; if($result=$mysqli->query($sql)){ if($result->num_rows>0){ echo"Pumpkin"; while ($row = $result->fetch_array()){ echo"<br />should not be displayed if it doesn't say Pumpkin above"; $level+=1; echo"LEVEL69:$level"; echo<<<HTML <div class = "menutitles" onmouseover="document.getElementById('$table').style.display='block';document.getElementById('$scat2').style.display='block';" onmouseout="document.getElementById('$table').style.display='none';document.getElementById('$scat2').style.display='block';" > <a class="topseltxt2" href="gem.php?cat=$table">$cat pos44</a><br/> <div class="contain" id="$table"> <div class="menuitems" id="$scat2"> HTML; $table=$row[cattable]; echo "$table"; $scat2= $table . 2; echo "$scat"; $cat = $row[cat]; echo "$cat"; select($cat, $table, $scat2, $mysqli, $level); } }else if($level==1){echo" <a class='topseltxt' href='gem.php?cat=$table'>$cat pos2</a><br/> "; echo"table:$table"; }else{ While($row=$result->fetch_array()){ $table=$row[cattable]; $scat2= $table . 2; $cat = $row[cat]; echo" <a class='topseltxt2' href='gem.php?cat=$table'>$cat pos3</a><br/> ";} $level-=1; } }else{ die("ERROR: Could not execute query $sql." . $mysqli->error); }echo"</div> </div> </div>"; } } }else{ die("ERROR: Query failed: $sql." . $mysqli->error); } dczcat1RoundBrilliantdczcat1RoundBrilliant2Round BrilliantSELECT * FROM dczcat1RoundBrilliant ORDER BY positionPumpkin<br />should not be displayed if it doesn't say Pumpkin aboveLEVEL69:2 <div class = "menutitles" onmouseover="document.getElementById('dczcat1RoundBrilliant').style.display='block';document.getElementById('dczcat1RoundBrilliant2').style.display='block';" onmouseout="document.getElementById('dczcat1RoundBrilliant').style.display='none';document.getElementById('dczcat1RoundBrilliant2').style.display='block';" > <a class="topseltxt2" href="gem.php?cat=dczcat1RoundBrilliant">Round Brilliant pos44</a><br/> <div class="contain" id="dczcat1RoundBrilliant"> <div class="menuitems" id="dczcat1RoundBrilliant2"> dczcat1RoundBrilliantWhiteWhiteSELECT * FROM dczcat1RoundBrilliantWhite ORDER BY position<br />should not be displayed if it doesn't say Pumpkin aboveLEVEL69:3 <div class = "menutitles" onmouseover="document.getElementById('dczcat1RoundBrilliantWhite').style.display='block';document.getElementById('dczcat1RoundBrilliantWhite2').style.display='block';" onmouseout="document.getElementById('dczcat1RoundBrilliantWhite').style.display='none';document.getElementById('dczcat1RoundBrilliantWhite2').style.display='block';" > <a class="topseltxt2" href="gem.php?cat=dczcat1RoundBrilliantWhite">White pos44</a><br/> <div class="contain" id="dczcat1RoundBrilliantWhite"> <div class="menuitems" id="dczcat1RoundBrilliantWhite2"> dczcat1RoundBrilliantCitrineCitrineSELECT * FROM dczcat1RoundBrilliantCitrine ORDER BY position</div> </div> </div> I am using tsWebeditor to edit the php files, it loads the files from and saves them directly to the FTP site. If I change anything I see the changes immediately in the browser.
×
×
  • 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.