rpadilla
Members-
Posts
28 -
Joined
-
Last visited
Never
Everything posted by rpadilla
-
I'm not sure if using fwrite twice would work, but anyway just try it, if it won't work, just use 1 fwrite, still just go to www.php.net/fwrite cheers.
-
use fopen first, http://php.net/fopen
-
try this $body = "Welcome $name This is a test 1)blahblah 2)blahblah";
-
try inserting a marker in your insert statment, to make sure its really executed like mysql_query($query) or die('Could not query: ' . mysql_error()); echo 'my query was executed'; also try making some error codes, maybe error reporting is off.
-
you can parse the .sql file , you can use fopen to read it and use the semicolon as your marker on which the sql ends make sure to leave the remarks too and the spaces. check out string functions in php, to help you determin where is the start and end of the query statement. good luck.
-
[SOLVED] Logging out after a certain time.
rpadilla replied to HappyPandaFace's topic in PHP Coding Help
set the cookie expiration to what you need, say ... every refresh the cookie will be set to 1 hour, if they close the apps and open again after 30 mins they are still logged in, if it is more than an hour, the cookie has already expired. In that way it still makes a count down -
try if(!isset($_REQUEST['action']) && strlen($_REQUEST['action']) == 0){ die("No function Value given"); } also try inserting some stuff in your case 'insert' like echo 'insert' or try to echo $_REQUEST['action'] cheers
-
You'll need to read more about security and stuff, its a bit complicated, best way is get a free forum script and make sure its updated. cheers
-
checkout my first post, it should do that, if you have just two or three variables just use the $_SESSION page1.php session_start() $_SESSION['value1'] = $_POST['value1']; $_SESSION['value2'] = $_POST['value2']; page2.php session_start(); echo $_SESSION['value1']; echo $_SESSION['value2'];
-
well, I think from start the user submit the data, to some script 1, then script 1 pass the data to script 2. I guess
-
1. You can try putting the data in the url like this redirect.php?value=1&value2=2 but this one is a bit insecure, 2. you can put it in a session, since it will be saved, when you go to the next page. session_start() $_SESSION['value'] = 33; 3. or you can store it in the db, its a bit complicated though.
-
best way is use an html to pdf scripts, it's actually free... yeah just google it,
-
Contact form, very simple error? but very tricky.
rpadilla replied to bilis_money's topic in PHP Coding Help
try adding line breaks and stuff to make sure where is line 1. -
thats looks like a Class to me, you should include some files, or maybe a library? not sure though. For cache problems, one way to overcome it is to add a random value in your URL, since some ISP servers do some caching. so basically you can add something like this www.domain.com?page.php?x=8734745 where 8734745 is a random value or better you can try using php's function output_add_rewrite_var http://php.net/output_add_rewrite_var
-
[SOLVED] Block requests for specific file extentions .asp .cgi
rpadilla replied to Malcerous's topic in Apache HTTP Server
Im not sure if a DOS attack or some spamers crawling the net, looking for something. anyway you can make some settings in your httpd.conf to redirect 404 /file not found to some file... I think I'll just ignore it anyway.... -
the code I posted should work with the 1 sql per line;
-
nope, $rows just contain one instance, the count is $count = mysql_num_rows($res);
-
$handle = fopen("script.sql", "rb"); while (!feof($handle)) { $text = fgets($handle, 4096); if (!empty($text) ) { mysql_query($text); } } fclose($handle);
-
connect to mysql db as different user with in session
rpadilla replied to c_shelswell's topic in PHP Coding Help
from php.net mysql_query ( string query [, resource link_identifier]) try $delRes = mysql_query($delQ, $conn); -
here you go file test.php <?php $action = $_POST['action']; if (isset($action) ) { $name = $_POST['name']; if ($name=="Friday") echo "Have a nice weekend!"; elseif ($name=="Saturday") echo "Tomorrow is Sunday!"; else echo "Please enter Friday or Saturday"; } ?> <form method="post" > Name: <input type="text" size="10" maxlength="40" name="name"> <input type="submit" value="Send"> <input type="hidden" name="action" value="submitted"> </form>
-
include a hidden input tag inside your form <input type="hidden" name="action" value="submitted"> <? $action = $_POST['action']; if ($action == 'submitted') { //your codes here... } ?> cheers
-
PHP from an Alias directory
rpadilla replied to squibs's topic in PHP Installation and Configuration
add this in your httpd.conf <Directory "/var/www/vhosts/sharedscripts "> AddType application/x-httpd-php .php .phtml </Directory> cheers. -
while($catqry = mysql_fetch_array(mysql_query("SELECT * FROM CATEGORIE ORDER BY VolgNr"))) you get a new resource everytime... thats why it loops forever. you should do like this $sql = " SELECT * from ..."; $res = mysql_query($sql) or die(mysql_error()); while($rows = mysql_fetch_array($res)) { .... ...
-
hi, the trick here is to redirect back again, so that when the user refreshes the page it won't re submit the data so in the end of the submission process of the data do something like this header("location: whereyouwanthimback.php"); in this way refreshing, won't make a resubmit of data. cheers
-
[SOLVED] Logging out after a certain time.
rpadilla replied to HappyPandaFace's topic in PHP Coding Help
Hi, use cookie, like what other web apps do, when you check the box, remember me, this will save some cookie values on the client computer, so when you open your the site again you don't need to re login. basically the md5 hash of the password and username is saved in the cookie, and when the user goes to the site again, it will read the cookie, and used the values to log you in. Good luck.