-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
form post to mysql and then to permenant list on specific url
Muddy_Funster replied to kandsvs's topic in PHP Coding Help
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. -
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?
-
mysqli_connect() won't work inside include file
Muddy_Funster replied to bulrush's topic in PHP Coding Help
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. -
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
-
[*]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?
-
this should help: http://php.net/manual/en/control-structures.if.php
-
Form submition after authentication through CAS
Muddy_Funster replied to tblade's topic in PHP Coding Help
thought about: SESSION_START(); $_SESSION['variable'] = $_POST['variable']; ...etc... include_once "cas.php"; ...your page calling the session var's rather than post... -
Need Some Help With Dynamic Page URLs!
Muddy_Funster replied to designer76's topic in PHP Coding Help
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? -
this help? http://www.php.net/manual/en/function.socket-send.php
-
<---- is now officialy ignoring people who can't post code between tags.
-
have edited muddy.php and changed search.html form to use it. Errors are gone. Also join2.php seems to still work.
-
Please Help! I'm missing something here and I can't see it!!
Muddy_Funster replied to ponx82's topic in PHP Coding Help
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? -
It was join2.php I think...
-
dont select *
-
search multiple fields from one database via 1 qurey
Muddy_Funster replied to pbucc's topic in PHP Coding Help
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. -
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.
-
I think that fixed it. let us know.
-
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.
-
change your error reporting at the very top of your page to <?php error_reporting(E_PARSE); //rest of code ?>
-
2 databases simultaneously update in one script?
Muddy_Funster replied to vijdev's topic in PHP Coding Help
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. -
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.
-
Need Some Help With Dynamic Page URLs!
Muddy_Funster replied to designer76's topic in PHP Coding Help
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? -
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);
-
Need an algorithm that can scan fulltext from MySQL database.
Muddy_Funster replied to dawg00's topic in PHP Coding Help
That's the only way I know of, but I haven't actualy used fulltext. Perhaps somone else has a better idea.