Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. no problem, most of the people here could write that for you in about 10minutes (assuming you have a database and know the details). Doing it right with proper validation and error checking would take a good bit longer and would depend on the number of fields in the form and how secure you wanted it. Again, not a massive task, you will just need to elaborate as to whether you want the information hard writen into the html page code or if you want it to use a a lookup to the database to display. Summary - Yes it is possable, and it can be as easy or hard as you want to make it.
  2. That code specificly shouldn't cause any memory problems for the server although I am a little baffled by your SQL. could you explain it please?
  3. At first glance you have your execute query the wong way round. mysqli_query($dbc, $query) should be: mysql_query($query, $dbc) //or even just mysql_query($query) also I notice that you are stripping all the white space out of your query before you run it. Personal recomendation would be to not do that, it can cause problems with WHERE clauses on occasion. Give some thought to using something like this: $query_check=trim($query); if (empty($query_check)) { $s=$_SERVER['PHP_SELF'].' crCreateSelect ERROR: param 1 query is empty.'; die($s); } ... $result = mysql_query(mysql_real_escape_string($query)) Just a thought though.
  4. or... <?php $source = file_get_contents(source.php) echo '<form>'; echo '<textarea name = "source">'; echo $source; echo '</textarea></form>'; ?> as for your "copy to clipboard" option, you'll need client side scripting like jscript, not php
  5. [*]Where are you planing on having these ini files stored? [*]Do you know how utterly insecure it is to store account information in unencrypted flat files [*]Have you heard of MySQL?
  6. this should help: http://php.net/manual/en/control-structures.if.php
  7. thought about: SESSION_START(); $_SESSION['variable'] = $_POST['variable']; ...etc... include_once "cas.php"; ...your page calling the session var's rather than post...
  8. just as well you found this site then, where people actualy know what they are talking about! it makes no difference to php where it gets the information from, so long as there is information to get - there is code that will get it. It may be that you need to tweek how you set your $path if the pages arn't loading from with the folders but there is no restriction in php regards loading flat files from the server. Did you try using the arrays as I sugested?
  9. this help? http://www.php.net/manual/en/function.socket-send.php
  10. <---- is now officialy ignoring people who can't post code between tags.
  11. have edited muddy.php and changed search.html form to use it. Errors are gone. Also join2.php seems to still work.
  12. I'm probably not alone here, but I really can be bothered looking at your code for you when you can't even be bothered to enclose it in the proper tags (and if your thinking about the "I didn't know about those" then you clearly didn't bother to read the 'Rules & TOS' before you posted either). Although, that siad...Why the hell do you have an unconditional die statement in the middle of your page?
  13. ahhh....but you assume he has a development machine!
  14. It was join2.php I think...
  15. dont select *
  16. If I could reach you I'd slap you up side the head for suggesting not just 1 SELECT *, but 4 for the one dataset!! and on a table with ony 4 columns!! what the OP wants to do is create a single form with the 4 search criteria: <form action="search.php" type="submit" method="post"> <label> Name: </label> <input type="text" name="name" value="" /> <label> Type: </label> <input type="text" name="type" value="" /> <label> Country: </label> <input type="text" name="country" value="" /> <label> Color: </label> <input type="text" name="color" value="" /> <input type="submit" value="Search Now!" /> </form> Now on the search.php page take each of your POST variables and assign them to page variables that you can use to build your SQL SELECT query.
  17. hmm...not somthing I have come accross before. My best guess would be to store your code in a flat file (.txt for example), load it into a variable with FILE_GET_CONTENTS() and then use str_replace() to remove all formating before echong the code to the page. This is a *relativly* high overhed for the server just to produce a page however and there is probably a MUCH better way of doing it, but I just don't know what it is.
  18. I think that fixed it. let us know.
  19. use a while loop to run through each of the sql select results: $qry = "SELECT brand_name, brand_logo, site_link, video_link FROM tableName where catagory = 'Taxi'"; $result = mysql_query($qry) or die (mysql_error()); while ($row = mysql_fetch_assoc($result)){ ?> <div id="categ"> <div id="inside"><?php echo $row['brand_name']; ?></div> <div id="inside1"><a href="#"><img src="<?php echo $row['brand_logo']; ?>" /></a></div> <div id="inside2"><?php echo $row['short_desc']; ?> <a href="<?php echo $row['site_link']; ?>">continuare</a> </div> <div id="inside3"><a rel="shadowbox;width=405;height=340" title="Restaurant Daniel - New York, NY" href="<?php echo $row['video_link']; ?>"><img src="img/tur_act.jpg" /></a></div> </div> <?php } ?> and please use the tags when posting code on here.
  20. change your error reporting at the very top of your page to <?php error_reporting(E_PARSE); //rest of code ?>
  21. No you don't need to assign a different mysql_select_db() to each query. As David said, as long as its on the same server you can point your query to the database in the query it's self. Either by using DATABASE_NAME.table_name or by including a USE statement at the start of your sql. As for Triggers... see HERE But as you don't know what they are, I'm thinking it's probably best you don't try to use them at this stage.
  22. You do know that hiding a problem is not the same as fixing it? Rather than attempting to hide the error messages I would suggest fixing your code so that only email address which are formated correctly will be proccessed. This way at least any erronious email addresses will be left for the mail server to deal with.
  23. Because you are running the full URL header in the <div> it isn't very flexable. Which is probably what is throwing you when you try to add another level of complexity. Think about assigning the header values first to either a series of page specific variables or, better still, a couple of arrays. then call the array values in the <div> list links. This lets you assign the appropriate page per link sub level much more effectivly. $catagory = array("watch" => "?catagory='watch'", "clock" => "?catagory='clock'"); $type = array("gold" => "&type='gold'", "silver" => "&type='silver'", "watch" => "?type='watch'", "clock" => "?type='clock'"); Using arrays like this lets you set your list links refferentialy: <div class="navigation"> <ul> <li class="watch"><a id="wacthId" href='index.php<?php echo $type['watch']; ?>' title ="Watches">watch link</a> <li class="clock"><a id="clockId" href='index.php<?php echo $type['clock']; ?>' title="Clocks">clock link</a> ... ... <li class="gold_watch"><a id="gold_watchId" href='index.php<?php echo $catagory['watch'].$type['gold']; ?>' title="Gold Watch">gold link</a> </div> does that help any?
  24. what do you get if you echo out $sql after it is built? cahnge the or die on line 42 to be: or die (mysql_error()."<br><br>Query Text:<br>".$sql);
  25. That's the only way I know of, but I haven't actualy used fulltext. Perhaps somone else has a better idea.
×
×
  • 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.