Jump to content

cybernet

Members
  • Posts

    88
  • Joined

  • Last visited

Everything posted by cybernet

  1. 1st of all i don't know the problem that you're experiencing, but php is executing the SQL statement, not Safari, so the problem is in your code let me give you a hint if the $search contains a-Z caracters you can't SELECT text on a numeric field ( int, TINYINT, MEDIUMINT, and BIGINT )
  2. 1st of all i'm sorry for the ironic title i would've name it " i need help with this $statement ", the only problem is that i don't know the name cause i would've so let's cut to the chase i have this if and else statement $status = ''; if ( !isset($_POST[ $x ]) || empty($message) || empty($email) ) $status = $lang['error']; else { $status = $lang['success']; mail($to, $subject, $body, $headers); } the i have this $no_p = ''; $yes_p = "<p style='color:red'>".$status."<br /></p>"; $show_status = (isset($status)) ? $no_p : $yes_p; // this is the function i don't know the name of it // this ? and : sign; what i'm trying to do is 1st of all if and else statement are executed only if the html form is submitted due to a swich case function in the html part i have the $show_status variable which i want to show NULL if the form wasn't submitted and if the form was submitted i want that $show_status to show either $lang['error'] OR $lang['success'] this is the only function i know to do this job, but the problem is that i got stuck this is how i arranged the code switch ($pageID) { case 'submit': foreach( array('lastname','firstname','email', 'message', 'phone') as $x ) { ${$x} = $_POST[ $x ]; } if ( !isset($_POST[ $x ]) || empty($message) || empty($email) ) $status = $lang['error']; else { $status = $lang['success']; mail($to, $subject, $body, $headers); } $no_p = ''; $yes_p = "<p style='color:red'>".$status."<br /></p>"; $show_status = (isset($status)) ? $no_p : $yes_p; break; }
  3. the other sites on my host works perfectly they have the same permision as the current site only the path is changed the other different things is that this site i wrote it myself .. but the problem is that even as a single page ( without the rest of the site ) the script doesn't work :-\
  4. @mikosiko i checked the first time as you said and was still the same error somehow echo $_SERVER['REQUEST_METHOD']; outputs i know for sure that i should get this answer
  5. every site on the server has include /etc/nginx/fastcgi_params; and the file contains fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_param HTTPS $server_https; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200;
  6. nginx as webserver so .htaccess is useless even if it existed ( but doesn't ) i use centos 6 line 12 $id = intval($_GET['id']);
  7. url /view_post.php?post_id=88 full source <?php // plm // require_once (dirname(__FILE__) . "/inc/main.php"); // $lang = load_language('view_post'); echo '<pre>' . print_r($_GET,true) . '</pre>'; if(!isset($_GET["post_id"])) echo "1/id is not set\n"; $post_id = intval($_GET['post_id']); if ( $post_id >= 1 ) { echo "2/yo good"; } else { echo "$post_id\n"; die ("3/no id specified"); } ?> output
  8. full source <?php // plm // require_once (dirname(__FILE__) . "/inc/main.php"); // $lang = load_language('view_post'); if(!isset($_GET["post_id"])) echo "1/id is not set\n"; $post_id = intval($_GET['post_id']); if ( $post_id >= 1 ) { echo "2/yo good"; } else { echo "$post_id\n"; die ("3/no id specified"); } ?> output error.log
  9. how can i defined it if not like this ? $id = intval($_GET['id']); i searched main.php and has no unset problems i even replace $id with $post_id still the same result
  10. now i added if(!isset($_GET["id"])) echo "id is not set\n"; and of curse the error is "id is not set" and i tried to access the page with and without the ?id= the error is the same ...
  11. <?php // plm require_once (dirname(__FILE__) . "/inc/main.php"); $lang = load_language('view_post'); $id = intval($_GET['id']); if ( $id >= 1 ) { dbconn(); // la la la } else { echo "$id\n"; // for debugging die ("no id specified"); } ?> when it's executed of curse i get "0 no id specified" 1. i dont get why i get 0 as a result even if the url is /x.php?id=204 2. in error.log i get i intend to inform that formerly the script was running smoothly on lighttpd webserver, now i use nginx ( so i wont use words ) i know that are people with more complicated things around here ... but still i'm struggling for 1 hour with this xxx thanks in advance btw : php version 5.3.x
  12. i need a mysql class so i can use it like this $this->q("SELECT * FROM posts"); something like that i'm a newbie in smarty and only php basic knoledge
  13. your signature fits the reply ) sorry for offtopic but i had to say it
  14. $postlist = new Smarty; ... case 'submit': foreach(explode(":","desc:title") as $v) { if (!isset($_POST[$v])) $postlist->display('no_posted_data.tpl'); } post.tpl <form action="post.php?action=submit" method="post"> <legend>..title..</legend> <table border="1"> <tr> <td>{$post_form.title}:</td> <td> <input type="text" name="title" size="40"> </td> </tr> <tr> <td valign="top">{$post_form.desc}:</td> <td><textarea name="desc" cols="80" rows="10"></textarea></td> </tr> <tr> <td colspan="2" align="center"> <input type="submit" value="Submit"> </td> </tr> </table> the only problem is that if i submit the form empty is still get processed any help please ? i have even tried in a template {if !isset($_POST['title']) } die? {/if}
  15. please delete topic
  16. i would like to create a posting page just like this form i'm writing now including return ( <br/> ) pagination, and language codes ( php mysql c++ c# ... etc without affecting site security ) are there any good tutorials i can follow or any advice ? i'm very new to smarty and i have only basic php knowledge to prove that i'm not lazy and i read the documentation this is what i got so far <?php require('../dev0_inc/smarty/Smarty.class.php'); require('../dev0_inc/config/ride_mysql.php'); $smarty = new Smarty; $smarty->error_reporting = E_ALL & ~E_NOTICE; // $smarty->debugging = true; $smarty->caching = false; $smarty->cache_lifetime = 120; // setConfig for *.conf files $smarty->setConfigDir('../dev0_inc/config'); // $smarty-> // sqL $result = mysql_query("SELECT * FROM posts ORDER BY `id` DESC LIMIT 0 , 50") or die(mysql_error()); // For each result that we got from the Database while ($line = mysql_fetch_assoc($result)) { $value[] = $line; } // Assign this array to smarty... $smarty->assign('posts', $value); $config['cyber_date'] = '%d %b %y, %T'; $smarty->assign('config', $config); $smarty->display('index.tpl'); ?> and i'm using phpmyadmin to insert data so far i read from documentation that i have to escape the assign values, but i don't know if it's secure using smarty 3.1.1, thanks for reading - cybernet
  17. thanks for being patient with me it worked
  18. i don't think you understood me index.php is flawless ( i think ) if on index.php i select Bauturi alcoolice on post page i wanna get Bauturi alcoolice this code is good <?php error_reporting(E_ALL); $drop = $_REQUEST['bauturi']; echo $drop; ?> but as result i get bauturi_alcoolice instead of the value that is equal with it
  19. i have two pages form and submit page index.php <?php error_reporting(E_ALL); $bauturi = array('bauturi_alcoolice'=>'Bauturi alcoolice','sucuri'=>'Sucuri','bauturi_racoritoare'=>'Bauturi racoritoare'); echo '<form action="post.php" method="post">'; echo'<select name="bauturi">'; foreach($bauturi as $let=>$word){ echo'<option value="'.$let.'">'.$word.'</option>'; } echo'</select>'; echo '<INPUT type="submit" value="show me money"> </form>'; ?> post.php <?php error_reporting(E_ALL); $drop = $_REQUEST['bauturi']; echo $drop; ?> if i select Bauturi alcoolice on post.php page i get bauturi_alcoolice but i want to get Bauturi alcoolice as result i tried to use foreach like this <?php error_reporting(E_ALL); $drop = $_REQUEST['bauturi']; $bauturi = array('bauturi_alcoolice'=>'Bauturi alcoolice','sucuri'=>'Sucuri','bauturi_racoritoare'=>'Bauturi racoritoare'); foreach($bauturi as $drop=>$word){ echo $word; echo "<br/>"; unset($word); } ?> but i get all the values in the form i only want to show the selected value from the form in post.php page thanks in advance
  20. i'm having a problem that belongs to javascript forum and css so i posted twice http://www.phpfreaks.com/forums/index.php?topic=329389.msg1550291#msg1550291 any guy with javascript please read the above link any help is appreciated
  21. thanks for the reply this is the output of the mouseover ( without you're modification ) that background is #0e0d0b but i don't wanna change that, i just wanna make it transparent like this ( i modified the image with gimp )
  22. i have this to files http://code.google.com/p/cyby/source/browse/trunk/js/cyber.js and http://code.google.com/p/cyby/source/browse/trunk/css/cyber.css i know this has 2 different topic for each one but together they create a usefull mouseover what i'm trying to do is to make the mouseover transparent where can i change that after a google search i know that "opacity:0.4;filter:alpha(opacity=40)" will do the trick but i have no idea where to edit any help will be appreciated
×
×
  • 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.