-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
If that line isn't in there, you probably have a custom php install. In that case you need to add the line to php.ini and download the sockets dll. In order to get the php_sockets.dll: - Download the regular php zip file from http://www.php.net/downloads.php - Find the dll in the ext directory - Extract the php_sockets.dll to the ext directory of your install (probably at c:\program files\PHP\ext) check phpinfo(); to test its installed correctly
-
okay now repeat, add another field ie $sql = odbc_prepare($conn, "INSERT INTO tblCard (username, name) VALUES ('$username', '$name')" ); then $sql = odbc_prepare($conn, "INSERT INTO tblCard (username, name, type) VALUES ('$username', '$name', '$type')" ); then $sql = odbc_prepare($conn, "INSERT INTO tblCard (username, name, type, number) VALUES ('$username', '$name', '$type', '$num')" ); then $sql = odbc_prepare($conn, "INSERT INTO tblCard (username, name, type, number, exp) VALUES ('$username', '$name', '$type', '$num', '$ex')" ); then $sql = odbc_prepare($conn, "INSERT INTO tblCard (username, name, type, number, exp, sec) VALUES ('$username', '$name', '$type', '$num', '$ex', '$sec')" ); when it fails remove that field and continue onto the next one until all but 1 or 2 fields are in, then we're try to fix those
-
[SOLVED] 404 Not found when open a file in new window
MadTechie replied to kristo5747's topic in PHP Coding Help
Okay, if i had a file on my webserver and the file path was c:\webserver\wwwroot\example\myfile.txt the URL wouldn't be c:/webserver/wwwroot/example/myfile.txt assuming my webserver pointed to wwwroot the top level of the webserver would be c:\webserver\wwwroot\ BUT the webserver would see it as root so the same as / now with that in-mind you need to workout the relational path from the script your in to the file you want to get.. ie /myscript.php /example/myfile.txt Now the file is infact stored c:/webserver/wwwroot/example/myfile.txt BUT the web root is c:/webserver/wwwroot to my URL is /example/myfile.txt does that make sense? Now when your script runs it has file access which means it can use the full path c:/webserver/wwwroot/example/myfile.txt but thats for the script only.. a web user would need to use http://www.domain.com/example/myfile.txt -
okay, thats atleast something lets try something simpler change $sql = odbc_prepare($conn, "INSERT INTO tblCard (username, name, type, number, exp, sec) VALUES ('$username', '$name', '$type', '$num', '$ex', '$sec')" ); to $sql = odbc_prepare($conn, "INSERT INTO tblCard (username) VALUES ('$username')" );
-
I'm Not 100% sure this is what your asking for but <?php function cells($dataset){ $rows = array(); $last = ""; while ($record = @mysql_fetch_row($dataset)) { $cols = array(); foreach ($record as $value) { $cols[] = '"'.addslashes($value).'"'; } //echo $cols[3]; if ($cols[3] == '"0"') { $rows[] = "\t[".implode(",", $cols)."]"; } else { if($last == $cols[3]) { //repeated from last $rows[] = "\t[".implode(",", $cols)."]"; }else{ $rows[] = "\t[".implode(",", $cols)."],[]"; } } $last = $cols[3]; } echo "[\n".implode(",\n",$rows)."\n];\n"; } ?>
-
Erm... (just double checked) Can you double check that..! it can't be true and false! also can you ADD echo odbc_errormsg($conn); just above the odbc_close($conn);
-
have you tried the pull path to the XYZ ?
-
LOL, infact that failed.. (bug in you/my/our code) change if (!odbc_execute($sql)) to if (odbc_execute($sql)) and try again you should get an erro this time
-
change echo "<img src='/venue/files/' ".$row['logo_image']." '>"; to echo "<img src='/venue/files/".$row['logo_image']."'>"; that will display an image if their is one, but if theirs no image your need a default image ie $noImage = "MyNoImageImage.jpg"; $img = (empty($row['logo_image']))?$noImage:$row['logo_image']; echo "<img src='/venue/files/$img'>";
-
[SOLVED] Error message not displaying
MadTechie replied to dennismonsewicz's topic in PHP Coding Help
LOL, yeah had those! -
try this <?php $name= $_POST['name']; $num= $_POST['num']; $type= $_POST['type']; $ex= $_POST['ex']; $sec= $_POST['sec']; if ( !( $conn = odbc_connect( "db09", "",""))) die( "Could not connect to database" ); $sql = odbc_prepare($conn, "INSERT INTO tblCard (username, name, type, number, exp, sec) VALUES ('$username', '$name', '$type', '$num', '$ex', '$sec')" ); /* check for errors */ if (!odbc_execute($sql)) { echo "Thank you for registering a Card!"; }else { // you must set the connection first if (odbc_error()) { echo odbc_errormsg($conn); } echo "Unfortunately there has been a problem - please <a href='card.php'>Try again</a>"; echo $name; echo $num; echo $type; echo $ex; echo $sec; echo $username; } odbc_close($conn); ?>
-
[SOLVED] Error message not displaying
MadTechie replied to dennismonsewicz's topic in PHP Coding Help
$submit_msg = '<span class="errormsg">'; $submit_msg = 'There was an error processing your submission. Please try again!'; $submit_msg = '</span>'; should be $submit_msg = '<span class="errormsg">'; $submit_msg .= 'There was an error processing your submission. Please try again!'; $submit_msg .= '</span>'; -
add // you must set the connection first if (odbc_error()) { echo odbc_errormsg($conn); } and see what the error is
-
Please stick to one topic per problem, i have already marked one as solevd, and this topic shouldn't even be opened, as its pointless people can see the whole picture and your just get members repeating them selfs, you have had 3 topics about the same question, to sum up, (like EVERYONE is saying) use preg_replace (i have no idea why you keep saying how can i do this with str_replace.. if you really don't wanna use preg_replace then your need to use a few str_replace's instead and it will probably have more problems.
-
[SOLVED] 404 Not found when open a file in new window
MadTechie replied to kristo5747's topic in PHP Coding Help
Erm.. isn't a valid URL,, thus you get the protocal http and the domain (being the one your on) So what are you trying to correct?.. What is the correct URL of the file ? -
sockets not being installed.. your need to install them see here
-
As your installing OO, (which i think is the best solution but not always possible) then to save some time, you may want to create a macro to do the editing and PDFing, and then just have PHP call those macros, i'm just saying this as it may help, even if you only use the macro to create the PDF (as i think theirs on on their site)
-
[SOLVED] AJAX populating form fields from Select Drop Down
MadTechie replied to ncosgrove's topic in Javascript Help
Cool if solved please click solved -
Seams fine in IE 7 and FF3
-
also useful with times ie 7 days = (7*24*60*60) is this topic solved ? (if so please click solved)
-
just tried to login with test account The requested URL /post.php was not found on this server. <?php session_start(); require "config.php"; $login_id = $HTTP_POST_VARS['loginid']; $password = $HTTP_POST_VARS['password']; $sql= "select * query"; $result=executeQuery($sql); if($line=mysql_fetch_array($result)) { //$msg= "Login Successful"; $_SESSION['login_id'] = $line['id']; //this update could be wrong as i have no idea about your table setup! //session_register('msg'); header("Location: postrecipe.php "); exit; } else { $_SESSION['msg']= "Login Failed : Check Login and Password"; header("Location: login.php "); exit; } ?>
-
PHP include affecting other results on page
MadTechie replied to howardmoore's topic in PHP Coding Help
So you have an include that calls "contents" and another one that calls "contents" ie Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello <?php include "databasecontents.php"; ?> WORLD WORLD WORLD WORLD WORLD WORLD WORLD WORLD WORLD WORLD WORLD <?php include "databasecontents.php"; ?> so when you do this Main Main Main Main Main Main <?php include "page1.php"; include "page2.php"; ?> and you end up with if the above is the problem then you have a few solutions #1 use include_once("databasecontents.php") #2 break it up more ie Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello <?php include "databasecontents.php"; ?> Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello <?php include "page1.html"; include "databasecontents.php"; ?> then in main call include "page1.html"; instead of include "page1.php"; -
No, well it depends on everything else (your user input filtering), session hijacking could be a problem (see session_regenerate_id()) if your on a shared host they maybe able to access the session files, but on a whole their secure
-
http://jaika.co.nr/postrecipe.php doesn't exist http://jaika.co.nr/login.php doesn't exist $HTTP_POST_VARS [deprecated] use $_POST $sql= "select * query"; Huh! $result=executeQuery($sql); is this part or a prepared statment ? or a function! session_register [deprecated] use $_SESSION