Jump to content

jac.kock

Members
  • Posts

    52
  • Joined

  • Last visited

Everything posted by jac.kock

  1. hi, try to query with like exp.: $qwery='6'; $sql="select * from [youre table] where [table field exp.: dayofweek] like '%$qwery%'"; $result=mysql_query($sql); ect ect ....
  2. hi all, im making a CMS and the website uses a php page main to display pages stored in the sql database! now my problem is that everything works fine but wen i call a page from de db with html and php code it will not display the php code, i work whit str_replace to replace %php_open% to <? and %php_close% to ?> because sql don't saves <?php i write the pages as %php_open% tot save in cms. this works fine and when i want to open the page all htm is visable but the php is notm when i open the source in the browser i see the php nice and well as it should be. what am i doing wrong to show the php ?? SOURCE CODE: </td> <td width="98%"> <br /> < b>Notice</b>: Undefined index: admin in <b>/home/vhosts/pc-hulp-online.nl/subdomains/test/httpdocs/main.php</b> on line <b>16</b><br /> <? function getIp() { if( isset( $_SERVER[ "HTTP_X_FORWARDED_FOR" ] ) ) { $return = $_SERVER[ "HTTP_X_FORWARDED_FOR" ]; } else if( isset( $_SERVER[ "HTTP_CLIENT_IP" ] ) ) { $return = $_SERVER[ "HTTP_CLIENT_IP" ]; } else { $return = $_SERVER[ "REMOTE_ADDR" ]; } return $return; } ?> <H1>Uw external IP:</H1><P>Deze is door uw provider aan u toegewezen, en kan nodig zijn bij speciaal ontwikkelde software zoals bijv. een chat server of andere servers zoals een FTP of HTTP server, of bij Remote desktop services </P><P>Uw huidige external IP Adres is: <? getIp(); ?></P><P><FONT color=#ff0000>Copyright by pc-hulp-online.nl ©®20013 </P></FONT> </td> <td width="1%"> </td> this ia exactly what it should be after getting it out off the db and replaced the %php_open% strings why don't display the IP??? can someone help me?? thnx jamie kock (holland)
  3. hi, $a was for a test i did i used it like: function set_blok($blk) { foreach($blk as $var;$a=$a++) { if($blk[$a]=='') { $set='0'; } else { $set='1'; } //this i tryed to see if it needs to be 0 or 1 $sql="update users set blokkeren='$set' where user_id='$var'"; $res=mysql_query($sql); } if(!$res) { return false; } else { return true; } } i tryed to get each $blk array i want when i uncheck the box that it set it to 0 en by checked to 1 can you help me? thnx
  4. hi all, i want to run in my cms a script that can set up or remove a user_block. what i have so var will set 1 tot the database but i cant seem to return it to 0, so i hope that someone will help me to solve it! code so var: // this function is called in a form with while(ect....) <checkbox id='[b]' value='$user_id'> for more than one user //set blokkeren function set_blok($blk) { foreach($blk as $var) { if($blk[$a]=='') { $set='0'; } else { $set='1'; } //this i tryed to see if it needs to be 0 or 1 $sql="update users set blokkeren='$set' where user_id='$var'"; $res=mysql_query($sql); } if(!$res) { return false; } else { return true; } }
  5. because i thought it was handy in the main index i use session_start() suggestions? thnx Might be something I'm missing, but I honestly don't see how you set or change the session data. Some of your code is missing. You could do as I said, use GET to fetch the change and then use it to set the session data. oke any suggestions to make it work what i want to do?? any examples?? thnx
  6. because i thought it was handy in the main index i use session_start() suggestions? thnx
  7. hi all, i have been struckling with this code of mine i want when i click a link to change the setting for the menu (see code) <? echo "[".$_SESSION['menu']."]"; ?> <table class="border_test"> <tr> <td valign="top" align="left"> <!-- menu items: menu --> <img src="../design/item.png" width="10" height="10"><a href="<?=$_SERVER['REQUEST_URI'];?>" onclick="<? $_SESSION['menu']=1;?>"><b> Site menu:</b></a> </td> </tr> <? if($_SESSION['menu']==1) { echo ' <tr> <td> <img src="../design/subitem.png" width="10" height="10"> <a href="?topic=add_menu">Toevoegen menu item.</a><br> <img src="../design/subitem.png" width="10" height="10"> <a href="?topic=edit_menu">Bewerken menu item.</a><br> <img src="../design/subitem.png" width="10" height="10"> <a href="?topic=del_menu">Verwijderen menu item.</a> </td> </tr>'; } ?> <tr> <td> <!-- menu items: submenu --> <img src="../design/item.png" width="10" height="10"><a href="<?=$_SERVER['REQUEST_URI'];?>" onclick="<? $_SESSION['menu']=2;?>"><b> Site submenu:</b></a> </td> </tr> <? if($_SESSION['menu']==2) { echo ' <tr> <td> <img src="../design/subitem.png" width="10" height="10"> <a href="?topic=add_submenu">Toevoegen submenu item.</a><br> <img src="../design/subitem.png" width="10" height="10"> <a href="?topic=edit_submenu">Bewerken submenu item.</a><br> <img src="../design/subitem.png" width="10" height="10"> <a href="?topic=del_submenu">Verwijderen submenu item.</a> </td> </tr>'; } ?> <tr> <td> <!-- menu items: Pagina's --> <img src="../design/item.png" width="10" height="10"><a href="<?=$_SERVER['REQUEST_URI']; ?>"><b> Pagina's:</b></a> </td> </tr> </table> so what it wil do is show the subitem list of the main menu item when de var is changed! butt when i use it it always set to the last ( in this case to: 2 ) even when i click the first link to set it to 1 can somebody help me to get it to work? thnx,
  8. hi, i have read it and change the lines but still no html view and still in the unwanted folder??? can you be specific?? thnx, now i have it in html view but stil in the unwanted folder how can i make sure that it comes in the folder mail in?? thnx,
  9. hi, i have read it and change the lines but still no html view and still in the unwanted folder??? can you be specific?? thnx,
  10. hi all, im working on a email send to de user who register on the website! now i get the email but its not email/html view and it gets in to the unwanted folder, also as i siad trust this emailadress! what do i wrong in the code?? the whole php file see //#### XXX ### where i need help! <?php Session_start(); if(file_exists("support/functions_alg.php")) // user,pass and database file { include("support/functions_alg.php"); // database functions file } if($_REQUEST) { $email=$_REQUEST['email']; $pass=md5( $_REQUEST['pass'] ); $secc=md5( $_REQUEST['sec_code'] ); function check_code($secc) { if($secc == $_REQUEST['mdcode']) { return true; } else { return false; } } function check_email_address($email) { // First, we check that there's one @ symbol, and that the lengths are right if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. return false; } // Split it into sections to make life easier $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; } } } return true; } if(check_email_address($email)) { if(check_code($secc)) { //$res=register($email,$pass,$name,$address,$huisnr,$zipcode,$plaats,$dob_year,$dob_month,$dob_date,$tel); $res=true; if($res==true) { // ##### XXX ##### //mail function /* subject */ $subject = "Activeer uw Profiel"; /* To send HTML mail, you can set the Content-type header. */ $headers = "MIME-Version: 1.0 \r\n"; $headers .= "Content-type: text/html; charset=utf-8 \r\n"; /* additional headers */ $headers .= "From: " . $mailme . " \r\n"; /* and now mail it */ $text = ' <html> <head> <title>Nieuw profiel</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> Activeer uw profiel op:<br><br> <a href="http://'.$_SERVER['SERVER_NAME'].'/?reg_result&activatie=true">Activeer</a>br><br> Veel plezier op onze website! </body> </html>'; $res = mail($email,$subject,$text,$headers); echo("<script>document.location.href='index.php?topic=reg_result&".$res."'</script>"); //header('location: "'.$_SERVER['HTTP_REFERER'].'?topic=reg_result&true"'); //###### XXXX ####### } else { echo "<table border=1 class=outer_tbl align=center width=50% style='border-collapse:collapse;'>"; echo "<tr><td align=center>"; echo "Fout tijdens registratie<br><a href='javascript:history.back();'>Klik hier</a> om opnieuw te proberen"; echo "</tr></td></table>"; } } else { echo("<script>document.location.href='".$_SERVER['HTTP_REFERER']."&error=code'</script>"); //header('location: "'.$_SERVER['HTTP_REFERER'].'&error=code"'); } } else { echo("<script>document.location.href='".$_SERVER['HTTP_REFERER']."&error=email'</script>"); //header('location: "'.$_SERVER['HTTP_REFERER'].'&error=email"'); } } ?> the recived email looks like : Content-type: text/html; charset=utf-8 From: info@pc-hulp-online.nl Return-Path: anonymous@server70.hosting2go.nl X-OriginalArrivalTime: 30 Apr 2012 10:47:41.0985 (UTC) FILETIME=[AB19D110:01CD26BE] <html> <head> <title>Nieuw profiel</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> Activeer uw profiel op:<br><br> <a href="http://nieuw.pc-hulp-online.nl/?reg_result&activatie=true">Activeer</a>br><br> Veel plezier op onze website! </body> </html> please help me!! thnx,
  11. moved and still no change?? wath's the problem now with it?? http://nieuw.pc-hulp-online.nl thnx,
  12. hi, i have tested whit only this: if(!isset($_SESSION['Size'])) { echo '<style type='text/css'> body { font-size: 300%; } </style>'; } like you said, butt my text stays the same??? why??? see http://nieuw.pc-hulp-online.nl/index.php thnx
  13. you got a error : Uninitialized string offset: 0 in /home/daniel/public_html/footer.php on line 23 and its not clear how tro get the code again when saving it there!!!!
  14. hi, i want to resize the font-size in my website ussing php butt it doenst work why ?? can someone help me to get it working?? <html> <head> <title>Een website naam.</title> </head> <!-- this doent work, this was a test to see ik ik works!! --> <style type='text/css'> html{ font-size: 300%; } </style> <!-- this is my php code for working with resize!! This must got to work !!! --> <!-- Start varible font-size --> <?php //start session Session_start(); $_SESSION['FontSize']='300'; // check default fontsize if($_SESSION['FontSize']=='') { ?> <style type='text/css'> body { font-size: 100%; } </style> <?php } else { echo "<style type='text/css'>body { font-size: ".$_SESSION['FontSize']."%; } </style>"; } ?> <!-- end varible font-size --> how can tell my wath i do wrong??? thnx,
  15. hi drummin, whwn i use: include("http://nieuw.pc-hulp-online.nl/modules/counter/counter.php"); than i see nothing and also no misloaded picture???? i will show you the code so please tell me why it doesnt work? <!-- start spacer --> <tr> <td class="spacer"> </td> </tr> <!-- end spacer --> <!-- start copyrights / about / sitemap / ect. --> <tr> <td class="copyrights" align="center"> <!-- counter call --> || <?php include("modules/counter/counter.php"); ?> <!-- end counter call --> || <?php echo $OwnerCopyright; ?> || <a href="?topic=Contact" title="Contact weergeven">Contact</a> || <a href="?topic=Copyrights" title="Copyright info">Copyrights</a> || <a href="?topic=Disclamer" title="Disclamer algemene voorwaardens!">Disclamer</a> || <a href="?topic=Sitemap" title="Sitemap weergeven">Sitemap</a> <!--|| Designed By: <a href="http://pc-hulp-online.nl" target="new" title="Design By:">pc-hulp-online</a>--> || <!-- deze is voor nette afsluiting balkje --> </td> </tr> <!-- end copyrights / about / sitemap / ect. --> </table> <!-- end table for website desige --> </td> </tr> </table> <!-- end main table --> <!-- end webpage design like tables --> <a href="modules/counter/counter.php" target="new" >see here the counter working!!</a> take a look and please help me!! thnxs
  16. hi all, i have made a counter as a module for my website. when i directly go to de module and start de counter i see the picure en he does his work, butt wen i call it in de index.php by include('modules/counter/counter.php') then i see een not loaded picturebox and i dont know why it doesnt works ? you can see the counter and the problem on: http://nieuw.pc-hulp-online.nl/index.php can someone help me to make it als work with include()?? thnx
  17. hi, you mean something like an recycle bin as table that tels me where some is delete with tabel_name en item_id? well i think i could make that thanx for the help guy's
  18. hi, its about 14 tables where i want to check if they are deletted bij there del_tab='1' to show in de cms so that i casn reset them if needed:) and the smallesd table has about 2300 items so thats why i want to search the whole bd butt if there is no code for it i must make one that search all bij there table names thnx jamie ( holland )
  19. hi all, is there a sql query that looks in every table for a given string? now i just do: $sql="select * from [the table] where name_desc like "'$string'" and del_tab='0'"; this search only that given tabel but is ther a query thats search trough the whole bd? thnx all for youre help jamie ( holland)
  20. mabey when you set repto_error(0); to 1 mabey it will show youre error?
×
×
  • 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.